@sbaiahmed1/react-native-blur 4.6.1 → 4.6.2-beta.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.
Files changed (25) hide show
  1. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerDelegate.java +53 -0
  2. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeBlurViewManagerInterface.java +25 -0
  3. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerDelegate.java +53 -0
  4. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassEffectContainerManagerInterface.java +25 -0
  5. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerDelegate.java +38 -0
  6. package/android/app/build/generated/source/codegen/java/com/facebook/react/viewmanagers/ReactNativeGlassViewManagerInterface.java +20 -0
  7. package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
  8. package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec-generated.cpp +22 -0
  9. package/android/app/build/generated/source/codegen/jni/ReactNativeBlurViewSpec.h +24 -0
  10. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.cpp +23 -0
  11. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ComponentDescriptors.h +25 -0
  12. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.cpp +17 -0
  13. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h +30 -0
  14. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.cpp +46 -0
  15. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/Props.h +131 -0
  16. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI-generated.cpp +17 -0
  17. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ReactNativeBlurViewSpecJSI.h +19 -0
  18. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.cpp +18 -0
  19. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/ShadowNodes.h +43 -0
  20. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.cpp +16 -0
  21. package/android/app/build/generated/source/codegen/jni/react/renderer/components/ReactNativeBlurViewSpec/States.h +41 -0
  22. package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeBlurView.kt +26 -8
  23. package/android/src/main/java/com/sbaiahmed1/reactnativeblur/ReactNativeProgressiveBlurView.kt +26 -8
  24. package/ios/Views/BlurEffectView.swift +32 -19
  25. package/package.json +1 -1
@@ -0,0 +1,53 @@
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 "glassTintColor":
26
+ mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
27
+ break;
28
+ case "glassOpacity":
29
+ mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
30
+ break;
31
+ case "blurAmount":
32
+ mViewManager.setBlurAmount(view, value == null ? 10f : ((Double) value).doubleValue());
33
+ break;
34
+ case "type":
35
+ mViewManager.setType(view, (String) value);
36
+ break;
37
+ case "blurType":
38
+ mViewManager.setBlurType(view, (String) value);
39
+ break;
40
+ case "glassType":
41
+ mViewManager.setGlassType(view, (String) value);
42
+ break;
43
+ case "reducedTransparencyFallbackColor":
44
+ mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
45
+ break;
46
+ case "isInteractive":
47
+ mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
48
+ break;
49
+ default:
50
+ super.setProperty(view, propName, value);
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,25 @@
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 setGlassTintColor(T view, @Nullable String value);
18
+ void setGlassOpacity(T view, double value);
19
+ void setBlurAmount(T view, double value);
20
+ void setType(T view, @Nullable String value);
21
+ void setBlurType(T view, @Nullable String value);
22
+ void setGlassType(T view, @Nullable String value);
23
+ void setReducedTransparencyFallbackColor(T view, @Nullable String value);
24
+ void setIsInteractive(T view, boolean value);
25
+ }
@@ -0,0 +1,53 @@
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 ReactNativeGlassEffectContainerManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeGlassEffectContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
+ public ReactNativeGlassEffectContainerManagerDelegate(U viewManager) {
20
+ super(viewManager);
21
+ }
22
+ @Override
23
+ public void setProperty(T view, String propName, @Nullable Object value) {
24
+ switch (propName) {
25
+ case "glassType":
26
+ mViewManager.setGlassType(view, (String) value);
27
+ break;
28
+ case "glassTintColor":
29
+ mViewManager.setGlassTintColor(view, value == null ? "clear" : (String) value);
30
+ break;
31
+ case "glassOpacity":
32
+ mViewManager.setGlassOpacity(view, value == null ? 1f : ((Double) value).doubleValue());
33
+ break;
34
+ case "isInteractive":
35
+ mViewManager.setIsInteractive(view, value == null ? true : (boolean) value);
36
+ break;
37
+ case "spacing":
38
+ mViewManager.setSpacing(view, value == null ? 8f : ((Double) value).doubleValue());
39
+ break;
40
+ case "enableMorphing":
41
+ mViewManager.setEnableMorphing(view, value == null ? true : (boolean) value);
42
+ break;
43
+ case "morphingDuration":
44
+ mViewManager.setMorphingDuration(view, value == null ? 300 : ((Double) value).intValue());
45
+ break;
46
+ case "reducedTransparencyFallbackColor":
47
+ mViewManager.setReducedTransparencyFallbackColor(view, value == null ? "#FFFFFF" : (String) value);
48
+ break;
49
+ default:
50
+ super.setProperty(view, propName, value);
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,25 @@
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 ReactNativeGlassEffectContainerManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
17
+ void setGlassType(T view, @Nullable String value);
18
+ void setGlassTintColor(T view, @Nullable String value);
19
+ void setGlassOpacity(T view, double value);
20
+ void setIsInteractive(T view, boolean value);
21
+ void setSpacing(T view, double value);
22
+ void setEnableMorphing(T view, boolean value);
23
+ void setMorphingDuration(T view, int value);
24
+ void setReducedTransparencyFallbackColor(T view, @Nullable String value);
25
+ }
@@ -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 ReactNativeGlassViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ReactNativeGlassViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
19
+ public ReactNativeGlassViewManagerDelegate(U viewManager) {
20
+ super(viewManager);
21
+ }
22
+ @Override
23
+ public void setProperty(T view, String propName, @Nullable Object value) {
24
+ switch (propName) {
25
+ case "glassType":
26
+ mViewManager.setGlassType(view, (String) value);
27
+ break;
28
+ case "glassAmount":
29
+ mViewManager.setGlassAmount(view, value == null ? 50f : ((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 ReactNativeGlassViewManagerInterface<T extends View> extends ViewManagerWithGeneratedInterface {
17
+ void setGlassType(T view, @Nullable String value);
18
+ void setGlassAmount(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 &params) {
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 &params);
23
+
24
+ } // 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: 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
+ registry->add(concreteComponentDescriptorProvider<ReactNativeGlassEffectContainerComponentDescriptor>());
21
+ }
22
+
23
+ } // namespace facebook::react
@@ -0,0 +1,25 @@
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
+ using ReactNativeGlassEffectContainerComponentDescriptor = ConcreteComponentDescriptor<ReactNativeGlassEffectContainerShadowNode>;
21
+
22
+ void ReactNativeBlurViewSpec_registerComponentDescriptorsFromCodegen(
23
+ std::shared_ptr<const ComponentDescriptorProviderRegistry> registry);
24
+
25
+ } // 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: GenerateEventEmitterCpp.js
9
+ */
10
+
11
+ #include <react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h>
12
+
13
+
14
+ namespace facebook::react {
15
+
16
+
17
+ } // namespace facebook::react
@@ -0,0 +1,30 @@
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
+ class ReactNativeGlassEffectContainerEventEmitter : public ViewEventEmitter {
24
+ public:
25
+ using ViewEventEmitter::ViewEventEmitter;
26
+
27
+
28
+
29
+ };
30
+ } // namespace facebook::react
@@ -0,0 +1,46 @@
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
+ glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
23
+ glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
24
+ blurAmount(convertRawProp(context, rawProps, "blurAmount", sourceProps.blurAmount, {10.0})),
25
+ type(convertRawProp(context, rawProps, "type", sourceProps.type, {ReactNativeBlurViewType::Blur})),
26
+ blurType(convertRawProp(context, rawProps, "blurType", sourceProps.blurType, {ReactNativeBlurViewBlurType::Xlight})),
27
+ glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeBlurViewGlassType::Clear})),
28
+ reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"})),
29
+ isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true}))
30
+ {}
31
+ ReactNativeGlassEffectContainerProps::ReactNativeGlassEffectContainerProps(
32
+ const PropsParserContext &context,
33
+ const ReactNativeGlassEffectContainerProps &sourceProps,
34
+ const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
35
+
36
+ glassType(convertRawProp(context, rawProps, "glassType", sourceProps.glassType, {ReactNativeGlassEffectContainerGlassType::Clear})),
37
+ glassTintColor(convertRawProp(context, rawProps, "glassTintColor", sourceProps.glassTintColor, {"clear"})),
38
+ glassOpacity(convertRawProp(context, rawProps, "glassOpacity", sourceProps.glassOpacity, {1.0})),
39
+ isInteractive(convertRawProp(context, rawProps, "isInteractive", sourceProps.isInteractive, {true})),
40
+ spacing(convertRawProp(context, rawProps, "spacing", sourceProps.spacing, {8.0})),
41
+ enableMorphing(convertRawProp(context, rawProps, "enableMorphing", sourceProps.enableMorphing, {true})),
42
+ morphingDuration(convertRawProp(context, rawProps, "morphingDuration", sourceProps.morphingDuration, {300})),
43
+ reducedTransparencyFallbackColor(convertRawProp(context, rawProps, "reducedTransparencyFallbackColor", sourceProps.reducedTransparencyFallbackColor, {"#FFFFFF"}))
44
+ {}
45
+
46
+ } // namespace facebook::react
@@ -0,0 +1,131 @@
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 ReactNativeBlurViewType { Blur, LiquidGlass };
18
+
19
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewType &result) {
20
+ auto string = (std::string)value;
21
+ if (string == "blur") { result = ReactNativeBlurViewType::Blur; return; }
22
+ if (string == "liquidGlass") { result = ReactNativeBlurViewType::LiquidGlass; return; }
23
+ abort();
24
+ }
25
+
26
+ static inline std::string toString(const ReactNativeBlurViewType &value) {
27
+ switch (value) {
28
+ case ReactNativeBlurViewType::Blur: return "blur";
29
+ case ReactNativeBlurViewType::LiquidGlass: return "liquidGlass";
30
+ }
31
+ }
32
+ enum class ReactNativeBlurViewBlurType { Xlight, Light, Dark, ExtraDark, Regular, Prominent, SystemUltraThinMaterial, SystemThinMaterial, SystemMaterial, SystemThickMaterial, SystemChromeMaterial };
33
+
34
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewBlurType &result) {
35
+ auto string = (std::string)value;
36
+ if (string == "xlight") { result = ReactNativeBlurViewBlurType::Xlight; return; }
37
+ if (string == "light") { result = ReactNativeBlurViewBlurType::Light; return; }
38
+ if (string == "dark") { result = ReactNativeBlurViewBlurType::Dark; return; }
39
+ if (string == "extraDark") { result = ReactNativeBlurViewBlurType::ExtraDark; return; }
40
+ if (string == "regular") { result = ReactNativeBlurViewBlurType::Regular; return; }
41
+ if (string == "prominent") { result = ReactNativeBlurViewBlurType::Prominent; return; }
42
+ if (string == "systemUltraThinMaterial") { result = ReactNativeBlurViewBlurType::SystemUltraThinMaterial; return; }
43
+ if (string == "systemThinMaterial") { result = ReactNativeBlurViewBlurType::SystemThinMaterial; return; }
44
+ if (string == "systemMaterial") { result = ReactNativeBlurViewBlurType::SystemMaterial; return; }
45
+ if (string == "systemThickMaterial") { result = ReactNativeBlurViewBlurType::SystemThickMaterial; return; }
46
+ if (string == "systemChromeMaterial") { result = ReactNativeBlurViewBlurType::SystemChromeMaterial; return; }
47
+ abort();
48
+ }
49
+
50
+ static inline std::string toString(const ReactNativeBlurViewBlurType &value) {
51
+ switch (value) {
52
+ case ReactNativeBlurViewBlurType::Xlight: return "xlight";
53
+ case ReactNativeBlurViewBlurType::Light: return "light";
54
+ case ReactNativeBlurViewBlurType::Dark: return "dark";
55
+ case ReactNativeBlurViewBlurType::ExtraDark: return "extraDark";
56
+ case ReactNativeBlurViewBlurType::Regular: return "regular";
57
+ case ReactNativeBlurViewBlurType::Prominent: return "prominent";
58
+ case ReactNativeBlurViewBlurType::SystemUltraThinMaterial: return "systemUltraThinMaterial";
59
+ case ReactNativeBlurViewBlurType::SystemThinMaterial: return "systemThinMaterial";
60
+ case ReactNativeBlurViewBlurType::SystemMaterial: return "systemMaterial";
61
+ case ReactNativeBlurViewBlurType::SystemThickMaterial: return "systemThickMaterial";
62
+ case ReactNativeBlurViewBlurType::SystemChromeMaterial: return "systemChromeMaterial";
63
+ }
64
+ }
65
+ enum class ReactNativeBlurViewGlassType { Clear, Regular };
66
+
67
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeBlurViewGlassType &result) {
68
+ auto string = (std::string)value;
69
+ if (string == "clear") { result = ReactNativeBlurViewGlassType::Clear; return; }
70
+ if (string == "regular") { result = ReactNativeBlurViewGlassType::Regular; return; }
71
+ abort();
72
+ }
73
+
74
+ static inline std::string toString(const ReactNativeBlurViewGlassType &value) {
75
+ switch (value) {
76
+ case ReactNativeBlurViewGlassType::Clear: return "clear";
77
+ case ReactNativeBlurViewGlassType::Regular: return "regular";
78
+ }
79
+ }
80
+
81
+ class ReactNativeBlurViewProps final : public ViewProps {
82
+ public:
83
+ ReactNativeBlurViewProps() = default;
84
+ ReactNativeBlurViewProps(const PropsParserContext& context, const ReactNativeBlurViewProps &sourceProps, const RawProps &rawProps);
85
+
86
+ #pragma mark - Props
87
+
88
+ std::string glassTintColor{"clear"};
89
+ double glassOpacity{1.0};
90
+ double blurAmount{10.0};
91
+ ReactNativeBlurViewType type{ReactNativeBlurViewType::Blur};
92
+ ReactNativeBlurViewBlurType blurType{ReactNativeBlurViewBlurType::Xlight};
93
+ ReactNativeBlurViewGlassType glassType{ReactNativeBlurViewGlassType::Clear};
94
+ std::string reducedTransparencyFallbackColor{"#FFFFFF"};
95
+ bool isInteractive{true};
96
+ };
97
+
98
+ enum class ReactNativeGlassEffectContainerGlassType { Clear, Regular };
99
+
100
+ static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, ReactNativeGlassEffectContainerGlassType &result) {
101
+ auto string = (std::string)value;
102
+ if (string == "clear") { result = ReactNativeGlassEffectContainerGlassType::Clear; return; }
103
+ if (string == "regular") { result = ReactNativeGlassEffectContainerGlassType::Regular; return; }
104
+ abort();
105
+ }
106
+
107
+ static inline std::string toString(const ReactNativeGlassEffectContainerGlassType &value) {
108
+ switch (value) {
109
+ case ReactNativeGlassEffectContainerGlassType::Clear: return "clear";
110
+ case ReactNativeGlassEffectContainerGlassType::Regular: return "regular";
111
+ }
112
+ }
113
+
114
+ class ReactNativeGlassEffectContainerProps final : public ViewProps {
115
+ public:
116
+ ReactNativeGlassEffectContainerProps() = default;
117
+ ReactNativeGlassEffectContainerProps(const PropsParserContext& context, const ReactNativeGlassEffectContainerProps &sourceProps, const RawProps &rawProps);
118
+
119
+ #pragma mark - Props
120
+
121
+ ReactNativeGlassEffectContainerGlassType glassType{ReactNativeGlassEffectContainerGlassType::Clear};
122
+ std::string glassTintColor{"clear"};
123
+ double glassOpacity{1.0};
124
+ bool isInteractive{true};
125
+ double spacing{8.0};
126
+ bool enableMorphing{true};
127
+ int morphingDuration{300};
128
+ std::string reducedTransparencyFallbackColor{"#FFFFFF"};
129
+ };
130
+
131
+ } // 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,18 @@
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
+ extern const char ReactNativeGlassEffectContainerComponentName[] = "ReactNativeGlassEffectContainer";
17
+
18
+ } // namespace facebook::react
@@ -0,0 +1,43 @@
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: GenerateShadowNodeH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <react/renderer/components/ReactNativeBlurViewSpec/EventEmitters.h>
14
+ #include <react/renderer/components/ReactNativeBlurViewSpec/Props.h>
15
+ #include <react/renderer/components/ReactNativeBlurViewSpec/States.h>
16
+ #include <react/renderer/components/view/ConcreteViewShadowNode.h>
17
+ #include <jsi/jsi.h>
18
+
19
+ namespace facebook::react {
20
+
21
+ JSI_EXPORT extern const char ReactNativeBlurViewComponentName[];
22
+
23
+ /*
24
+ * `ShadowNode` for <ReactNativeBlurView> component.
25
+ */
26
+ using ReactNativeBlurViewShadowNode = ConcreteViewShadowNode<
27
+ ReactNativeBlurViewComponentName,
28
+ ReactNativeBlurViewProps,
29
+ ReactNativeBlurViewEventEmitter,
30
+ ReactNativeBlurViewState>;
31
+
32
+ JSI_EXPORT extern const char ReactNativeGlassEffectContainerComponentName[];
33
+
34
+ /*
35
+ * `ShadowNode` for <ReactNativeGlassEffectContainer> component.
36
+ */
37
+ using ReactNativeGlassEffectContainerShadowNode = ConcreteViewShadowNode<
38
+ ReactNativeGlassEffectContainerComponentName,
39
+ ReactNativeGlassEffectContainerProps,
40
+ ReactNativeGlassEffectContainerEventEmitter,
41
+ ReactNativeGlassEffectContainerState>;
42
+
43
+ } // 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: GenerateStateCpp.js
9
+ */
10
+ #include <react/renderer/components/ReactNativeBlurViewSpec/States.h>
11
+
12
+ namespace facebook::react {
13
+
14
+
15
+
16
+ } // namespace facebook::react
@@ -0,0 +1,41 @@
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: GenerateStateH.js
8
+ */
9
+ #pragma once
10
+
11
+ #ifdef ANDROID
12
+ #include <folly/dynamic.h>
13
+ #endif
14
+
15
+ namespace facebook::react {
16
+
17
+ class ReactNativeBlurViewState {
18
+ public:
19
+ ReactNativeBlurViewState() = default;
20
+
21
+ #ifdef ANDROID
22
+ ReactNativeBlurViewState(ReactNativeBlurViewState const &previousState, folly::dynamic data){};
23
+ folly::dynamic getDynamic() const {
24
+ return {};
25
+ };
26
+ #endif
27
+ };
28
+
29
+ class ReactNativeGlassEffectContainerState {
30
+ public:
31
+ ReactNativeGlassEffectContainerState() = default;
32
+
33
+ #ifdef ANDROID
34
+ ReactNativeGlassEffectContainerState(ReactNativeGlassEffectContainerState const &previousState, folly::dynamic data){};
35
+ folly::dynamic getDynamic() const {
36
+ return {};
37
+ };
38
+ #endif
39
+ };
40
+
41
+ } // namespace facebook::react
@@ -187,16 +187,18 @@ class ReactNativeBlurView : BlurViewGroup {
187
187
  /**
188
188
  * Finds the optimal view to use as blur capture root.
189
189
  *
190
- * Returns the nearest react-native-screens Screen ancestor if found, which scopes
191
- * the blur to the current screen and prevents capturing navigation transitions.
192
- *
193
- * Returns null when no Screen ancestor exists (e.g. modals, standalone usage).
194
- * A null return means swapBlurRootToScreenAncestor() is a no-op and QmBlurView
195
- * keeps its default decor view as the blur root this is correct for modals
196
- * because they need to blur the content behind them (in the main activity window).
190
+ * Priority:
191
+ * 1. Nearest react-native-screens Screen ancestor scopes blur to the current
192
+ * screen and prevents capturing navigation transition artifacts.
193
+ * 2. Nearest ReactRootView ancestor scopes blur to the React Native root when
194
+ * the component is not inside a Screen (e.g. plain View hierarchies). Without
195
+ * this fallback, QmBlurView defaults to the activity decor view and blurs the
196
+ * entire screen instead of just the component area (issue #89).
197
+ * 3. null — returned for modals, which intentionally need to blur content from
198
+ * the main activity window (decor view is correct there).
197
199
  */
198
200
  private fun findOptimalBlurRoot(): ViewGroup? {
199
- return findNearestScreenAncestor()
201
+ return findNearestScreenAncestor() ?: findNearestReactRootView()
200
202
  }
201
203
 
202
204
  /**
@@ -214,6 +216,22 @@ class ReactNativeBlurView : BlurViewGroup {
214
216
  return null
215
217
  }
216
218
 
219
+ /**
220
+ * Walks up the view hierarchy looking for the React Native root view.
221
+ * Used as a fallback when no Screen ancestor exists, to scope the blur
222
+ * capture to the RN root rather than the full activity decor view.
223
+ */
224
+ private fun findNearestReactRootView(): ViewGroup? {
225
+ var currentParent = this.parent
226
+ while (currentParent != null) {
227
+ if (currentParent.javaClass.name == "com.facebook.react.ReactRootView") {
228
+ return currentParent as? ViewGroup
229
+ }
230
+ currentParent = currentParent.parent
231
+ }
232
+ return null
233
+ }
234
+
217
235
  /**
218
236
  * Initialize the blur view with current settings.
219
237
  * Called after the view is attached and the blur root has been swapped.
@@ -209,16 +209,18 @@ class ReactNativeProgressiveBlurView : FrameLayout {
209
209
  /**
210
210
  * Finds the optimal view to use as blur capture root.
211
211
  *
212
- * Returns the nearest react-native-screens Screen ancestor if found, which scopes
213
- * the blur to the current screen and prevents capturing navigation transitions.
214
- *
215
- * Returns null when no Screen ancestor exists (e.g. modals, standalone usage).
216
- * A null return means swapBlurRootToScreenAncestor() is a no-op and QmBlurView
217
- * keeps its default decor view as the blur root this is correct for modals
218
- * because they need to blur the content behind them (in the main activity window).
212
+ * Priority:
213
+ * 1. Nearest react-native-screens Screen ancestor scopes blur to the current
214
+ * screen and prevents capturing navigation transition artifacts.
215
+ * 2. Nearest ReactRootView ancestor scopes blur to the React Native root when
216
+ * the component is not inside a Screen (e.g. plain View hierarchies). Without
217
+ * this fallback, QmBlurView defaults to the activity decor view and blurs the
218
+ * entire screen instead of just the component area (issue #89).
219
+ * 3. null — returned for modals, which intentionally need to blur content from
220
+ * the main activity window (decor view is correct there).
219
221
  */
220
222
  private fun findOptimalBlurRoot(): ViewGroup? {
221
- return findNearestScreenAncestor()
223
+ return findNearestScreenAncestor() ?: findNearestReactRootView()
222
224
  }
223
225
 
224
226
  /**
@@ -235,6 +237,22 @@ class ReactNativeProgressiveBlurView : FrameLayout {
235
237
  return null
236
238
  }
237
239
 
240
+ /**
241
+ * Walks up the view hierarchy looking for the React Native root view.
242
+ * Used as a fallback when no Screen ancestor exists, to scope the blur
243
+ * capture to the RN root rather than the full activity decor view.
244
+ */
245
+ private fun findNearestReactRootView(): ViewGroup? {
246
+ var currentParent = this.parent
247
+ while (currentParent != null) {
248
+ if (currentParent.javaClass.name == "com.facebook.react.ReactRootView") {
249
+ return currentParent as? ViewGroup
250
+ }
251
+ currentParent = currentParent.parent
252
+ }
253
+ return null
254
+ }
255
+
238
256
  override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
239
257
  val width = MeasureSpec.getSize(widthMeasureSpec)
240
258
  val height = MeasureSpec.getSize(heightMeasureSpec)
@@ -21,41 +21,54 @@ class BlurEffectView: UIVisualEffectView {
21
21
  }
22
22
 
23
23
  func updateBlur(style: UIBlurEffect.Style, intensity: Double) {
24
+ // Skip expensive animator recreation when nothing changed.
25
+ // During FlashList recycling, updateUIView fires on every layout pass
26
+ // even when props are identical, causing jank (issue #100).
27
+ guard style != self.blurStyle || intensity != self.intensity else { return }
24
28
  self.blurStyle = style
25
29
  self.intensity = intensity
26
30
  setupBlur()
27
31
  }
28
32
 
33
+ override func didMoveToWindow() {
34
+ super.didMoveToWindow()
35
+ guard window != nil else { return }
36
+ // UIKit resumes paused CAAnimations when a view re-joins a window
37
+ // (e.g. after modal dismiss + re-present). If the animation plays
38
+ // toward its end state the blur drifts to full intensity. Re-pause
39
+ // and re-set the fraction here to lock it back to our intended value.
40
+ // pausesOnCompletion = true (set in setupBlur) ensures the animator
41
+ // stays .active even if it reaches fraction 1.0, so this is always safe.
42
+ animator?.pauseAnimation()
43
+ animator?.fractionComplete = intensity
44
+ }
45
+
29
46
  private func setupBlur() {
30
- // Clean up existing animator
31
- if let animator = animator {
32
- animator.stopAnimation(true)
33
- animator.finishAnimation(at: .current)
47
+ if let existing = animator, existing.state == .active {
48
+ existing.stopAnimation(true)
34
49
  }
35
50
  animator = nil
36
51
 
37
- // Reset effect
38
52
  effect = nil
39
53
 
40
- // Create new animator
41
- animator = UIViewPropertyAnimator(duration: 1, curve: .linear)
42
- animator?.addAnimations { [weak self] in
54
+ let newAnimator = UIViewPropertyAnimator(duration: 1, curve: .linear)
55
+ newAnimator.addAnimations { [weak self] in
43
56
  self?.effect = UIBlurEffect(style: self?.blurStyle ?? .systemMaterial)
44
57
  }
45
-
46
- // Set intensity
47
- animator?.fractionComplete = intensity
48
- // Stop the animation at the current state
49
- DispatchQueue.main.async { [weak self] in
50
- self?.animator?.stopAnimation(true)
51
- self?.animator?.finishAnimation(at: .current)
52
- }
58
+ // pausesOnCompletion: if UIKit ever resumes and runs this to the end,
59
+ // the animator stays .active (paused at 1.0) instead of going .inactive.
60
+ // This guarantees didMoveToWindow can always call pauseAnimation() safely.
61
+ newAnimator.pausesOnCompletion = true
62
+ newAnimator.startAnimation()
63
+ newAnimator.pauseAnimation()
64
+ newAnimator.fractionComplete = intensity
65
+ animator = newAnimator
53
66
  }
54
67
 
55
68
  deinit {
56
- guard let animator = animator, animator.state == .active else { return }
57
- animator.stopAnimation(true)
58
- animator.finishAnimation(at: .current)
69
+ if let animator = animator, animator.state == .active {
70
+ animator.stopAnimation(true)
71
+ }
59
72
  }
60
73
  }
61
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sbaiahmed1/react-native-blur",
3
- "version": "4.6.1",
3
+ "version": "4.6.2-beta.0",
4
4
  "description": "React native modern blur view",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",