react-native-unistyles 3.0.0-beta.4 → 3.0.0-beta.6
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 +18 -3
- package/android/src/main/cxx/NativeUnistylesModule.cpp +2 -2
- package/android/src/main/cxx/NativeUnistylesModule.h +1 -1
- package/android/src/main/java/com/unistyles/NativePlatform+android.kt +1 -2
- package/android/src/main/java/com/unistyles/NativePlatform+insets.kt +4 -0
- package/android/src/main/java/com/unistyles/NativePlatform+listener.kt +2 -1
- package/android/src/main/java/com/unistyles/UnistylesModule.kt +0 -4
- package/android/src/main/java/com/unistyles/UnistylesPackage.kt +6 -6
- package/components/native/ActivityIndicator/package.json +2 -1
- package/components/native/Animated/package.json +5 -0
- package/components/native/FlatList/package.json +2 -1
- package/components/native/Image/package.json +2 -1
- package/components/native/ImageBackground/package.json +2 -1
- package/components/native/KeyboardAvoidingView/package.json +2 -1
- package/components/native/NativeText/package.json +5 -0
- package/components/native/NativeView/package.json +5 -0
- package/components/native/Pressable/package.json +1 -1
- package/components/native/RefreshControl/package.json +2 -1
- package/components/native/ScrollView/package.json +2 -1
- package/components/native/SectionList/package.json +2 -1
- package/components/native/Switch/package.json +2 -1
- package/components/native/Text/package.json +2 -1
- package/components/native/TextInput/package.json +2 -1
- package/components/native/TouchableHighlight/package.json +2 -1
- package/components/native/TouchableOpacity/package.json +2 -1
- package/components/native/View/package.json +2 -1
- package/components/native/VirtualizedList/package.json +2 -1
- package/cxx/common/Constants.h +4 -4
- package/cxx/common/Helpers.h +1 -1
- package/cxx/core/HashGenerator.cpp +23 -0
- package/cxx/core/HashGenerator.h +13 -0
- package/cxx/core/HostUnistyle.cpp +83 -0
- package/cxx/core/HostUnistyle.h +27 -0
- package/cxx/core/RNStyle.h +18 -0
- package/cxx/core/Unistyle.h +13 -4
- package/cxx/core/UnistyleWrapper.h +92 -47
- package/cxx/core/UnistylesRegistry.cpp +40 -11
- package/cxx/core/UnistylesRegistry.h +5 -4
- package/cxx/hybridObjects/HybridNavigationBar.cpp +3 -3
- package/cxx/hybridObjects/HybridNavigationBar.h +2 -2
- package/cxx/hybridObjects/HybridShadowRegistry.cpp +39 -45
- package/cxx/hybridObjects/HybridShadowRegistry.h +0 -10
- package/cxx/hybridObjects/HybridStatusBar.cpp +3 -3
- package/cxx/hybridObjects/HybridStatusBar.h +2 -2
- package/cxx/hybridObjects/HybridStyleSheet.cpp +52 -10
- package/cxx/hybridObjects/HybridStyleSheet.h +2 -1
- package/cxx/hybridObjects/HybridUnistylesRuntime.cpp +15 -15
- package/cxx/hybridObjects/HybridUnistylesRuntime.h +2 -2
- package/cxx/parser/Parser.cpp +26 -27
- package/cxx/parser/Parser.h +2 -1
- package/ios/NativePlatform+ios.swift +21 -11
- package/ios/NativePlatform.swift +2 -2
- package/ios/UnistylesModuleOnLoad.h +4 -4
- package/ios/UnistylesModuleOnLoad.mm +5 -8
- package/lib/commonjs/components/ScopedTheme.js.map +1 -1
- package/lib/commonjs/components/index.js +0 -7
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/native/Animated.js +23 -0
- package/lib/commonjs/components/native/Animated.js.map +1 -0
- package/lib/commonjs/components/native/ImageBackground.js +47 -1
- package/lib/commonjs/components/native/ImageBackground.js.map +1 -1
- package/lib/commonjs/components/native/ImageBackground.native.js +10 -0
- package/lib/commonjs/components/native/ImageBackground.native.js.map +1 -0
- package/lib/commonjs/components/native/NativeText.js +13 -0
- package/lib/commonjs/components/native/NativeText.js.map +1 -0
- package/lib/commonjs/components/native/NativeText.native.js +18 -0
- package/lib/commonjs/components/native/NativeText.native.js.map +1 -0
- package/lib/commonjs/components/native/NativeView.js +9 -0
- package/lib/commonjs/components/native/NativeView.js.map +1 -0
- package/lib/commonjs/components/native/NativeView.native.js +20 -0
- package/lib/commonjs/components/native/NativeView.native.js.map +1 -0
- package/lib/commonjs/components/native/Pressable.js +26 -51
- package/lib/commonjs/components/native/Pressable.js.map +1 -1
- package/lib/commonjs/components/native/Pressable.native.js +25 -9
- package/lib/commonjs/components/native/Pressable.native.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.js +33 -5
- package/lib/commonjs/core/createUnistylesElement.js.map +1 -1
- package/lib/commonjs/core/createUnistylesElement.native.js +54 -0
- package/lib/commonjs/core/createUnistylesElement.native.js.map +1 -0
- package/lib/commonjs/core/createUnistylesImageBackground.js +41 -15
- package/lib/commonjs/core/createUnistylesImageBackground.js.map +1 -1
- package/lib/commonjs/core/getClassname.js +23 -0
- package/lib/commonjs/core/getClassname.js.map +1 -0
- package/lib/commonjs/core/getClassname.native.js +9 -0
- package/lib/commonjs/core/getClassname.native.js.map +1 -0
- package/lib/commonjs/core/index.js +14 -7
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/core/passForwardRef.js +2 -2
- package/lib/commonjs/core/passForwardRef.js.map +1 -1
- package/lib/commonjs/core/useProxifiedUnistyles/index.js +13 -0
- package/lib/commonjs/core/useProxifiedUnistyles/index.js.map +1 -0
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js +22 -0
- package/lib/commonjs/core/useProxifiedUnistyles/listener.js.map +1 -0
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js +26 -0
- package/lib/commonjs/core/useProxifiedUnistyles/listener.native.js.map +1 -0
- package/lib/commonjs/core/useProxifiedUnistyles/types.js +6 -0
- package/lib/commonjs/core/useProxifiedUnistyles/types.js.map +1 -0
- package/lib/commonjs/core/{withUnistyles/useDependencies.js → useProxifiedUnistyles/useProxifiedUnistyles.js} +22 -22
- package/lib/commonjs/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -0
- package/lib/commonjs/core/useUnistyles.js +19 -0
- package/lib/commonjs/core/useUnistyles.js.map +1 -0
- package/lib/commonjs/core/warn.js +16 -0
- package/lib/commonjs/core/warn.js.map +1 -0
- package/lib/commonjs/core/withUnistyles/withUnistyles.js +19 -55
- package/lib/commonjs/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js +32 -65
- package/lib/commonjs/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/commonjs/index.js +23 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/server/getServerUnistyles.js +40 -0
- package/lib/commonjs/server/getServerUnistyles.js.map +1 -0
- package/lib/commonjs/server/hydrateServerUnistyles.js +17 -0
- package/lib/commonjs/server/hydrateServerUnistyles.js.map +1 -0
- package/lib/commonjs/server/index.js +34 -0
- package/lib/commonjs/server/index.js.map +1 -0
- package/lib/commonjs/server/resetServerUnistyles.js +16 -0
- package/lib/commonjs/server/resetServerUnistyles.js.map +1 -0
- package/lib/commonjs/server/types.js +8 -0
- package/lib/commonjs/server/types.js.map +1 -0
- package/lib/commonjs/server/useServerUnistyles.js +27 -0
- package/lib/commonjs/server/useServerUnistyles.js.map +1 -0
- package/lib/commonjs/specs/ShadowRegistry/index.js +6 -3
- package/lib/commonjs/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/commonjs/specs/StyleSheet/index.js.map +1 -1
- package/lib/commonjs/utils.js +19 -2
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/convert/object/filter.js +2 -2
- package/lib/commonjs/web/convert/object/filter.js.map +1 -1
- package/lib/commonjs/web/convert/style.js +4 -4
- package/lib/commonjs/web/convert/style.js.map +1 -1
- package/lib/commonjs/web/create.js +20 -15
- package/lib/commonjs/web/create.js.map +1 -1
- package/lib/commonjs/web/css/core.js +55 -0
- package/lib/commonjs/web/css/core.js.map +1 -0
- package/lib/commonjs/web/css/index.js +17 -0
- package/lib/commonjs/web/css/index.js.map +1 -0
- package/lib/commonjs/web/css/state.js +155 -0
- package/lib/commonjs/web/css/state.js.map +1 -0
- package/lib/commonjs/web/css/utils.js +47 -0
- package/lib/commonjs/web/css/utils.js.map +1 -0
- package/lib/commonjs/web/index.js +14 -18
- package/lib/commonjs/web/index.js.map +1 -1
- package/lib/commonjs/web/listener.js +9 -7
- package/lib/commonjs/web/listener.js.map +1 -1
- package/lib/commonjs/web/registry.js +44 -123
- package/lib/commonjs/web/registry.js.map +1 -1
- package/lib/commonjs/web/runtime.js +28 -21
- package/lib/commonjs/web/runtime.js.map +1 -1
- package/lib/commonjs/web/services.js +28 -0
- package/lib/commonjs/web/services.js.map +1 -0
- package/lib/commonjs/web/shadowRegistry.js +46 -93
- package/lib/commonjs/web/shadowRegistry.js.map +1 -1
- package/lib/commonjs/web/state.js +39 -9
- package/lib/commonjs/web/state.js.map +1 -1
- package/lib/commonjs/web/types.js +6 -0
- package/lib/commonjs/web/types.js.map +1 -0
- package/lib/commonjs/web/utils/common.js +29 -9
- package/lib/commonjs/web/utils/common.js.map +1 -1
- package/lib/commonjs/web/utils/unistyle.js +32 -19
- package/lib/commonjs/web/utils/unistyle.js.map +1 -1
- package/lib/commonjs/web/variants.js +25 -27
- package/lib/commonjs/web/variants.js.map +1 -1
- package/lib/module/components/ScopedTheme.js.map +1 -1
- package/lib/module/components/index.js +0 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/native/Animated.js +19 -0
- package/lib/module/components/native/Animated.js.map +1 -0
- package/lib/module/components/native/ImageBackground.js +47 -2
- package/lib/module/components/native/ImageBackground.js.map +1 -1
- package/lib/module/components/native/ImageBackground.native.js +6 -0
- package/lib/module/components/native/ImageBackground.native.js.map +1 -0
- package/lib/module/components/native/NativeText.js +4 -0
- package/lib/module/components/native/NativeText.js.map +1 -0
- package/lib/module/components/native/NativeText.native.js +15 -0
- package/lib/module/components/native/NativeText.native.js.map +1 -0
- package/lib/module/components/native/NativeView.js +5 -0
- package/lib/module/components/native/NativeView.js.map +1 -0
- package/lib/module/components/native/NativeView.native.js +17 -0
- package/lib/module/components/native/NativeView.native.js.map +1 -0
- package/lib/module/components/native/Pressable.js +27 -52
- package/lib/module/components/native/Pressable.js.map +1 -1
- package/lib/module/components/native/Pressable.native.js +26 -10
- package/lib/module/components/native/Pressable.native.js.map +1 -1
- package/lib/module/core/createUnistylesElement.js +33 -5
- package/lib/module/core/createUnistylesElement.js.map +1 -1
- package/lib/module/core/createUnistylesElement.native.js +47 -0
- package/lib/module/core/createUnistylesElement.native.js.map +1 -0
- package/lib/module/core/createUnistylesImageBackground.js +39 -14
- package/lib/module/core/createUnistylesImageBackground.js.map +1 -1
- package/lib/module/core/getClassname.js +18 -0
- package/lib/module/core/getClassname.js.map +1 -0
- package/lib/module/core/getClassname.native.js +4 -0
- package/lib/module/core/getClassname.native.js.map +1 -0
- package/lib/module/core/index.js +2 -1
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/core/passForwardRef.js +2 -2
- package/lib/module/core/passForwardRef.js.map +1 -1
- package/lib/module/core/useProxifiedUnistyles/index.js +4 -0
- package/lib/module/core/useProxifiedUnistyles/index.js.map +1 -0
- package/lib/module/core/useProxifiedUnistyles/listener.js +17 -0
- package/lib/module/core/useProxifiedUnistyles/listener.js.map +1 -0
- package/lib/module/core/useProxifiedUnistyles/listener.native.js +21 -0
- package/lib/module/core/useProxifiedUnistyles/listener.native.js.map +1 -0
- package/lib/module/core/useProxifiedUnistyles/types.js +4 -0
- package/lib/module/core/useProxifiedUnistyles/types.js.map +1 -0
- package/lib/module/core/{withUnistyles/useDependencies.js → useProxifiedUnistyles/useProxifiedUnistyles.js} +19 -19
- package/lib/module/core/useProxifiedUnistyles/useProxifiedUnistyles.js.map +1 -0
- package/lib/module/core/useUnistyles.js +14 -0
- package/lib/module/core/useUnistyles.js.map +1 -0
- package/lib/module/core/warn.js +11 -0
- package/lib/module/core/warn.js.map +1 -0
- package/lib/module/core/withUnistyles/withUnistyles.js +19 -55
- package/lib/module/core/withUnistyles/withUnistyles.js.map +1 -1
- package/lib/module/core/withUnistyles/withUnistyles.native.js +33 -66
- package/lib/module/core/withUnistyles/withUnistyles.native.js.map +1 -1
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/server/getServerUnistyles.js +34 -0
- package/lib/module/server/getServerUnistyles.js.map +1 -0
- package/lib/module/server/hydrateServerUnistyles.js +12 -0
- package/lib/module/server/hydrateServerUnistyles.js.map +1 -0
- package/lib/module/server/index.js +7 -0
- package/lib/module/server/index.js.map +1 -0
- package/lib/module/server/resetServerUnistyles.js +11 -0
- package/lib/module/server/resetServerUnistyles.js.map +1 -0
- package/lib/module/server/types.js +4 -0
- package/lib/module/server/types.js.map +1 -0
- package/lib/module/server/useServerUnistyles.js +22 -0
- package/lib/module/server/useServerUnistyles.js.map +1 -0
- package/lib/module/specs/ShadowRegistry/index.js +6 -3
- package/lib/module/specs/ShadowRegistry/index.js.map +1 -1
- package/lib/module/specs/StyleSheet/index.js.map +1 -1
- package/lib/module/utils.js +16 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/convert/object/filter.js +2 -2
- package/lib/module/web/convert/object/filter.js.map +1 -1
- package/lib/module/web/convert/style.js +4 -4
- package/lib/module/web/convert/style.js.map +1 -1
- package/lib/module/web/create.js +20 -15
- package/lib/module/web/create.js.map +1 -1
- package/lib/module/web/css/core.js +50 -0
- package/lib/module/web/css/core.js.map +1 -0
- package/lib/module/web/css/index.js +4 -0
- package/lib/module/web/css/index.js.map +1 -0
- package/lib/module/web/css/state.js +150 -0
- package/lib/module/web/css/state.js.map +1 -0
- package/lib/module/web/css/utils.js +41 -0
- package/lib/module/web/css/utils.js.map +1 -0
- package/lib/module/web/index.js +10 -5
- package/lib/module/web/index.js.map +1 -1
- package/lib/module/web/listener.js +8 -7
- package/lib/module/web/listener.js.map +1 -1
- package/lib/module/web/registry.js +44 -124
- package/lib/module/web/registry.js.map +1 -1
- package/lib/module/web/runtime.js +27 -21
- package/lib/module/web/runtime.js.map +1 -1
- package/lib/module/web/services.js +23 -0
- package/lib/module/web/services.js.map +1 -0
- package/lib/module/web/shadowRegistry.js +46 -94
- package/lib/module/web/shadowRegistry.js.map +1 -1
- package/lib/module/web/state.js +39 -10
- package/lib/module/web/state.js.map +1 -1
- package/lib/module/web/types.js +4 -0
- package/lib/module/web/types.js.map +1 -0
- package/lib/module/web/utils/common.js +26 -7
- package/lib/module/web/utils/common.js.map +1 -1
- package/lib/module/web/utils/unistyle.js +31 -17
- package/lib/module/web/utils/unistyle.js.map +1 -1
- package/lib/module/web/variants.js +25 -27
- package/lib/module/web/variants.js.map +1 -1
- package/lib/typescript/src/components/index.d.ts +0 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ActivityIndicator.d.ts +1 -1
- package/lib/typescript/src/components/native/ActivityIndicator.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Animated.d.ts +39 -0
- package/lib/typescript/src/components/native/Animated.d.ts.map +1 -0
- package/lib/typescript/src/components/native/FlatList.d.ts +1 -1
- package/lib/typescript/src/components/native/FlatList.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Image.d.ts +1 -1
- package/lib/typescript/src/components/native/Image.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.d.ts +1 -2
- package/lib/typescript/src/components/native/ImageBackground.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ImageBackground.native.d.ts +2 -0
- package/lib/typescript/src/components/native/ImageBackground.native.d.ts.map +1 -0
- package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts +1 -1
- package/lib/typescript/src/components/native/KeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/src/components/native/NativeText.d.ts +2 -0
- package/lib/typescript/src/components/native/NativeText.d.ts.map +1 -0
- package/lib/typescript/src/components/native/NativeText.native.d.ts +2 -0
- package/lib/typescript/src/components/native/NativeText.native.d.ts.map +1 -0
- package/lib/typescript/src/components/native/NativeView.d.ts +3 -0
- package/lib/typescript/src/components/native/NativeView.d.ts.map +1 -0
- package/lib/typescript/src/components/native/NativeView.native.d.ts +3 -0
- package/lib/typescript/src/components/native/NativeView.native.d.ts.map +1 -0
- package/lib/typescript/src/components/native/Pressable.d.ts +3 -2
- package/lib/typescript/src/components/native/Pressable.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Pressable.native.d.ts.map +1 -1
- package/lib/typescript/src/components/native/RefreshControl.d.ts +1 -1
- package/lib/typescript/src/components/native/RefreshControl.d.ts.map +1 -1
- package/lib/typescript/src/components/native/ScrollView.d.ts +1 -1
- package/lib/typescript/src/components/native/ScrollView.d.ts.map +1 -1
- package/lib/typescript/src/components/native/SectionList.d.ts +1 -1
- package/lib/typescript/src/components/native/SectionList.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Switch.d.ts +1 -1
- package/lib/typescript/src/components/native/Switch.d.ts.map +1 -1
- package/lib/typescript/src/components/native/Text.d.ts +1 -1
- package/lib/typescript/src/components/native/Text.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TextInput.d.ts +1 -1
- package/lib/typescript/src/components/native/TextInput.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TouchableHighlight.d.ts +1 -1
- package/lib/typescript/src/components/native/TouchableHighlight.d.ts.map +1 -1
- package/lib/typescript/src/components/native/TouchableOpacity.d.ts +1 -1
- package/lib/typescript/src/components/native/TouchableOpacity.d.ts.map +1 -1
- package/lib/typescript/src/components/native/View.d.ts +1 -1
- package/lib/typescript/src/components/native/View.d.ts.map +1 -1
- package/lib/typescript/src/components/native/VirtualizedList.d.ts +1 -1
- package/lib/typescript/src/components/native/VirtualizedList.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.d.ts +1 -2
- package/lib/typescript/src/core/createUnistylesElement.d.ts.map +1 -1
- package/lib/typescript/src/core/createUnistylesElement.native.d.ts +2 -0
- package/lib/typescript/src/core/createUnistylesElement.native.d.ts.map +1 -0
- package/lib/typescript/src/core/createUnistylesImageBackground.d.ts +2 -3
- package/lib/typescript/src/core/createUnistylesImageBackground.d.ts.map +1 -1
- package/lib/typescript/src/core/getClassname.d.ts +7 -0
- package/lib/typescript/src/core/getClassname.d.ts.map +1 -0
- package/lib/typescript/src/core/getClassname.native.d.ts +2 -0
- package/lib/typescript/src/core/getClassname.native.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +2 -1
- package/lib/typescript/src/core/index.d.ts.map +1 -1
- package/lib/typescript/src/core/passForwardRef.d.ts.map +1 -1
- package/lib/typescript/src/core/useProxifiedUnistyles/index.d.ts +2 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/index.d.ts.map +1 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.d.ts +3 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.d.ts.map +1 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts +3 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/listener.native.d.ts.map +1 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts +7 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/types.d.ts.map +1 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts +8 -0
- package/lib/typescript/src/core/useProxifiedUnistyles/useProxifiedUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/core/useUnistyles.d.ts +6 -0
- package/lib/typescript/src/core/useUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/core/warn.d.ts +3 -0
- package/lib/typescript/src/core/warn.d.ts.map +1 -0
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts +0 -3
- package/lib/typescript/src/core/withUnistyles/withUnistyles.d.ts.map +1 -1
- package/lib/typescript/src/core/withUnistyles/withUnistyles.native.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/server/getServerUnistyles.d.ts +4 -0
- package/lib/typescript/src/server/getServerUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/server/hydrateServerUnistyles.d.ts +8 -0
- package/lib/typescript/src/server/hydrateServerUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/server/index.d.ts +5 -0
- package/lib/typescript/src/server/index.d.ts.map +1 -0
- package/lib/typescript/src/server/resetServerUnistyles.d.ts +2 -0
- package/lib/typescript/src/server/resetServerUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/server/types.d.ts +5 -0
- package/lib/typescript/src/server/types.d.ts.map +1 -0
- package/lib/typescript/src/server/useServerUnistyles.d.ts +4 -0
- package/lib/typescript/src/server/useServerUnistyles.d.ts.map +1 -0
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts +0 -3
- package/lib/typescript/src/specs/ShadowRegistry/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts +5 -1
- package/lib/typescript/src/specs/StyleSheet/index.d.ts.map +1 -1
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -1
- package/lib/typescript/src/web/convert/style.d.ts.map +1 -1
- package/lib/typescript/src/web/create.d.ts.map +1 -1
- package/lib/typescript/src/web/css/core.d.ts +3 -0
- package/lib/typescript/src/web/css/core.d.ts.map +1 -0
- package/lib/typescript/src/web/css/index.d.ts +2 -0
- package/lib/typescript/src/web/css/index.d.ts.map +1 -0
- package/lib/typescript/src/web/css/state.d.ts +30 -0
- package/lib/typescript/src/web/css/state.d.ts.map +1 -0
- package/lib/typescript/src/web/css/utils.d.ts +4 -0
- package/lib/typescript/src/web/css/utils.d.ts.map +1 -0
- package/lib/typescript/src/web/index.d.ts +7 -1
- package/lib/typescript/src/web/index.d.ts.map +1 -1
- package/lib/typescript/src/web/listener.d.ts +4 -3
- package/lib/typescript/src/web/listener.d.ts.map +1 -1
- package/lib/typescript/src/web/registry.d.ts +11 -8
- package/lib/typescript/src/web/registry.d.ts.map +1 -1
- package/lib/typescript/src/web/runtime.d.ts +6 -4
- package/lib/typescript/src/web/runtime.d.ts.map +1 -1
- package/lib/typescript/src/web/services.d.ts +15 -0
- package/lib/typescript/src/web/services.d.ts.map +1 -0
- package/lib/typescript/src/web/shadowRegistry.d.ts +10 -13
- package/lib/typescript/src/web/shadowRegistry.d.ts.map +1 -1
- package/lib/typescript/src/web/state.d.ts +7 -3
- package/lib/typescript/src/web/state.d.ts.map +1 -1
- package/lib/typescript/src/web/types.d.ts +13 -0
- package/lib/typescript/src/web/types.d.ts.map +1 -0
- package/lib/typescript/src/web/utils/common.d.ts +2 -1
- package/lib/typescript/src/web/utils/common.d.ts.map +1 -1
- package/lib/typescript/src/web/utils/unistyle.d.ts +5 -4
- package/lib/typescript/src/web/utils/unistyle.d.ts.map +1 -1
- package/lib/typescript/src/web/variants.d.ts +2 -2
- package/lib/typescript/src/web/variants.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JColorScheme.hpp +2 -1
- package/nitrogen/generated/android/c++/JDimensions.hpp +2 -1
- package/nitrogen/generated/android/c++/JFunc_void_UnistylesNativeMiniRuntime.hpp +36 -10
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.hpp +53 -19
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp +5 -5
- package/nitrogen/generated/android/c++/JHybridNativePlatformSpec.hpp +1 -1
- package/nitrogen/generated/android/c++/JInsets.hpp +2 -1
- package/nitrogen/generated/android/c++/JOrientation.hpp +2 -1
- package/nitrogen/generated/android/c++/JUnistyleDependency.hpp +2 -1
- package/nitrogen/generated/android/c++/JUnistylesNativeMiniRuntime.hpp +2 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/ColorScheme.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Dimensions.kt +10 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_UnistylesNativeMiniRuntime.kt +43 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.kt +43 -14
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/HybridNativePlatformSpec.kt +10 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Insets.kt +13 -8
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/Orientation.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistyleDependency.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt +19 -14
- package/nitrogen/generated/android/unistyles+autolinking.cmake +4 -1
- package/nitrogen/generated/android/unistyles+autolinking.gradle +1 -1
- package/nitrogen/generated/android/unistylesOnLoad.cpp +7 -3
- package/nitrogen/generated/android/unistylesOnLoad.hpp +1 -1
- package/nitrogen/generated/ios/Unistyles+autolinking.rb +1 -1
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.cpp +21 -6
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Bridge.hpp +105 -27
- package/nitrogen/generated/ios/Unistyles-Swift-Cxx-Umbrella.hpp +5 -3
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.cpp +1 -1
- package/nitrogen/generated/ios/c++/HybridNativePlatformSpecSwift.hpp +92 -33
- package/nitrogen/generated/ios/swift/ColorScheme.swift +1 -1
- package/nitrogen/generated/ios/swift/Dimensions.swift +1 -1
- package/nitrogen/generated/ios/swift/Func_void_UnistylesNativeMiniRuntime.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec.swift +36 -23
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpec_cxx.swift +327 -0
- package/nitrogen/generated/ios/swift/Insets.swift +1 -1
- package/nitrogen/generated/ios/swift/Orientation.swift +1 -1
- package/nitrogen/generated/ios/swift/UnistyleDependency.swift +1 -1
- package/nitrogen/generated/ios/swift/UnistylesNativeMiniRuntime.swift +1 -1
- package/nitrogen/generated/shared/c++/ColorScheme.hpp +1 -1
- package/nitrogen/generated/shared/c++/Dimensions.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridNativePlatformSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesNavigationBarSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesRuntimeSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesShadowRegistrySpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStatusBarSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.cpp +1 -1
- package/nitrogen/generated/shared/c++/HybridUnistylesStyleSheetSpec.hpp +1 -1
- package/nitrogen/generated/shared/c++/Insets.hpp +1 -1
- package/nitrogen/generated/shared/c++/Orientation.hpp +1 -1
- package/nitrogen/generated/shared/c++/UnistyleDependency.hpp +2 -2
- package/nitrogen/generated/shared/c++/UnistylesCxxMiniRuntime.hpp +1 -1
- package/nitrogen/generated/shared/c++/UnistylesNativeMiniRuntime.hpp +1 -1
- package/package.json +23 -14
- package/plugin/consts.js +63 -0
- package/plugin/exotic.js +54 -0
- package/plugin/import.js +1 -21
- package/plugin/index.d.ts +89 -0
- package/plugin/index.js +58 -96
- package/plugin/stylesheet.js +28 -1
- package/plugin/variants.js +49 -75
- package/src/components/ScopedTheme.tsx +1 -1
- package/src/components/index.ts +0 -1
- package/src/components/native/Animated.tsx +17 -0
- package/src/components/native/ImageBackground.native.tsx +4 -0
- package/src/components/native/ImageBackground.tsx +57 -2
- package/src/components/native/NativeText.native.tsx +12 -0
- package/src/components/native/NativeText.tsx +1 -0
- package/src/components/native/NativeView.native.tsx +13 -0
- package/src/components/native/NativeView.tsx +3 -0
- package/src/components/native/Pressable.native.tsx +32 -15
- package/src/components/native/Pressable.tsx +35 -69
- package/src/core/createUnistylesElement.native.tsx +51 -0
- package/src/core/createUnistylesElement.tsx +47 -8
- package/src/core/createUnistylesImageBackground.tsx +44 -18
- package/src/core/getClassname.native.ts +1 -0
- package/src/core/getClassname.ts +14 -0
- package/src/core/index.ts +2 -1
- package/src/core/passForwardRef.ts +1 -2
- package/src/core/useProxifiedUnistyles/index.ts +1 -0
- package/src/core/useProxifiedUnistyles/listener.native.ts +18 -0
- package/src/core/useProxifiedUnistyles/listener.ts +13 -0
- package/src/core/useProxifiedUnistyles/types.ts +7 -0
- package/src/core/{withUnistyles/useDependencies.ts → useProxifiedUnistyles/useProxifiedUnistyles.ts} +19 -26
- package/src/core/useUnistyles.ts +11 -0
- package/src/core/warn.ts +13 -0
- package/src/core/withUnistyles/withUnistyles.native.tsx +39 -68
- package/src/core/withUnistyles/withUnistyles.tsx +19 -56
- package/src/index.ts +3 -2
- package/src/server/getServerUnistyles.tsx +21 -0
- package/src/server/hydrateServerUnistyles.ts +17 -0
- package/src/server/index.ts +5 -0
- package/src/server/resetServerUnistyles.ts +9 -0
- package/src/server/types.ts +4 -0
- package/src/server/useServerUnistyles.tsx +22 -0
- package/src/specs/ShadowRegistry/index.ts +12 -9
- package/src/specs/StyleSheet/index.ts +6 -1
- package/src/utils.ts +32 -11
- package/src/web/convert/object/filter.ts +2 -2
- package/src/web/convert/style.ts +8 -7
- package/src/web/create.ts +23 -18
- package/src/web/css/core.ts +58 -0
- package/src/web/css/index.ts +1 -0
- package/src/web/css/state.ts +191 -0
- package/src/web/css/utils.ts +54 -0
- package/src/web/index.ts +18 -5
- package/src/web/listener.ts +8 -8
- package/src/web/registry.ts +47 -152
- package/src/web/runtime.ts +32 -22
- package/src/web/services.ts +28 -0
- package/src/web/shadowRegistry.ts +46 -104
- package/src/web/state.ts +46 -11
- package/src/web/types.ts +13 -0
- package/src/web/utils/common.ts +32 -8
- package/src/web/utils/unistyle.ts +46 -25
- package/src/web/variants.ts +27 -27
- package/cxx/core/HostStyle.cpp +0 -73
- package/cxx/core/HostStyle.h +0 -34
- package/lib/commonjs/components/Variants.js +0 -36
- package/lib/commonjs/components/Variants.js.map +0 -1
- package/lib/commonjs/core/createUnistylesComponent.js +0 -16
- package/lib/commonjs/core/createUnistylesComponent.js.map +0 -1
- package/lib/commonjs/core/withUnistyles/useDependencies.js.map +0 -1
- package/lib/module/components/Variants.js +0 -29
- package/lib/module/components/Variants.js.map +0 -1
- package/lib/module/core/createUnistylesComponent.js +0 -11
- package/lib/module/core/createUnistylesComponent.js.map +0 -1
- package/lib/module/core/withUnistyles/useDependencies.js.map +0 -1
- package/lib/typescript/src/components/Variants.d.ts +0 -7
- package/lib/typescript/src/components/Variants.d.ts.map +0 -1
- package/lib/typescript/src/core/createUnistylesComponent.d.ts +0 -14
- package/lib/typescript/src/core/createUnistylesComponent.d.ts.map +0 -1
- package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts +0 -13
- package/lib/typescript/src/core/withUnistyles/useDependencies.d.ts.map +0 -1
- package/nitrogen/generated/android/unistylesOnLoad.kt +0 -1
- package/nitrogen/generated/ios/swift/HybridNativePlatformSpecCxx.swift +0 -314
- package/plugin/style.js +0 -168
- package/src/components/Variants.tsx +0 -30
- package/src/core/createUnistylesComponent.tsx +0 -14
package/nitrogen/generated/android/kotlin/com/margelo/nitro/unistyles/UnistylesNativeMiniRuntime.kt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
/// UnistylesNativeMiniRuntime.kt
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
package com.margelo.nitro.unistyles
|
@@ -16,16 +16,21 @@ import com.margelo.nitro.core.*
|
|
16
16
|
*/
|
17
17
|
@DoNotStrip
|
18
18
|
@Keep
|
19
|
-
data class UnistylesNativeMiniRuntime
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
data class UnistylesNativeMiniRuntime
|
20
|
+
@DoNotStrip
|
21
|
+
@Keep
|
22
|
+
constructor(
|
23
|
+
val colorScheme: ColorScheme,
|
24
|
+
val screen: Dimensions,
|
25
|
+
val contentSizeCategory: String,
|
26
|
+
val insets: Insets,
|
27
|
+
val pixelRatio: Double,
|
28
|
+
val fontScale: Double,
|
29
|
+
val rtl: Boolean,
|
30
|
+
val statusBar: Dimensions,
|
31
|
+
val navigationBar: Dimensions,
|
32
|
+
val isPortrait: Boolean,
|
33
|
+
val isLandscape: Boolean
|
34
|
+
) {
|
35
|
+
/* main constructor */
|
36
|
+
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# unistyles+autolinking.cmake
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
# https://github.com/mrousavy/nitro
|
5
|
-
# Copyright ©
|
5
|
+
# Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
#
|
7
7
|
|
8
8
|
# This is a CMake file that adds all files generated by Nitrogen
|
@@ -37,6 +37,9 @@ target_sources(
|
|
37
37
|
../nitrogen/generated/android/c++/JHybridNativePlatformSpec.cpp
|
38
38
|
)
|
39
39
|
|
40
|
+
# Define a flag to check if we are building properly
|
41
|
+
add_definitions(-DBUILDING_UNISTYLES_WITH_GENERATED_CMAKE_PROJECT)
|
42
|
+
|
40
43
|
# Add all libraries required by the generated specs
|
41
44
|
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
42
45
|
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// unistyles+autolinking.gradle
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
/// This is a Gradle file that adds all files generated by Nitrogen
|
@@ -2,9 +2,13 @@
|
|
2
2
|
/// unistylesOnLoad.cpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
|
+
#ifndef BUILDING_UNISTYLES_WITH_GENERATED_CMAKE_PROJECT
|
9
|
+
#error unistylesOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
10
|
+
#endif
|
11
|
+
|
8
12
|
#include "unistylesOnLoad.hpp"
|
9
13
|
|
10
14
|
#include <jni.h>
|
@@ -25,8 +29,8 @@ int initialize(JavaVM* vm) {
|
|
25
29
|
return facebook::jni::initialize(vm, [] {
|
26
30
|
// Register native JNI methods
|
27
31
|
margelo::nitro::unistyles::JHybridNativePlatformSpec::registerNatives();
|
28
|
-
margelo::nitro::unistyles::
|
29
|
-
margelo::nitro::unistyles::
|
32
|
+
margelo::nitro::unistyles::JFunc_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_cxx::registerNatives();
|
33
|
+
margelo::nitro::unistyles::JFunc_void_UnistylesNativeMiniRuntime_cxx::registerNatives();
|
30
34
|
|
31
35
|
// Register Nitro Hybrid Objects
|
32
36
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Unistyles+autolinking.rb
|
3
3
|
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
# https://github.com/mrousavy/nitro
|
5
|
-
# Copyright ©
|
5
|
+
# Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
#
|
7
7
|
|
8
8
|
# This is a Ruby script that adds all files generated by Nitrogen
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// Unistyles-Swift-Cxx-Bridge.cpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
#include "Unistyles-Swift-Cxx-Bridge.hpp"
|
@@ -10,14 +10,29 @@
|
|
10
10
|
// Include C++ implementation defined types
|
11
11
|
#include "HybridNativePlatformSpecSwift.hpp"
|
12
12
|
#include "Unistyles-Swift-Cxx-Umbrella.hpp"
|
13
|
-
#include <NitroModules/HybridContext.hpp>
|
14
13
|
|
15
14
|
namespace margelo::nitro::unistyles::bridge::swift {
|
16
15
|
|
16
|
+
// pragma MARK: std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>
|
17
|
+
Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) {
|
18
|
+
auto swiftClosure = Unistyles::Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime::fromUnsafe(swiftClosureWrapper);
|
19
|
+
return [swiftClosure = std::move(swiftClosure)](const std::vector<UnistyleDependency>& dependencies, const UnistylesNativeMiniRuntime& miniRuntime) mutable -> void {
|
20
|
+
swiftClosure.call(dependencies, miniRuntime);
|
21
|
+
};
|
22
|
+
}
|
23
|
+
|
24
|
+
// pragma MARK: std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>
|
25
|
+
Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper) {
|
26
|
+
auto swiftClosure = Unistyles::Func_void_UnistylesNativeMiniRuntime::fromUnsafe(swiftClosureWrapper);
|
27
|
+
return [swiftClosure = std::move(swiftClosure)](const UnistylesNativeMiniRuntime& miniRuntime) mutable -> void {
|
28
|
+
swiftClosure.call(miniRuntime);
|
29
|
+
};
|
30
|
+
}
|
31
|
+
|
17
32
|
// pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
|
18
33
|
std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec> create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer) {
|
19
|
-
Unistyles::
|
20
|
-
return
|
34
|
+
Unistyles::HybridNativePlatformSpec_cxx swiftPart = Unistyles::HybridNativePlatformSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
35
|
+
return std::make_shared<margelo::nitro::unistyles::HybridNativePlatformSpecSwift>(swiftPart);
|
21
36
|
}
|
22
37
|
void* _Nonnull get_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ cppType) {
|
23
38
|
std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::unistyles::HybridNativePlatformSpecSwift>(cppType);
|
@@ -26,8 +41,8 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
26
41
|
throw std::runtime_error("Class \"HybridNativePlatformSpec\" is not implemented in Swift!");
|
27
42
|
}
|
28
43
|
#endif
|
29
|
-
Unistyles::
|
30
|
-
return
|
44
|
+
Unistyles::HybridNativePlatformSpec_cxx swiftPart = swiftWrapper->getSwiftPart();
|
45
|
+
return swiftPart.toUnsafe();
|
31
46
|
}
|
32
47
|
|
33
48
|
} // namespace margelo::nitro::unistyles::bridge::swift
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// Unistyles-Swift-Cxx-Bridge.hpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
#pragma once
|
@@ -16,22 +16,27 @@ namespace margelo::nitro::unistyles { struct Dimensions; }
|
|
16
16
|
namespace margelo::nitro::unistyles { class HybridNativePlatformSpec; }
|
17
17
|
// Forward declaration of `Insets` to properly resolve imports.
|
18
18
|
namespace margelo::nitro::unistyles { struct Insets; }
|
19
|
+
// Forward declaration of `Orientation` to properly resolve imports.
|
20
|
+
namespace margelo::nitro::unistyles { enum class Orientation; }
|
19
21
|
// Forward declaration of `UnistyleDependency` to properly resolve imports.
|
20
22
|
namespace margelo::nitro::unistyles { enum class UnistyleDependency; }
|
21
23
|
// Forward declaration of `UnistylesNativeMiniRuntime` to properly resolve imports.
|
22
24
|
namespace margelo::nitro::unistyles { struct UnistylesNativeMiniRuntime; }
|
23
25
|
|
24
26
|
// Forward declarations of Swift defined types
|
25
|
-
// Forward declaration of `
|
26
|
-
namespace Unistyles { class
|
27
|
+
// Forward declaration of `HybridNativePlatformSpec_cxx` to properly resolve imports.
|
28
|
+
namespace Unistyles { class HybridNativePlatformSpec_cxx; }
|
27
29
|
|
28
30
|
// Include C++ defined types
|
29
31
|
#include "ColorScheme.hpp"
|
30
32
|
#include "Dimensions.hpp"
|
31
33
|
#include "HybridNativePlatformSpec.hpp"
|
32
34
|
#include "Insets.hpp"
|
35
|
+
#include "Orientation.hpp"
|
33
36
|
#include "UnistyleDependency.hpp"
|
34
37
|
#include "UnistylesNativeMiniRuntime.hpp"
|
38
|
+
#include <NitroModules/Result.hpp>
|
39
|
+
#include <exception>
|
35
40
|
#include <functional>
|
36
41
|
#include <memory>
|
37
42
|
#include <string>
|
@@ -64,22 +69,16 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
64
69
|
*/
|
65
70
|
class Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper final {
|
66
71
|
public:
|
67
|
-
explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(
|
68
|
-
explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::move(func)) {}
|
72
|
+
explicit Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::make_shared<std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>>(std::move(func))) {}
|
69
73
|
inline void call(std::vector<UnistyleDependency> dependencies, UnistylesNativeMiniRuntime miniRuntime) const {
|
70
|
-
_function(dependencies, miniRuntime);
|
74
|
+
_function->operator()(dependencies, miniRuntime);
|
71
75
|
}
|
72
76
|
private:
|
73
|
-
std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)
|
77
|
+
std::shared_ptr<std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>> _function;
|
74
78
|
};
|
75
|
-
|
76
|
-
|
77
|
-
return
|
78
|
-
call(sharedClosureHolder.get(), dependencies, miniRuntime);
|
79
|
-
});
|
80
|
-
}
|
81
|
-
inline std::shared_ptr<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper> share_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(const Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime& value) {
|
82
|
-
return std::make_shared<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper>(value);
|
79
|
+
Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime create_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper);
|
80
|
+
inline Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime value) {
|
81
|
+
return Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime_Wrapper(std::move(value));
|
83
82
|
}
|
84
83
|
|
85
84
|
// pragma MARK: std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>
|
@@ -92,22 +91,16 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
92
91
|
*/
|
93
92
|
class Func_void_UnistylesNativeMiniRuntime_Wrapper final {
|
94
93
|
public:
|
95
|
-
explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(
|
96
|
-
explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::move(func)) {}
|
94
|
+
explicit Func_void_UnistylesNativeMiniRuntime_Wrapper(std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>&& func): _function(std::make_shared<std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>>(std::move(func))) {}
|
97
95
|
inline void call(UnistylesNativeMiniRuntime miniRuntime) const {
|
98
|
-
_function(miniRuntime);
|
96
|
+
_function->operator()(miniRuntime);
|
99
97
|
}
|
100
98
|
private:
|
101
|
-
std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)
|
99
|
+
std::shared_ptr<std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>> _function;
|
102
100
|
};
|
103
|
-
|
104
|
-
|
105
|
-
return
|
106
|
-
call(sharedClosureHolder.get(), miniRuntime);
|
107
|
-
});
|
108
|
-
}
|
109
|
-
inline std::shared_ptr<Func_void_UnistylesNativeMiniRuntime_Wrapper> share_Func_void_UnistylesNativeMiniRuntime(const Func_void_UnistylesNativeMiniRuntime& value) {
|
110
|
-
return std::make_shared<Func_void_UnistylesNativeMiniRuntime_Wrapper>(value);
|
101
|
+
Func_void_UnistylesNativeMiniRuntime create_Func_void_UnistylesNativeMiniRuntime(void* _Nonnull swiftClosureWrapper);
|
102
|
+
inline Func_void_UnistylesNativeMiniRuntime_Wrapper wrap_Func_void_UnistylesNativeMiniRuntime(Func_void_UnistylesNativeMiniRuntime value) {
|
103
|
+
return Func_void_UnistylesNativeMiniRuntime_Wrapper(std::move(value));
|
111
104
|
}
|
112
105
|
|
113
106
|
// pragma MARK: std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
|
@@ -117,5 +110,90 @@ namespace margelo::nitro::unistyles::bridge::swift {
|
|
117
110
|
using std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ = std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>;
|
118
111
|
std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec> create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(void* _Nonnull swiftUnsafePointer);
|
119
112
|
void* _Nonnull get_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ cppType);
|
113
|
+
|
114
|
+
// pragma MARK: std::weak_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>
|
115
|
+
using std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ = std::weak_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>;
|
116
|
+
inline std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ weakify_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(const std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>& strong) { return strong; }
|
117
|
+
|
118
|
+
// pragma MARK: Result<Insets>
|
119
|
+
using Result_Insets_ = Result<Insets>;
|
120
|
+
inline Result_Insets_ create_Result_Insets_(const Insets& value) {
|
121
|
+
return Result<Insets>::withValue(value);
|
122
|
+
}
|
123
|
+
inline Result_Insets_ create_Result_Insets_(const std::exception_ptr& error) {
|
124
|
+
return Result<Insets>::withError(error);
|
125
|
+
}
|
126
|
+
|
127
|
+
// pragma MARK: Result<ColorScheme>
|
128
|
+
using Result_ColorScheme_ = Result<ColorScheme>;
|
129
|
+
inline Result_ColorScheme_ create_Result_ColorScheme_(ColorScheme value) {
|
130
|
+
return Result<ColorScheme>::withValue(std::move(value));
|
131
|
+
}
|
132
|
+
inline Result_ColorScheme_ create_Result_ColorScheme_(const std::exception_ptr& error) {
|
133
|
+
return Result<ColorScheme>::withError(error);
|
134
|
+
}
|
135
|
+
|
136
|
+
// pragma MARK: Result<double>
|
137
|
+
using Result_double_ = Result<double>;
|
138
|
+
inline Result_double_ create_Result_double_(double value) {
|
139
|
+
return Result<double>::withValue(std::move(value));
|
140
|
+
}
|
141
|
+
inline Result_double_ create_Result_double_(const std::exception_ptr& error) {
|
142
|
+
return Result<double>::withError(error);
|
143
|
+
}
|
144
|
+
|
145
|
+
// pragma MARK: Result<Orientation>
|
146
|
+
using Result_Orientation_ = Result<Orientation>;
|
147
|
+
inline Result_Orientation_ create_Result_Orientation_(Orientation value) {
|
148
|
+
return Result<Orientation>::withValue(std::move(value));
|
149
|
+
}
|
150
|
+
inline Result_Orientation_ create_Result_Orientation_(const std::exception_ptr& error) {
|
151
|
+
return Result<Orientation>::withError(error);
|
152
|
+
}
|
153
|
+
|
154
|
+
// pragma MARK: Result<std::string>
|
155
|
+
using Result_std__string_ = Result<std::string>;
|
156
|
+
inline Result_std__string_ create_Result_std__string_(const std::string& value) {
|
157
|
+
return Result<std::string>::withValue(value);
|
158
|
+
}
|
159
|
+
inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) {
|
160
|
+
return Result<std::string>::withError(error);
|
161
|
+
}
|
162
|
+
|
163
|
+
// pragma MARK: Result<Dimensions>
|
164
|
+
using Result_Dimensions_ = Result<Dimensions>;
|
165
|
+
inline Result_Dimensions_ create_Result_Dimensions_(const Dimensions& value) {
|
166
|
+
return Result<Dimensions>::withValue(value);
|
167
|
+
}
|
168
|
+
inline Result_Dimensions_ create_Result_Dimensions_(const std::exception_ptr& error) {
|
169
|
+
return Result<Dimensions>::withError(error);
|
170
|
+
}
|
171
|
+
|
172
|
+
// pragma MARK: Result<bool>
|
173
|
+
using Result_bool_ = Result<bool>;
|
174
|
+
inline Result_bool_ create_Result_bool_(bool value) {
|
175
|
+
return Result<bool>::withValue(std::move(value));
|
176
|
+
}
|
177
|
+
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) {
|
178
|
+
return Result<bool>::withError(error);
|
179
|
+
}
|
180
|
+
|
181
|
+
// pragma MARK: Result<void>
|
182
|
+
using Result_void_ = Result<void>;
|
183
|
+
inline Result_void_ create_Result_void_() {
|
184
|
+
return Result<void>::withValue();
|
185
|
+
}
|
186
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) {
|
187
|
+
return Result<void>::withError(error);
|
188
|
+
}
|
189
|
+
|
190
|
+
// pragma MARK: Result<UnistylesNativeMiniRuntime>
|
191
|
+
using Result_UnistylesNativeMiniRuntime_ = Result<UnistylesNativeMiniRuntime>;
|
192
|
+
inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const UnistylesNativeMiniRuntime& value) {
|
193
|
+
return Result<UnistylesNativeMiniRuntime>::withValue(value);
|
194
|
+
}
|
195
|
+
inline Result_UnistylesNativeMiniRuntime_ create_Result_UnistylesNativeMiniRuntime_(const std::exception_ptr& error) {
|
196
|
+
return Result<UnistylesNativeMiniRuntime>::withError(error);
|
197
|
+
}
|
120
198
|
|
121
199
|
} // namespace margelo::nitro::unistyles::bridge::swift
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// Unistyles-Swift-Cxx-Umbrella.hpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
#pragma once
|
@@ -31,6 +31,8 @@ namespace margelo::nitro::unistyles { struct UnistylesNativeMiniRuntime; }
|
|
31
31
|
#include "Orientation.hpp"
|
32
32
|
#include "UnistyleDependency.hpp"
|
33
33
|
#include "UnistylesNativeMiniRuntime.hpp"
|
34
|
+
#include <NitroModules/Result.hpp>
|
35
|
+
#include <exception>
|
34
36
|
#include <functional>
|
35
37
|
#include <memory>
|
36
38
|
#include <string>
|
@@ -46,8 +48,8 @@ namespace margelo::nitro::unistyles { struct UnistylesNativeMiniRuntime; }
|
|
46
48
|
#include <NitroModules/RuntimeError.hpp>
|
47
49
|
|
48
50
|
// Forward declarations of Swift defined types
|
49
|
-
// Forward declaration of `
|
50
|
-
namespace Unistyles { class
|
51
|
+
// Forward declaration of `HybridNativePlatformSpec_cxx` to properly resolve imports.
|
52
|
+
namespace Unistyles { class HybridNativePlatformSpec_cxx; }
|
51
53
|
|
52
54
|
// Include Swift defined types
|
53
55
|
#if __has_include("Unistyles-Swift.h")
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridNativePlatformSpecSwift.cpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
#include "HybridNativePlatformSpecSwift.hpp"
|
@@ -2,15 +2,15 @@
|
|
2
2
|
/// HybridNativePlatformSpecSwift.hpp
|
3
3
|
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
4
|
/// https://github.com/mrousavy/nitro
|
5
|
-
/// Copyright ©
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
6
|
///
|
7
7
|
|
8
8
|
#pragma once
|
9
9
|
|
10
10
|
#include "HybridNativePlatformSpec.hpp"
|
11
11
|
|
12
|
-
// Forward declaration of `
|
13
|
-
namespace Unistyles { class
|
12
|
+
// Forward declaration of `HybridNativePlatformSpec_cxx` to properly resolve imports.
|
13
|
+
namespace Unistyles { class HybridNativePlatformSpec_cxx; }
|
14
14
|
|
15
15
|
// Forward declaration of `Insets` to properly resolve imports.
|
16
16
|
namespace margelo::nitro::unistyles { struct Insets; }
|
@@ -35,36 +35,30 @@ namespace margelo::nitro::unistyles { enum class UnistyleDependency; }
|
|
35
35
|
#include <vector>
|
36
36
|
#include "UnistyleDependency.hpp"
|
37
37
|
|
38
|
-
#if __has_include(<NitroModules/HybridContext.hpp>)
|
39
|
-
#include <NitroModules/HybridContext.hpp>
|
40
|
-
#else
|
41
|
-
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
42
|
-
#endif
|
43
|
-
|
44
38
|
#include "Unistyles-Swift-Cxx-Umbrella.hpp"
|
45
39
|
|
46
40
|
namespace margelo::nitro::unistyles {
|
47
41
|
|
48
42
|
/**
|
49
|
-
* The C++ part of
|
43
|
+
* The C++ part of HybridNativePlatformSpec_cxx.swift.
|
50
44
|
*
|
51
|
-
* HybridNativePlatformSpecSwift (C++) accesses
|
45
|
+
* HybridNativePlatformSpecSwift (C++) accesses HybridNativePlatformSpec_cxx (Swift), and might
|
52
46
|
* contain some additional bridging code for C++ <> Swift interop.
|
53
47
|
*
|
54
48
|
* Since this obviously introduces an overhead, I hope at some point in
|
55
|
-
* the future,
|
49
|
+
* the future, HybridNativePlatformSpec_cxx can directly inherit from the C++ class HybridNativePlatformSpec
|
56
50
|
* to simplify the whole structure and memory management.
|
57
51
|
*/
|
58
52
|
class HybridNativePlatformSpecSwift: public virtual HybridNativePlatformSpec {
|
59
53
|
public:
|
60
54
|
// Constructor from a Swift instance
|
61
|
-
explicit HybridNativePlatformSpecSwift(const Unistyles::
|
55
|
+
explicit HybridNativePlatformSpecSwift(const Unistyles::HybridNativePlatformSpec_cxx& swiftPart):
|
62
56
|
HybridObject(HybridNativePlatformSpec::TAG),
|
63
57
|
_swiftPart(swiftPart) { }
|
64
58
|
|
65
59
|
public:
|
66
60
|
// Get the Swift part
|
67
|
-
inline Unistyles::
|
61
|
+
inline Unistyles::HybridNativePlatformSpec_cxx getSwiftPart() noexcept { return _swiftPart; }
|
68
62
|
|
69
63
|
public:
|
70
64
|
// Get memory pressure
|
@@ -80,72 +74,137 @@ namespace margelo::nitro::unistyles {
|
|
80
74
|
// Methods
|
81
75
|
inline Insets getInsets() override {
|
82
76
|
auto __result = _swiftPart.getInsets();
|
83
|
-
|
77
|
+
if (__result.hasError()) [[unlikely]] {
|
78
|
+
std::rethrow_exception(__result.error());
|
79
|
+
}
|
80
|
+
auto __value = std::move(__result.value());
|
81
|
+
return __value;
|
84
82
|
}
|
85
83
|
inline ColorScheme getColorScheme() override {
|
86
84
|
auto __result = _swiftPart.getColorScheme();
|
87
|
-
|
85
|
+
if (__result.hasError()) [[unlikely]] {
|
86
|
+
std::rethrow_exception(__result.error());
|
87
|
+
}
|
88
|
+
auto __value = std::move(__result.value());
|
89
|
+
return __value;
|
88
90
|
}
|
89
91
|
inline double getFontScale() override {
|
90
92
|
auto __result = _swiftPart.getFontScale();
|
91
|
-
|
93
|
+
if (__result.hasError()) [[unlikely]] {
|
94
|
+
std::rethrow_exception(__result.error());
|
95
|
+
}
|
96
|
+
auto __value = std::move(__result.value());
|
97
|
+
return __value;
|
92
98
|
}
|
93
99
|
inline double getPixelRatio() override {
|
94
100
|
auto __result = _swiftPart.getPixelRatio();
|
95
|
-
|
101
|
+
if (__result.hasError()) [[unlikely]] {
|
102
|
+
std::rethrow_exception(__result.error());
|
103
|
+
}
|
104
|
+
auto __value = std::move(__result.value());
|
105
|
+
return __value;
|
96
106
|
}
|
97
107
|
inline Orientation getOrientation() override {
|
98
108
|
auto __result = _swiftPart.getOrientation();
|
99
|
-
|
109
|
+
if (__result.hasError()) [[unlikely]] {
|
110
|
+
std::rethrow_exception(__result.error());
|
111
|
+
}
|
112
|
+
auto __value = std::move(__result.value());
|
113
|
+
return __value;
|
100
114
|
}
|
101
115
|
inline std::string getContentSizeCategory() override {
|
102
116
|
auto __result = _swiftPart.getContentSizeCategory();
|
103
|
-
|
117
|
+
if (__result.hasError()) [[unlikely]] {
|
118
|
+
std::rethrow_exception(__result.error());
|
119
|
+
}
|
120
|
+
auto __value = std::move(__result.value());
|
121
|
+
return __value;
|
104
122
|
}
|
105
123
|
inline Dimensions getScreenDimensions() override {
|
106
124
|
auto __result = _swiftPart.getScreenDimensions();
|
107
|
-
|
125
|
+
if (__result.hasError()) [[unlikely]] {
|
126
|
+
std::rethrow_exception(__result.error());
|
127
|
+
}
|
128
|
+
auto __value = std::move(__result.value());
|
129
|
+
return __value;
|
108
130
|
}
|
109
131
|
inline Dimensions getStatusBarDimensions() override {
|
110
132
|
auto __result = _swiftPart.getStatusBarDimensions();
|
111
|
-
|
133
|
+
if (__result.hasError()) [[unlikely]] {
|
134
|
+
std::rethrow_exception(__result.error());
|
135
|
+
}
|
136
|
+
auto __value = std::move(__result.value());
|
137
|
+
return __value;
|
112
138
|
}
|
113
139
|
inline Dimensions getNavigationBarDimensions() override {
|
114
140
|
auto __result = _swiftPart.getNavigationBarDimensions();
|
115
|
-
|
141
|
+
if (__result.hasError()) [[unlikely]] {
|
142
|
+
std::rethrow_exception(__result.error());
|
143
|
+
}
|
144
|
+
auto __value = std::move(__result.value());
|
145
|
+
return __value;
|
116
146
|
}
|
117
147
|
inline bool getPrefersRtlDirection() override {
|
118
148
|
auto __result = _swiftPart.getPrefersRtlDirection();
|
119
|
-
|
149
|
+
if (__result.hasError()) [[unlikely]] {
|
150
|
+
std::rethrow_exception(__result.error());
|
151
|
+
}
|
152
|
+
auto __value = std::move(__result.value());
|
153
|
+
return __value;
|
120
154
|
}
|
121
155
|
inline void setRootViewBackgroundColor(double color) override {
|
122
|
-
_swiftPart.setRootViewBackgroundColor(std::forward<decltype(color)>(color));
|
156
|
+
auto __result = _swiftPart.setRootViewBackgroundColor(std::forward<decltype(color)>(color));
|
157
|
+
if (__result.hasError()) [[unlikely]] {
|
158
|
+
std::rethrow_exception(__result.error());
|
159
|
+
}
|
123
160
|
}
|
124
161
|
inline void setNavigationBarHidden(bool isHidden) override {
|
125
|
-
_swiftPart.setNavigationBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
162
|
+
auto __result = _swiftPart.setNavigationBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
163
|
+
if (__result.hasError()) [[unlikely]] {
|
164
|
+
std::rethrow_exception(__result.error());
|
165
|
+
}
|
126
166
|
}
|
127
167
|
inline void setStatusBarHidden(bool isHidden) override {
|
128
|
-
_swiftPart.setStatusBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
168
|
+
auto __result = _swiftPart.setStatusBarHidden(std::forward<decltype(isHidden)>(isHidden));
|
169
|
+
if (__result.hasError()) [[unlikely]] {
|
170
|
+
std::rethrow_exception(__result.error());
|
171
|
+
}
|
129
172
|
}
|
130
173
|
inline void setImmersiveMode(bool isEnabled) override {
|
131
|
-
_swiftPart.setImmersiveMode(std::forward<decltype(isEnabled)>(isEnabled));
|
174
|
+
auto __result = _swiftPart.setImmersiveMode(std::forward<decltype(isEnabled)>(isEnabled));
|
175
|
+
if (__result.hasError()) [[unlikely]] {
|
176
|
+
std::rethrow_exception(__result.error());
|
177
|
+
}
|
132
178
|
}
|
133
179
|
inline UnistylesNativeMiniRuntime getMiniRuntime() override {
|
134
180
|
auto __result = _swiftPart.getMiniRuntime();
|
135
|
-
|
181
|
+
if (__result.hasError()) [[unlikely]] {
|
182
|
+
std::rethrow_exception(__result.error());
|
183
|
+
}
|
184
|
+
auto __value = std::move(__result.value());
|
185
|
+
return __value;
|
136
186
|
}
|
137
187
|
inline void registerPlatformListener(const std::function<void(const std::vector<UnistyleDependency>& /* dependencies */, const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override {
|
138
|
-
_swiftPart.registerPlatformListener(callback);
|
188
|
+
auto __result = _swiftPart.registerPlatformListener(callback);
|
189
|
+
if (__result.hasError()) [[unlikely]] {
|
190
|
+
std::rethrow_exception(__result.error());
|
191
|
+
}
|
139
192
|
}
|
140
193
|
inline void registerImeListener(const std::function<void(const UnistylesNativeMiniRuntime& /* miniRuntime */)>& callback) override {
|
141
|
-
_swiftPart.registerImeListener(callback);
|
194
|
+
auto __result = _swiftPart.registerImeListener(callback);
|
195
|
+
if (__result.hasError()) [[unlikely]] {
|
196
|
+
std::rethrow_exception(__result.error());
|
197
|
+
}
|
142
198
|
}
|
143
199
|
inline void unregisterPlatformListeners() override {
|
144
|
-
_swiftPart.unregisterPlatformListeners();
|
200
|
+
auto __result = _swiftPart.unregisterPlatformListeners();
|
201
|
+
if (__result.hasError()) [[unlikely]] {
|
202
|
+
std::rethrow_exception(__result.error());
|
203
|
+
}
|
145
204
|
}
|
146
205
|
|
147
206
|
private:
|
148
|
-
Unistyles::
|
207
|
+
Unistyles::HybridNativePlatformSpec_cxx _swiftPart;
|
149
208
|
};
|
150
209
|
|
151
210
|
} // namespace margelo::nitro::unistyles
|