@sbaiahmed1/react-native-blur 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +222 -0
- package/ReactNativeBlur.podspec +20 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +38 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +20 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec-generated.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +22 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +24 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.cpp +16 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +23 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +27 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +63 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI-generated.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI.h +19 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +17 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +32 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.cpp +16 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +29 -0
- package/android/build.gradle +85 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurPackage.kt +19 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +369 -0
- package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurViewManager.kt +50 -0
- package/ios/ReactNativeBlurView.h +14 -0
- package/ios/ReactNativeBlurView.mm +311 -0
- package/ios/ReactNativeBlurViewManager.mm +23 -0
- package/lib/module/BlurView.js +41 -0
- package/lib/module/BlurView.js.map +1 -0
- package/lib/module/ReactNativeBlurViewNativeComponent.ts +27 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/BlurView.d.ts +48 -0
- package/lib/typescript/src/BlurView.d.ts.map +1 -0
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts +11 -0
- package/lib/typescript/src/ReactNativeBlurViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +170 -0
- package/src/BlurView.tsx +75 -0
- package/src/ReactNativeBlurViewNativeComponent.ts +27 -0
- package/src/index.tsx +5 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ahmed Sbai
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# @sbaiahmed1/react-native-blur
|
|
2
|
+
|
|
3
|
+
A modern React Native blur view component that provides native blur effects for both iOS and Android platforms.
|
|
4
|
+
|
|
5
|
+
## Demo
|
|
6
|
+
|
|
7
|
+
<div align="center">
|
|
8
|
+
<img src="iOS-demo.gif" alt="iOS Demo" width="300" />
|
|
9
|
+
<img src="android-demo.gif" alt="Android Demo" width="300" />
|
|
10
|
+
<br>
|
|
11
|
+
<em>iOS (left) and Android (right) blur effects in action</em>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- 🎨 **Multiple Blur Types**: Support for various blur styles including system materials on iOS
|
|
17
|
+
- 📱 **Cross-Platform**: Works on both iOS and Android
|
|
18
|
+
- ♿ **Accessibility**: Automatic fallback for reduced transparency settings
|
|
19
|
+
- 🔧 **TypeScript**: Full TypeScript support with proper type definitions
|
|
20
|
+
- 🚀 **Turbo Module**: Built with React Native's new architecture (Fabric)
|
|
21
|
+
- 🎯 **Customizable**: Adjustable blur intensity and fallback colors
|
|
22
|
+
- 💡 **Performance Optimized**: Uses hardware acceleration for smooth rendering
|
|
23
|
+
- 🛠️ **Easy to Use**: Simple API for quick integration into your React Native projects
|
|
24
|
+
- 📦 **Modern**: Uses Kotlin for Android implementation and *will* use Swift for iOS, ensuring modern development practices
|
|
25
|
+
|
|
26
|
+
## Architecture Compatibility
|
|
27
|
+
|
|
28
|
+
This library is fully compatible with both React Native architectures:
|
|
29
|
+
|
|
30
|
+
- ✅ **New Architecture (Fabric)**: Full support with Turbo Modules
|
|
31
|
+
- ✅ **Old Architecture (Paper)**: Backward compatibility maintained
|
|
32
|
+
|
|
33
|
+
Both architectures have been tested and work perfectly without any additional configuration required.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @sbaiahmed1/react-native-blur
|
|
39
|
+
# or
|
|
40
|
+
yarn add @sbaiahmed1/react-native-blur
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### iOS Setup
|
|
44
|
+
|
|
45
|
+
Run pod install:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cd ios && pod install
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Android Setup
|
|
52
|
+
|
|
53
|
+
### Requirements
|
|
54
|
+
- **Minimum SDK:** API level 24 (Android 7.0)
|
|
55
|
+
- **Target SDK:** API level 35 (Android 15)
|
|
56
|
+
- **Compile SDK:** API level 35 (Android 15)
|
|
57
|
+
- **Gradle:** 8.10.2
|
|
58
|
+
- **Kotlin:** 2.0.21
|
|
59
|
+
|
|
60
|
+
### Dependencies
|
|
61
|
+
The Android implementation uses the [BlurView library by Dimezis](https://github.com/Dimezis/BlurView):
|
|
62
|
+
```gradle
|
|
63
|
+
implementation 'com.github.Dimezis:BlurView:version-2.0.6'
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Implementation Details
|
|
67
|
+
The Android implementation leverages the BlurView library to provide real blur effects:
|
|
68
|
+
|
|
69
|
+
- **Real-time Blur:** Uses `RenderEffectBlur` for hardware-accelerated blur rendering
|
|
70
|
+
- **Hardware Acceleration:** Utilizes GPU rendering for optimal performance
|
|
71
|
+
- **Multiple Blur Algorithms:** Supports different blur implementations based on device capabilities
|
|
72
|
+
- **Performance Optimized:** Efficient blur rendering with minimal impact on app performance
|
|
73
|
+
- **Fallback Handling:** Gracefully handles devices with limited graphics capabilities
|
|
74
|
+
- **No Extra Permissions:** Does not require additional Android permissions
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
### Basic Usage
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import React from 'react';
|
|
82
|
+
import { View, Text } from 'react-native';
|
|
83
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
84
|
+
|
|
85
|
+
export default function App() {
|
|
86
|
+
return (
|
|
87
|
+
<View style={{ flex: 1 }}>
|
|
88
|
+
<BlurView
|
|
89
|
+
blurType="light"
|
|
90
|
+
blurAmount={20}
|
|
91
|
+
style={{
|
|
92
|
+
position: 'absolute',
|
|
93
|
+
top: 100,
|
|
94
|
+
left: 50,
|
|
95
|
+
right: 50,
|
|
96
|
+
height: 200,
|
|
97
|
+
borderRadius: 20,
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
<Text>Content with blur background</Text>
|
|
101
|
+
</BlurView>
|
|
102
|
+
</View>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Advanced Usage
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
import React from 'react';
|
|
111
|
+
import { BlurView } from '@sbaiahmed1/react-native-blur';
|
|
112
|
+
|
|
113
|
+
function MyComponent() {
|
|
114
|
+
return (
|
|
115
|
+
<BlurView
|
|
116
|
+
blurType="systemMaterial"
|
|
117
|
+
blurAmount={50}
|
|
118
|
+
reducedTransparencyFallbackColor="#FFFFFF80"
|
|
119
|
+
style={{
|
|
120
|
+
padding: 20,
|
|
121
|
+
borderRadius: 15,
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<Text>Advanced blur with custom fallback</Text>
|
|
125
|
+
</BlurView>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Props
|
|
131
|
+
|
|
132
|
+
| Prop | Type | Default | Description |
|
|
133
|
+
|------|------|---------|-------------|
|
|
134
|
+
| `blurType` | `BlurType` | `'light'` | The type of blur effect to apply |
|
|
135
|
+
| `blurAmount` | `number` | `10` | The intensity of the blur effect (0-100) |
|
|
136
|
+
| `reducedTransparencyFallbackColor` | `string` | `undefined` | Fallback color when reduced transparency is enabled |
|
|
137
|
+
| `style` | `ViewStyle` | `undefined` | Style object for the blur view |
|
|
138
|
+
| `children` | `ReactNode` | `undefined` | Child components to render inside the blur view |
|
|
139
|
+
|
|
140
|
+
## Blur Types
|
|
141
|
+
|
|
142
|
+
The following blur types are supported:
|
|
143
|
+
|
|
144
|
+
### iOS & Android
|
|
145
|
+
- `'light'` - Light blur effect
|
|
146
|
+
- `'dark'` - Dark blur effect
|
|
147
|
+
- `'xlight'` - Extra light blur effect
|
|
148
|
+
- `'extraDark'` - Extra dark blur effect
|
|
149
|
+
|
|
150
|
+
### iOS Only (with fallbacks on Android)
|
|
151
|
+
- `'regular'` - Regular blur (iOS 10+)
|
|
152
|
+
- `'prominent'` - Prominent blur (iOS 10+)
|
|
153
|
+
- `'systemUltraThinMaterial'` - Ultra thin material (iOS 13+)
|
|
154
|
+
- `'systemThinMaterial'` - Thin material (iOS 13+)
|
|
155
|
+
- `'systemMaterial'` - Material (iOS 13+)
|
|
156
|
+
- `'systemThickMaterial'` - Thick material (iOS 13+)
|
|
157
|
+
- `'systemChromeMaterial'` - Chrome material (iOS 13+)
|
|
158
|
+
|
|
159
|
+
## Platform Differences
|
|
160
|
+
|
|
161
|
+
### iOS
|
|
162
|
+
On iOS, this component uses `UIVisualEffectView` to provide true blur effects. All blur types are supported with their native implementations.
|
|
163
|
+
|
|
164
|
+
### Android
|
|
165
|
+
On Android, the component uses the BlurView library to provide real blur effects with hardware acceleration. The implementation supports multiple blur algorithms and gracefully falls back to translucent overlay approximation on devices with limited graphics capabilities.
|
|
166
|
+
|
|
167
|
+
## Accessibility
|
|
168
|
+
|
|
169
|
+
The component automatically respects the "Reduce Transparency" accessibility setting:
|
|
170
|
+
|
|
171
|
+
- **iOS**: When reduce transparency is enabled, the blur view is hidden and a fallback view with solid color is shown
|
|
172
|
+
- **Android**: The fallback color is always used as the base for the blur approximation
|
|
173
|
+
|
|
174
|
+
You can customize the fallback color using the `reducedTransparencyFallbackColor` prop.
|
|
175
|
+
|
|
176
|
+
## TypeScript Support
|
|
177
|
+
|
|
178
|
+
This package includes full TypeScript definitions:
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
import { BlurView, BlurType, BlurViewProps } from '@sbaiahmed1/react-native-blur';
|
|
182
|
+
|
|
183
|
+
// BlurType is exported for type checking
|
|
184
|
+
const blurType: BlurType = 'systemMaterial';
|
|
185
|
+
|
|
186
|
+
// BlurViewProps for component props
|
|
187
|
+
interface MyComponentProps {
|
|
188
|
+
blurProps: BlurViewProps;
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Example App
|
|
193
|
+
|
|
194
|
+
The package includes a comprehensive example app that demonstrates all blur types and features. To run the example:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
cd example
|
|
198
|
+
npm install
|
|
199
|
+
# For iOS
|
|
200
|
+
npx react-native run-ios
|
|
201
|
+
# For Android
|
|
202
|
+
npx react-native run-android
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Performance Considerations
|
|
206
|
+
|
|
207
|
+
- **iOS**: Native blur effects are hardware-accelerated and performant
|
|
208
|
+
- **Android**: Real blur effects are hardware-accelerated with fallback to lightweight overlay when needed
|
|
209
|
+
- Avoid using too many blur views simultaneously on lower-end devices
|
|
210
|
+
- Consider using `reducedTransparencyFallbackColor` for better accessibility
|
|
211
|
+
|
|
212
|
+
## Contributing
|
|
213
|
+
|
|
214
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
215
|
+
|
|
216
|
+
## License
|
|
217
|
+
|
|
218
|
+
MIT
|
|
219
|
+
|
|
220
|
+
## Credits
|
|
221
|
+
|
|
222
|
+
Built with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "ReactNativeBlur"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/sbaiahmed1/sbaiahmed1-react-native-blur.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
|
|
19
|
+
install_modules_dependencies(s)
|
|
20
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaDelegate.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.BaseViewManager;
|
|
15
|
+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
|
16
|
+
import com.facebook.react.uimanager.LayoutShadowNode;
|
|
17
|
+
|
|
18
|
+
public class ReactNativeBlurViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeBlurViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
|
19
|
+
public ReactNativeBlurViewManagerDelegate(U viewManager) {
|
|
20
|
+
super(viewManager);
|
|
21
|
+
}
|
|
22
|
+
@Override
|
|
23
|
+
public void setProperty(T view, String propName, @Nullable Object value) {
|
|
24
|
+
switch (propName) {
|
|
25
|
+
case "blurType":
|
|
26
|
+
mViewManager.setBlurType(view, (String) value);
|
|
27
|
+
break;
|
|
28
|
+
case "blurAmount":
|
|
29
|
+
mViewManager.setBlurAmount(view, value == null ? 10f : ((Double) value).doubleValue());
|
|
30
|
+
break;
|
|
31
|
+
case "reducedTransparencyFallbackColor":
|
|
32
|
+
mViewManager.setReducedTransparencyFallbackColor(view, value == null ? null : (String) value);
|
|
33
|
+
break;
|
|
34
|
+
default:
|
|
35
|
+
super.setProperty(view, propName, value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GeneratePropsJavaInterface.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
package com.facebook.react.viewmanagers;
|
|
11
|
+
|
|
12
|
+
import android.view.View;
|
|
13
|
+
import androidx.annotation.Nullable;
|
|
14
|
+
import com.facebook.react.uimanager.ViewManagerWithGeneratedInterface;
|
|
15
|
+
|
|
16
|
+
public interface ReactNativeBlurViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
|
|
17
|
+
void setBlurType(T view, @Nullable String value);
|
|
18
|
+
void setBlurAmount(T view, double value);
|
|
19
|
+
void setReducedTransparencyFallbackColor(T view, @Nullable String value);
|
|
20
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/ReactNativeBlurViewSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_ReactNativeBlurViewSpec
|
|
13
|
+
OBJECT
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_ReactNativeBlurViewSpec PUBLIC . react/renderer/components/ReactNativeBlurViewSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_ReactNativeBlurViewSpec
|
|
21
|
+
fbjni
|
|
22
|
+
jsi
|
|
23
|
+
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
+
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
+
reactnative
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
target_compile_options(
|
|
29
|
+
react_codegen_ReactNativeBlurViewSpec
|
|
30
|
+
PRIVATE
|
|
31
|
+
-DLOG_TAG=\"ReactNative\"
|
|
32
|
+
-fexceptions
|
|
33
|
+
-frtti
|
|
34
|
+
-std=c++20
|
|
35
|
+
-Wall
|
|
36
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "ReactNativeBlurViewSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
std::shared_ptr<TurboModule> ReactNativeBlurViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
18
|
+
|
|
19
|
+
return nullptr;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
|
15
|
+
#include <jsi/jsi.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
JSI_EXPORT
|
|
22
|
+
std::shared_ptr<TurboModule> ReactNativeBlurViewSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h>
|
|
12
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
13
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
|
|
18
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry) {
|
|
19
|
+
registry->add(concreteComponentDescriptorProvider<ReactNativeBlurViewComponentDescriptor>());
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateComponentDescriptorH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h>
|
|
14
|
+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
|
|
15
|
+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
using ReactNativeBlurViewComponentDescriptor = ConcreteComponentDescriptor<ReactNativeBlurViewShadowNode>;
|
|
20
|
+
|
|
21
|
+
void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
|
|
22
|
+
std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
|
|
23
|
+
|
|
24
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
namespace facebook::react {
|
|
15
|
+
|
|
16
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateEventEmitterH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewEventEmitter.h>
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
class ReactNativeBlurViewEventEmitter : public ViewEventEmitter {
|
|
17
|
+
public:
|
|
18
|
+
using ViewEventEmitter::ViewEventEmitter;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
};
|
|
23
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/ReactNativeBlurViewSpec/Props.h>
|
|
12
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
13
|
+
#include <react/renderer/core/propsConversions.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
ReactNativeBlurViewProps::ReactNativeBlurViewProps(
|
|
18
|
+
const PropsParserContext &context,
|
|
19
|
+
const ReactNativeBlurViewProps &sourceProps,
|
|
20
|
+
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
|
+
|
|
22
|
+
blurType(convertRawProp(context, rawProps, "blurType", sourceProps.blurType, {ReactNativeBlurViewBlurType::Light})),
|
|
23
|
+
blurAmount(convertRawProp(context, rawProps, "blurAmount", sourceProps.blurAmount, {10.0})),
|
|
24
|
+
reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {}))
|
|
25
|
+
{}
|
|
26
|
+
|
|
27
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GeneratePropsH.js
|
|
9
|
+
*/
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <react/renderer/components/view/ViewProps.h>
|
|
13
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
enum class ReactNativeBlurViewBlurType { Xlight, Light, Dark, ExtraDark, Regular, Prominent, SystemUltraThinMaterial, SystemThinMaterial, SystemMaterial, SystemThickMaterial, SystemChromeMaterial };
|
|
18
|
+
|
|
19
|
+
static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewBlurType &result) {
|
|
20
|
+
auto string = (std::string)value;
|
|
21
|
+
if (string == "xlight") { result = ReactNativeBlurViewBlurType::Xlight; return; }
|
|
22
|
+
if (string == "light") { result = ReactNativeBlurViewBlurType::Light; return; }
|
|
23
|
+
if (string == "dark") { result = ReactNativeBlurViewBlurType::Dark; return; }
|
|
24
|
+
if (string == "extraDark") { result = ReactNativeBlurViewBlurType::ExtraDark; return; }
|
|
25
|
+
if (string == "regular") { result = ReactNativeBlurViewBlurType::Regular; return; }
|
|
26
|
+
if (string == "prominent") { result = ReactNativeBlurViewBlurType::Prominent; return; }
|
|
27
|
+
if (string == "systemUltraThinMaterial") { result = ReactNativeBlurViewBlurType::SystemUltraThinMaterial; return; }
|
|
28
|
+
if (string == "systemThinMaterial") { result = ReactNativeBlurViewBlurType::SystemThinMaterial; return; }
|
|
29
|
+
if (string == "systemMaterial") { result = ReactNativeBlurViewBlurType::SystemMaterial; return; }
|
|
30
|
+
if (string == "systemThickMaterial") { result = ReactNativeBlurViewBlurType::SystemThickMaterial; return; }
|
|
31
|
+
if (string == "systemChromeMaterial") { result = ReactNativeBlurViewBlurType::SystemChromeMaterial; return; }
|
|
32
|
+
abort();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static inline std::string toString(const ReactNativeBlurViewBlurType &value) {
|
|
36
|
+
switch (value) {
|
|
37
|
+
case ReactNativeBlurViewBlurType::Xlight: return "xlight";
|
|
38
|
+
case ReactNativeBlurViewBlurType::Light: return "light";
|
|
39
|
+
case ReactNativeBlurViewBlurType::Dark: return "dark";
|
|
40
|
+
case ReactNativeBlurViewBlurType::ExtraDark: return "extraDark";
|
|
41
|
+
case ReactNativeBlurViewBlurType::Regular: return "regular";
|
|
42
|
+
case ReactNativeBlurViewBlurType::Prominent: return "prominent";
|
|
43
|
+
case ReactNativeBlurViewBlurType::SystemUltraThinMaterial: return "systemUltraThinMaterial";
|
|
44
|
+
case ReactNativeBlurViewBlurType::SystemThinMaterial: return "systemThinMaterial";
|
|
45
|
+
case ReactNativeBlurViewBlurType::SystemMaterial: return "systemMaterial";
|
|
46
|
+
case ReactNativeBlurViewBlurType::SystemThickMaterial: return "systemThickMaterial";
|
|
47
|
+
case ReactNativeBlurViewBlurType::SystemChromeMaterial: return "systemChromeMaterial";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
class ReactNativeBlurViewProps final : public ViewProps {
|
|
52
|
+
public:
|
|
53
|
+
ReactNativeBlurViewProps() = default;
|
|
54
|
+
ReactNativeBlurViewProps(const PropsParserContext& context, const ReactNativeBlurViewProps &sourceProps, const RawProps &rawProps);
|
|
55
|
+
|
|
56
|
+
#pragma mark - Props
|
|
57
|
+
|
|
58
|
+
ReactNativeBlurViewBlurType blurType{ReactNativeBlurViewBlurType::Light};
|
|
59
|
+
double blurAmount{10.0};
|
|
60
|
+
std::string reducedTransparencyFallbackColor{};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "ReactNativeBlurViewSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateShadowNodeCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include <react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h>
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
extern const char ReactNativeBlurViewComponentName[] = "ReactNativeBlurView";
|
|
16
|
+
|
|
17
|
+
} // namespace facebook::react
|