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
@@ -0,0 +1,46 @@
|
|
1
|
+
///
|
2
|
+
/// Func_void_UnistylesNativeMiniRuntime.swift
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
|
+
/// https://github.com/mrousavy/nitro
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
|
+
///
|
7
|
+
|
8
|
+
import NitroModules
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Wraps a Swift `(_ miniRuntime: UnistylesNativeMiniRuntime) -> Void` as a class.
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
13
|
+
*/
|
14
|
+
public final class Func_void_UnistylesNativeMiniRuntime {
|
15
|
+
public typealias bridge = margelo.nitro.unistyles.bridge.swift
|
16
|
+
|
17
|
+
private let closure: (_ miniRuntime: UnistylesNativeMiniRuntime) -> Void
|
18
|
+
|
19
|
+
public init(_ closure: @escaping (_ miniRuntime: UnistylesNativeMiniRuntime) -> Void) {
|
20
|
+
self.closure = closure
|
21
|
+
}
|
22
|
+
|
23
|
+
@inline(__always)
|
24
|
+
public func call(miniRuntime: UnistylesNativeMiniRuntime) -> Void {
|
25
|
+
self.closure(miniRuntime)
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
30
|
+
* This acquires one additional strong reference on the object!
|
31
|
+
*/
|
32
|
+
@inline(__always)
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Casts an unsafe pointer to a `Func_void_UnistylesNativeMiniRuntime`.
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_UnistylesNativeMiniRuntime>`.
|
40
|
+
* This removes one strong reference from the object!
|
41
|
+
*/
|
42
|
+
@inline(__always)
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_UnistylesNativeMiniRuntime {
|
44
|
+
return Unmanaged<Func_void_UnistylesNativeMiniRuntime>.fromOpaque(pointer).takeRetainedValue()
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
///
|
2
|
+
/// Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime.swift
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
|
+
/// https://github.com/mrousavy/nitro
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
|
+
///
|
7
|
+
|
8
|
+
import NitroModules
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Wraps a Swift `(_ dependencies: [UnistyleDependency], _ miniRuntime: UnistylesNativeMiniRuntime) -> Void` as a class.
|
12
|
+
* This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
|
13
|
+
*/
|
14
|
+
public final class Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime {
|
15
|
+
public typealias bridge = margelo.nitro.unistyles.bridge.swift
|
16
|
+
|
17
|
+
private let closure: (_ dependencies: [UnistyleDependency], _ miniRuntime: UnistylesNativeMiniRuntime) -> Void
|
18
|
+
|
19
|
+
public init(_ closure: @escaping (_ dependencies: [UnistyleDependency], _ miniRuntime: UnistylesNativeMiniRuntime) -> Void) {
|
20
|
+
self.closure = closure
|
21
|
+
}
|
22
|
+
|
23
|
+
@inline(__always)
|
24
|
+
public func call(dependencies: bridge.std__vector_UnistyleDependency_, miniRuntime: UnistylesNativeMiniRuntime) -> Void {
|
25
|
+
self.closure(dependencies.map({ __item in __item }), miniRuntime)
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Casts this instance to a retained unsafe raw pointer.
|
30
|
+
* This acquires one additional strong reference on the object!
|
31
|
+
*/
|
32
|
+
@inline(__always)
|
33
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
34
|
+
return Unmanaged.passRetained(self).toOpaque()
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Casts an unsafe pointer to a `Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime`.
|
39
|
+
* The pointer has to be a retained opaque `Unmanaged<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime>`.
|
40
|
+
* This removes one strong reference from the object!
|
41
|
+
*/
|
42
|
+
@inline(__always)
|
43
|
+
public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime {
|
44
|
+
return Unmanaged<Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime>.fromOpaque(pointer).takeRetainedValue()
|
45
|
+
}
|
46
|
+
}
|
@@ -2,32 +2,14 @@
|
|
2
2
|
/// HybridNativePlatformSpec.swift
|
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
|
import Foundation
|
9
9
|
import NitroModules
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
* Implement this protocol to create Swift-based instances of NativePlatform.
|
14
|
-
*
|
15
|
-
* When implementing this protocol, make sure to initialize `hybridContext` - example:
|
16
|
-
* ```
|
17
|
-
* public class HybridNativePlatform : HybridNativePlatformSpec {
|
18
|
-
* // Initialize HybridContext
|
19
|
-
* var hybridContext = margelo.nitro.HybridContext()
|
20
|
-
*
|
21
|
-
* // Return size of the instance to inform JS GC about memory pressure
|
22
|
-
* var memorySize: Int {
|
23
|
-
* return getSizeOf(self)
|
24
|
-
* }
|
25
|
-
*
|
26
|
-
* // ...
|
27
|
-
* }
|
28
|
-
* ```
|
29
|
-
*/
|
30
|
-
public protocol HybridNativePlatformSpec: AnyObject, HybridObjectSpec {
|
11
|
+
/// See ``HybridNativePlatformSpec``
|
12
|
+
public protocol HybridNativePlatformSpec_protocol: AnyObject {
|
31
13
|
// Properties
|
32
14
|
|
33
15
|
|
@@ -47,7 +29,38 @@ public protocol HybridNativePlatformSpec: AnyObject, HybridObjectSpec {
|
|
47
29
|
func setStatusBarHidden(isHidden: Bool) throws -> Void
|
48
30
|
func setImmersiveMode(isEnabled: Bool) throws -> Void
|
49
31
|
func getMiniRuntime() throws -> UnistylesNativeMiniRuntime
|
50
|
-
func registerPlatformListener(callback: @escaping (
|
51
|
-
func registerImeListener(callback: @escaping (
|
32
|
+
func registerPlatformListener(callback: @escaping (_ dependencies: [UnistyleDependency], _ miniRuntime: UnistylesNativeMiniRuntime) -> Void) throws -> Void
|
33
|
+
func registerImeListener(callback: @escaping (_ miniRuntime: UnistylesNativeMiniRuntime) -> Void) throws -> Void
|
52
34
|
func unregisterPlatformListeners() throws -> Void
|
53
35
|
}
|
36
|
+
|
37
|
+
/// See ``HybridNativePlatformSpec``
|
38
|
+
public class HybridNativePlatformSpec_base: HybridObjectSpec {
|
39
|
+
private weak var cxxWrapper: HybridNativePlatformSpec_cxx? = nil
|
40
|
+
public func getCxxWrapper() -> HybridNativePlatformSpec_cxx {
|
41
|
+
#if DEBUG
|
42
|
+
guard self is HybridNativePlatformSpec else {
|
43
|
+
fatalError("`self` is not a `HybridNativePlatformSpec`! Did you accidentally inherit from `HybridNativePlatformSpec_base` instead of `HybridNativePlatformSpec`?")
|
44
|
+
}
|
45
|
+
#endif
|
46
|
+
if let cxxWrapper = self.cxxWrapper {
|
47
|
+
return cxxWrapper
|
48
|
+
} else {
|
49
|
+
let cxxWrapper = HybridNativePlatformSpec_cxx(self as! HybridNativePlatformSpec)
|
50
|
+
self.cxxWrapper = cxxWrapper
|
51
|
+
return cxxWrapper
|
52
|
+
}
|
53
|
+
}
|
54
|
+
public var memorySize: Int { return 0 }
|
55
|
+
}
|
56
|
+
|
57
|
+
/**
|
58
|
+
* A Swift base-protocol representing the NativePlatform HybridObject.
|
59
|
+
* Implement this protocol to create Swift-based instances of NativePlatform.
|
60
|
+
* ```swift
|
61
|
+
* class HybridNativePlatform : HybridNativePlatformSpec {
|
62
|
+
* // ...
|
63
|
+
* }
|
64
|
+
* ```
|
65
|
+
*/
|
66
|
+
public typealias HybridNativePlatformSpec = HybridNativePlatformSpec_protocol & HybridNativePlatformSpec_base
|
@@ -0,0 +1,327 @@
|
|
1
|
+
///
|
2
|
+
/// HybridNativePlatformSpec_cxx.swift
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
4
|
+
/// https://github.com/mrousavy/nitro
|
5
|
+
/// Copyright © 2025 Marc Rousavy @ Margelo
|
6
|
+
///
|
7
|
+
|
8
|
+
import Foundation
|
9
|
+
import NitroModules
|
10
|
+
|
11
|
+
/**
|
12
|
+
* A class implementation that bridges HybridNativePlatformSpec over to C++.
|
13
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
14
|
+
*
|
15
|
+
* Also, some Swift types need to be bridged with special handling:
|
16
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
17
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
18
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
19
|
+
*/
|
20
|
+
public class HybridNativePlatformSpec_cxx {
|
21
|
+
/**
|
22
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::unistyles::bridge::swift`)
|
23
|
+
* from `Unistyles-Swift-Cxx-Bridge.hpp`.
|
24
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
25
|
+
*/
|
26
|
+
public typealias bridge = margelo.nitro.unistyles.bridge.swift
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Holds an instance of the `HybridNativePlatformSpec` Swift protocol.
|
30
|
+
*/
|
31
|
+
private var __implementation: any HybridNativePlatformSpec
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
35
|
+
*/
|
36
|
+
private var __cxxPart: bridge.std__weak_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Create a new `HybridNativePlatformSpec_cxx` that wraps the given `HybridNativePlatformSpec`.
|
40
|
+
* All properties and methods bridge to C++ types.
|
41
|
+
*/
|
42
|
+
public init(_ implementation: any HybridNativePlatformSpec) {
|
43
|
+
self.__implementation = implementation
|
44
|
+
self.__cxxPart = .init()
|
45
|
+
/* no base class */
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Get the actual `HybridNativePlatformSpec` instance this class wraps.
|
50
|
+
*/
|
51
|
+
@inline(__always)
|
52
|
+
public func getHybridNativePlatformSpec() -> any HybridNativePlatformSpec {
|
53
|
+
return __implementation
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Casts this instance to a retained unsafe raw pointer.
|
58
|
+
* This acquires one additional strong reference on the object!
|
59
|
+
*/
|
60
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
61
|
+
return Unmanaged.passRetained(self).toOpaque()
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Casts an unsafe pointer to a `HybridNativePlatformSpec_cxx`.
|
66
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNativePlatformSpec_cxx>`.
|
67
|
+
* This removes one strong reference from the object!
|
68
|
+
*/
|
69
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNativePlatformSpec_cxx {
|
70
|
+
return Unmanaged<HybridNativePlatformSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
75
|
+
* The C++ part is a `std::shared_ptr<margelo::nitro::unistyles::HybridNativePlatformSpec>`.
|
76
|
+
*/
|
77
|
+
public func getCxxPart() -> bridge.std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_ {
|
78
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
79
|
+
if cachedCxxPart.__convertToBool() {
|
80
|
+
return cachedCxxPart
|
81
|
+
} else {
|
82
|
+
let newCxxPart = bridge.create_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(self.toUnsafe())
|
83
|
+
__cxxPart = bridge.weakify_std__shared_ptr_margelo__nitro__unistyles__HybridNativePlatformSpec_(newCxxPart)
|
84
|
+
return newCxxPart
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
92
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
93
|
+
*/
|
94
|
+
@inline(__always)
|
95
|
+
public var memorySize: Int {
|
96
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
97
|
+
}
|
98
|
+
|
99
|
+
// Properties
|
100
|
+
|
101
|
+
|
102
|
+
// Methods
|
103
|
+
@inline(__always)
|
104
|
+
public func getInsets() -> bridge.Result_Insets_ {
|
105
|
+
do {
|
106
|
+
let __result = try self.__implementation.getInsets()
|
107
|
+
let __resultCpp = __result
|
108
|
+
return bridge.create_Result_Insets_(__resultCpp)
|
109
|
+
} catch (let __error) {
|
110
|
+
let __exceptionPtr = __error.toCpp()
|
111
|
+
return bridge.create_Result_Insets_(__exceptionPtr)
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
@inline(__always)
|
116
|
+
public func getColorScheme() -> bridge.Result_ColorScheme_ {
|
117
|
+
do {
|
118
|
+
let __result = try self.__implementation.getColorScheme()
|
119
|
+
let __resultCpp = __result
|
120
|
+
return bridge.create_Result_ColorScheme_(__resultCpp)
|
121
|
+
} catch (let __error) {
|
122
|
+
let __exceptionPtr = __error.toCpp()
|
123
|
+
return bridge.create_Result_ColorScheme_(__exceptionPtr)
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
@inline(__always)
|
128
|
+
public func getFontScale() -> bridge.Result_double_ {
|
129
|
+
do {
|
130
|
+
let __result = try self.__implementation.getFontScale()
|
131
|
+
let __resultCpp = __result
|
132
|
+
return bridge.create_Result_double_(__resultCpp)
|
133
|
+
} catch (let __error) {
|
134
|
+
let __exceptionPtr = __error.toCpp()
|
135
|
+
return bridge.create_Result_double_(__exceptionPtr)
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
@inline(__always)
|
140
|
+
public func getPixelRatio() -> bridge.Result_double_ {
|
141
|
+
do {
|
142
|
+
let __result = try self.__implementation.getPixelRatio()
|
143
|
+
let __resultCpp = __result
|
144
|
+
return bridge.create_Result_double_(__resultCpp)
|
145
|
+
} catch (let __error) {
|
146
|
+
let __exceptionPtr = __error.toCpp()
|
147
|
+
return bridge.create_Result_double_(__exceptionPtr)
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
@inline(__always)
|
152
|
+
public func getOrientation() -> bridge.Result_Orientation_ {
|
153
|
+
do {
|
154
|
+
let __result = try self.__implementation.getOrientation()
|
155
|
+
let __resultCpp = __result
|
156
|
+
return bridge.create_Result_Orientation_(__resultCpp)
|
157
|
+
} catch (let __error) {
|
158
|
+
let __exceptionPtr = __error.toCpp()
|
159
|
+
return bridge.create_Result_Orientation_(__exceptionPtr)
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
@inline(__always)
|
164
|
+
public func getContentSizeCategory() -> bridge.Result_std__string_ {
|
165
|
+
do {
|
166
|
+
let __result = try self.__implementation.getContentSizeCategory()
|
167
|
+
let __resultCpp = std.string(__result)
|
168
|
+
return bridge.create_Result_std__string_(__resultCpp)
|
169
|
+
} catch (let __error) {
|
170
|
+
let __exceptionPtr = __error.toCpp()
|
171
|
+
return bridge.create_Result_std__string_(__exceptionPtr)
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
@inline(__always)
|
176
|
+
public func getScreenDimensions() -> bridge.Result_Dimensions_ {
|
177
|
+
do {
|
178
|
+
let __result = try self.__implementation.getScreenDimensions()
|
179
|
+
let __resultCpp = __result
|
180
|
+
return bridge.create_Result_Dimensions_(__resultCpp)
|
181
|
+
} catch (let __error) {
|
182
|
+
let __exceptionPtr = __error.toCpp()
|
183
|
+
return bridge.create_Result_Dimensions_(__exceptionPtr)
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
@inline(__always)
|
188
|
+
public func getStatusBarDimensions() -> bridge.Result_Dimensions_ {
|
189
|
+
do {
|
190
|
+
let __result = try self.__implementation.getStatusBarDimensions()
|
191
|
+
let __resultCpp = __result
|
192
|
+
return bridge.create_Result_Dimensions_(__resultCpp)
|
193
|
+
} catch (let __error) {
|
194
|
+
let __exceptionPtr = __error.toCpp()
|
195
|
+
return bridge.create_Result_Dimensions_(__exceptionPtr)
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
@inline(__always)
|
200
|
+
public func getNavigationBarDimensions() -> bridge.Result_Dimensions_ {
|
201
|
+
do {
|
202
|
+
let __result = try self.__implementation.getNavigationBarDimensions()
|
203
|
+
let __resultCpp = __result
|
204
|
+
return bridge.create_Result_Dimensions_(__resultCpp)
|
205
|
+
} catch (let __error) {
|
206
|
+
let __exceptionPtr = __error.toCpp()
|
207
|
+
return bridge.create_Result_Dimensions_(__exceptionPtr)
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
@inline(__always)
|
212
|
+
public func getPrefersRtlDirection() -> bridge.Result_bool_ {
|
213
|
+
do {
|
214
|
+
let __result = try self.__implementation.getPrefersRtlDirection()
|
215
|
+
let __resultCpp = __result
|
216
|
+
return bridge.create_Result_bool_(__resultCpp)
|
217
|
+
} catch (let __error) {
|
218
|
+
let __exceptionPtr = __error.toCpp()
|
219
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
@inline(__always)
|
224
|
+
public func setRootViewBackgroundColor(color: Double) -> bridge.Result_void_ {
|
225
|
+
do {
|
226
|
+
try self.__implementation.setRootViewBackgroundColor(color: color)
|
227
|
+
return bridge.create_Result_void_()
|
228
|
+
} catch (let __error) {
|
229
|
+
let __exceptionPtr = __error.toCpp()
|
230
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
231
|
+
}
|
232
|
+
}
|
233
|
+
|
234
|
+
@inline(__always)
|
235
|
+
public func setNavigationBarHidden(isHidden: Bool) -> bridge.Result_void_ {
|
236
|
+
do {
|
237
|
+
try self.__implementation.setNavigationBarHidden(isHidden: isHidden)
|
238
|
+
return bridge.create_Result_void_()
|
239
|
+
} catch (let __error) {
|
240
|
+
let __exceptionPtr = __error.toCpp()
|
241
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
242
|
+
}
|
243
|
+
}
|
244
|
+
|
245
|
+
@inline(__always)
|
246
|
+
public func setStatusBarHidden(isHidden: Bool) -> bridge.Result_void_ {
|
247
|
+
do {
|
248
|
+
try self.__implementation.setStatusBarHidden(isHidden: isHidden)
|
249
|
+
return bridge.create_Result_void_()
|
250
|
+
} catch (let __error) {
|
251
|
+
let __exceptionPtr = __error.toCpp()
|
252
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
@inline(__always)
|
257
|
+
public func setImmersiveMode(isEnabled: Bool) -> bridge.Result_void_ {
|
258
|
+
do {
|
259
|
+
try self.__implementation.setImmersiveMode(isEnabled: isEnabled)
|
260
|
+
return bridge.create_Result_void_()
|
261
|
+
} catch (let __error) {
|
262
|
+
let __exceptionPtr = __error.toCpp()
|
263
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
264
|
+
}
|
265
|
+
}
|
266
|
+
|
267
|
+
@inline(__always)
|
268
|
+
public func getMiniRuntime() -> bridge.Result_UnistylesNativeMiniRuntime_ {
|
269
|
+
do {
|
270
|
+
let __result = try self.__implementation.getMiniRuntime()
|
271
|
+
let __resultCpp = __result
|
272
|
+
return bridge.create_Result_UnistylesNativeMiniRuntime_(__resultCpp)
|
273
|
+
} catch (let __error) {
|
274
|
+
let __exceptionPtr = __error.toCpp()
|
275
|
+
return bridge.create_Result_UnistylesNativeMiniRuntime_(__exceptionPtr)
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
279
|
+
@inline(__always)
|
280
|
+
public func registerPlatformListener(callback: bridge.Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime) -> bridge.Result_void_ {
|
281
|
+
do {
|
282
|
+
try self.__implementation.registerPlatformListener(callback: { () -> ([UnistyleDependency], UnistylesNativeMiniRuntime) -> Void in
|
283
|
+
let __wrappedFunction = bridge.wrap_Func_void_std__vector_UnistyleDependency__UnistylesNativeMiniRuntime(callback)
|
284
|
+
return { (__dependencies: [UnistyleDependency], __miniRuntime: UnistylesNativeMiniRuntime) -> Void in
|
285
|
+
__wrappedFunction.call({ () -> bridge.std__vector_UnistyleDependency_ in
|
286
|
+
var __vector = bridge.create_std__vector_UnistyleDependency_(__dependencies.count)
|
287
|
+
for __item in __dependencies {
|
288
|
+
__vector.push_back(__item)
|
289
|
+
}
|
290
|
+
return __vector
|
291
|
+
}(), __miniRuntime)
|
292
|
+
}
|
293
|
+
}())
|
294
|
+
return bridge.create_Result_void_()
|
295
|
+
} catch (let __error) {
|
296
|
+
let __exceptionPtr = __error.toCpp()
|
297
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
298
|
+
}
|
299
|
+
}
|
300
|
+
|
301
|
+
@inline(__always)
|
302
|
+
public func registerImeListener(callback: bridge.Func_void_UnistylesNativeMiniRuntime) -> bridge.Result_void_ {
|
303
|
+
do {
|
304
|
+
try self.__implementation.registerImeListener(callback: { () -> (UnistylesNativeMiniRuntime) -> Void in
|
305
|
+
let __wrappedFunction = bridge.wrap_Func_void_UnistylesNativeMiniRuntime(callback)
|
306
|
+
return { (__miniRuntime: UnistylesNativeMiniRuntime) -> Void in
|
307
|
+
__wrappedFunction.call(__miniRuntime)
|
308
|
+
}
|
309
|
+
}())
|
310
|
+
return bridge.create_Result_void_()
|
311
|
+
} catch (let __error) {
|
312
|
+
let __exceptionPtr = __error.toCpp()
|
313
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
@inline(__always)
|
318
|
+
public func unregisterPlatformListeners() -> bridge.Result_void_ {
|
319
|
+
do {
|
320
|
+
try self.__implementation.unregisterPlatformListeners()
|
321
|
+
return bridge.create_Result_void_()
|
322
|
+
} catch (let __error) {
|
323
|
+
let __exceptionPtr = __error.toCpp()
|
324
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
325
|
+
}
|
326
|
+
}
|
327
|
+
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// UnistylesNativeMiniRuntime.swift
|
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
|
import NitroModules
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridNativePlatformSpec.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 "HybridNativePlatformSpec.hpp"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridUnistylesNavigationBarSpec.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 "HybridUnistylesNavigationBarSpec.hpp"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridUnistylesRuntimeSpec.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 "HybridUnistylesRuntimeSpec.hpp"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridUnistylesShadowRegistrySpec.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 "HybridUnistylesShadowRegistrySpec.hpp"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridUnistylesStatusBarSpec.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 "HybridUnistylesStatusBarSpec.hpp"
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// HybridUnistylesStyleSheetSpec.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 "HybridUnistylesStyleSheetSpec.hpp"
|