react-native-navigation 7.41.0-test01 → 7.42.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 (42) hide show
  1. package/lib/Mock/Components/ComponentScreen.tsx +29 -15
  2. package/lib/Mock/Components/LayoutComponent.tsx +2 -2
  3. package/lib/Mock/index.js +2 -2
  4. package/lib/android/app/build.gradle +1 -0
  5. package/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java +7 -1
  6. package/lib/android/app/src/main/java/com/reactnativenavigation/react/ReactView.java +3 -3
  7. package/lib/android/app/src/main/java/com/reactnativenavigation/react/modal/ModalHostLayout.kt +1 -1
  8. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java +3 -2
  9. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt +4 -2
  10. package/lib/android/app/src/main/java/com/reactnativenavigation/utils/ViewUtils.java +6 -4
  11. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt +8 -4
  12. package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/RootPresenter.java +1 -1
  13. package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/BackgroundColorAnimator.kt +6 -4
  14. package/lib/android/app/src/main/java/com/reactnativenavigation/views/element/animators/BackgroundColorEvaluator.kt +4 -2
  15. package/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt +6 -6
  16. package/lib/dist/Mock/Application.d.ts +4 -6
  17. package/lib/dist/Mock/Components/BottomTabs.d.ts +9 -13
  18. package/lib/dist/Mock/Components/ComponentScreen.d.ts +5 -7
  19. package/lib/dist/Mock/Components/ComponentScreen.js +10 -3
  20. package/lib/dist/Mock/Components/LayoutComponent.d.ts +9 -13
  21. package/lib/dist/Mock/Components/Modals.d.ts +9 -13
  22. package/lib/dist/Mock/Components/NavigationButton.d.ts +11 -15
  23. package/lib/dist/Mock/Components/Overlays.d.ts +9 -13
  24. package/lib/dist/Mock/Components/Stack.d.ts +9 -13
  25. package/lib/dist/Mock/Components/TopBar.d.ts +7 -9
  26. package/lib/dist/Mock/connect.js +2 -1
  27. package/lib/dist/Mock/index.js +2 -2
  28. package/lib/dist/src/adapters/NativeEventsReceiver.js +1 -1
  29. package/lib/dist/src/adapters/TouchablePreview.d.ts +2 -2
  30. package/lib/dist/src/commands/LayoutType.js +1 -1
  31. package/lib/dist/src/components/Modal.d.ts +1 -1
  32. package/lib/dist/src/interfaces/CommandName.js +1 -1
  33. package/lib/dist/src/interfaces/Options.js +2 -2
  34. package/lib/dist/src/types.d.ts +1 -0
  35. package/lib/ios/BottomTabsBasePresenter.m +3 -2
  36. package/lib/ios/RNNAppDelegate.mm +1 -2
  37. package/lib/ios/RNNConvert.h +3 -0
  38. package/lib/ios/RNNConvert.m +9 -0
  39. package/lib/ios/RNNStackPresenter.m +3 -2
  40. package/lib/src/adapters/NativeEventsReceiver.ts +3 -3
  41. package/lib/src/adapters/TouchablePreview.tsx +3 -3
  42. package/package.json +37 -31
@@ -1,6 +1,6 @@
1
1
  import React, { Component } from 'react';
2
- import { View, Text, TouchableOpacity, Image, ImageURISource} from 'react-native';
3
- import { Navigation, ImageResource} from 'react-native-navigation';
2
+ import { View, Text, TouchableOpacity, Image, ImageURISource } from 'react-native';
3
+ import { Navigation, ImageResource } from 'react-native-navigation';
4
4
  import { ComponentProps } from '../ComponentProps';
5
5
  import { VISIBLE_SCREEN_TEST_ID } from '../constants';
6
6
  import { LayoutStore } from '../Stores/LayoutStore';
@@ -10,8 +10,7 @@ import { events } from '../Stores/EventsStore';
10
10
  import _ from 'lodash';
11
11
  import { switchTabByIndex } from '../actions/layoutActions';
12
12
 
13
-
14
- function isURISource(src: ImageResource| undefined): src is ImageURISource {
13
+ function isURISource(src: ImageResource | undefined): src is ImageURISource {
15
14
  return !!src && typeof src === 'object' && 'uri' in src;
16
15
  }
17
16
 
@@ -36,12 +35,15 @@ export const ComponentScreen = connect(
36
35
  if (bottomTabsOptions?.visible === false) return null;
37
36
  const buttons = bottomTabs!.children!.map((child, i) => {
38
37
  const bottomTabOptions = child.resolveOptions().bottomTab;
39
- const icon = (bottomTabs as any).selectedIndex === i ? bottomTabOptions?.selectedIcon : bottomTabOptions?.icon;
38
+ const icon =
39
+ (bottomTabs as any).selectedIndex === i
40
+ ? bottomTabOptions?.selectedIcon
41
+ : bottomTabOptions?.icon;
40
42
  const iconURI = isURISource(icon) ? icon.uri : undefined;
41
43
  return (
42
44
  <View key={`tab-${i}`}>
43
45
  <TouchableOpacity
44
- style={{padding:10}}
46
+ style={{ padding: 10 }}
45
47
  testID={bottomTabOptions?.testID}
46
48
  onPress={() => {
47
49
  events.invokeBottomTabPressed({
@@ -51,22 +53,34 @@ export const ComponentScreen = connect(
51
53
  switchTabByIndex(this.props.layoutNode.getBottomTabs(), i);
52
54
  }}
53
55
  >
54
- <View style={{justifyContent: 'center', alignItems: 'center'}}>
55
- <Text>{bottomTabOptions?.badge}</Text>
56
- {iconURI && <Image style={{width: 18, height: 18, marginBottom: 5}} source={{uri: iconURI}}/>}
57
- <Text style={{fontSize: 12}}>{bottomTabOptions?.text || ''}</Text>
58
- </View>
56
+ <View style={{ justifyContent: 'center', alignItems: 'center' }}>
57
+ <Text>{bottomTabOptions?.badge}</Text>
58
+ {iconURI && (
59
+ <Image
60
+ style={{ width: 18, height: 18, marginBottom: 5 }}
61
+ source={{ uri: iconURI }}
62
+ />
63
+ )}
64
+ <Text style={{ fontSize: 12 }}>{bottomTabOptions?.text || ''}</Text>
65
+ </View>
59
66
  </TouchableOpacity>
60
67
  </View>
61
68
  );
62
69
  });
63
70
 
64
71
  return (
65
- <View
66
- testID={bottomTabsOptions?.testID}
67
- style={{flexDirection: 'row',justifyContent: 'center', width: '100%', backgroundColor: '#F0F2F5'}}>
72
+ <View
73
+ testID={bottomTabsOptions?.testID}
74
+ style={{
75
+ flexDirection: 'row',
76
+ justifyContent: 'center',
77
+ width: '100%',
78
+ backgroundColor: '#F0F2F5',
79
+ }}
80
+ >
68
81
  {buttons}
69
- </View>);
82
+ </View>
83
+ );
70
84
  }
71
85
 
72
86
  render() {
@@ -19,8 +19,8 @@ export const LayoutComponent = class extends Component<ComponentProps> {
19
19
  return <View />;
20
20
  }
21
21
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
22
- const err = new Error(
23
- `Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`,
22
+ const err = new Error(
23
+ `Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`
24
24
  );
25
25
  (err as any).cause = error;
26
26
  throw err;
package/lib/Mock/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationMock = void 0;
4
- exports.mockNativeComponents = mockNativeComponents;
3
+ exports.mockNativeComponents = exports.ApplicationMock = void 0;
5
4
  const tslib_1 = require("tslib");
6
5
  exports.ApplicationMock = require('./Application').Application;
7
6
  tslib_1.__exportStar(require("./constants"), exports);
@@ -12,3 +11,4 @@ function mockNativeComponents() {
12
11
  const { Navigation } = require('react-native-navigation');
13
12
  Navigation.mockNativeComponents(new NativeCommandsSender(), new NativeEventsReceiver(), new AppRegistryService());
14
13
  }
14
+ exports.mockNativeComponents = mockNativeComponents;
@@ -20,6 +20,7 @@ def DEFAULT_KOTLIN_STDLIB = 'kotlin-stdlib-jdk8'
20
20
  def kotlinVersion = safeExtGet("RNNKotlinVersion", DEFAULT_KOTLIN_VERSION)
21
21
  def kotlinStdlib = safeExtGet('RNNKotlinStdlib',DEFAULT_KOTLIN_STDLIB )
22
22
  def kotlinCoroutinesCore = safeExtGet('RNNKotlinCoroutinesCore', '1.5.2')
23
+
23
24
  android {
24
25
  namespace 'com.reactnativenavigation'
25
26
  compileSdkVersion safeExtGetFallbackLowerBound('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
@@ -4,10 +4,12 @@ import android.app.Application;
4
4
 
5
5
  import com.facebook.react.ReactApplication;
6
6
  import com.facebook.react.ReactNativeHost;
7
+ import com.facebook.react.soloader.OpenSourceMergedSoMapping;
7
8
  import com.facebook.soloader.SoLoader;
8
9
  import com.reactnativenavigation.react.ReactGateway;
9
10
  import com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentCreator;
10
11
 
12
+ import java.io.IOException;
11
13
  import java.util.HashMap;
12
14
  import java.util.Map;
13
15
 
@@ -23,7 +25,11 @@ public abstract class NavigationApplication extends Application implements React
23
25
  public void onCreate() {
24
26
  super.onCreate();
25
27
  instance = this;
26
- SoLoader.init(this, false);
28
+ try {
29
+ SoLoader.init(this, OpenSourceMergedSoMapping.INSTANCE);
30
+ } catch (IOException e) {
31
+ throw new RuntimeException(e);
32
+ }
27
33
  reactGateway = createReactGateway();
28
34
  }
29
35
 
@@ -5,6 +5,8 @@ import android.content.Context;
5
5
  import android.os.Bundle;
6
6
  import android.view.MotionEvent;
7
7
 
8
+ import androidx.annotation.RestrictTo;
9
+
8
10
  import com.facebook.react.ReactInstanceManager;
9
11
  import com.facebook.react.ReactRootView;
10
12
  import com.facebook.react.bridge.ReactContext;
@@ -12,14 +14,12 @@ import com.facebook.react.config.ReactFeatureFlags;
12
14
  import com.facebook.react.uimanager.JSTouchDispatcher;
13
15
  import com.facebook.react.uimanager.UIManagerModule;
14
16
  import com.facebook.react.uimanager.events.EventDispatcher;
15
- import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
16
17
  import com.reactnativenavigation.react.events.ComponentType;
17
18
  import com.reactnativenavigation.react.events.EventEmitter;
18
19
  import com.reactnativenavigation.viewcontrollers.viewcontroller.IReactView;
20
+ import com.reactnativenavigation.viewcontrollers.viewcontroller.ScrollEventListener;
19
21
  import com.reactnativenavigation.views.component.Renderable;
20
22
 
21
- import androidx.annotation.RestrictTo;
22
-
23
23
  @SuppressLint("ViewConstructor")
24
24
  public class ReactView extends ReactRootView implements IReactView, Renderable {
25
25
 
@@ -34,7 +34,7 @@ open class ModalHostLayout(reactContext: ThemedReactContext) : ViewGroup(reactCo
34
34
  }
35
35
 
36
36
  @TargetApi(23)
37
- override fun dispatchProvideStructure(structure: ViewStructure?) {
37
+ override fun dispatchProvideStructure(structure: ViewStructure) {
38
38
  mHostView.dispatchProvideStructure(structure)
39
39
  }
40
40
 
@@ -18,6 +18,7 @@ import android.graphics.Typeface;
18
18
  import android.text.TextUtils;
19
19
  import androidx.annotation.Nullable;
20
20
  import com.facebook.react.bridge.ReadableArray;
21
+ import com.facebook.react.common.ReactConstants;
21
22
  import com.facebook.react.views.text.ReactFontManager;
22
23
  import com.facebook.react.views.text.ReactTextShadowNode;
23
24
  import java.util.ArrayList;
@@ -96,12 +97,12 @@ public class ReactTypefaceUtils {
96
97
 
97
98
  int want = 0;
98
99
  if ((weight == Typeface.BOLD)
99
- || ((oldStyle & Typeface.BOLD) != 0 && weight == ReactTextShadowNode.UNSET)) {
100
+ || ((oldStyle & Typeface.BOLD) != 0 && weight == ReactConstants.UNSET)) {
100
101
  want |= Typeface.BOLD;
101
102
  }
102
103
 
103
104
  if ((style == Typeface.ITALIC)
104
- || ((oldStyle & Typeface.ITALIC) != 0 && style == ReactTextShadowNode.UNSET)) {
105
+ || ((oldStyle & Typeface.ITALIC) != 0 && style == ReactConstants.UNSET)) {
105
106
  want |= Typeface.ITALIC;
106
107
  }
107
108
 
@@ -1,7 +1,9 @@
1
1
  package com.reactnativenavigation.utils
2
2
 
3
- import com.facebook.react.views.view.ReactViewBackgroundDrawable
3
+ import com.facebook.react.common.annotations.UnstableReactNativeAPI
4
+ import com.facebook.react.uimanager.drawable.CSSBackgroundDrawable
4
5
  import com.facebook.react.views.view.ReactViewGroup
5
6
 
7
+ @OptIn(UnstableReactNativeAPI::class)
6
8
  val ReactViewGroup.borderRadius: Float
7
- get() = (background as? ReactViewBackgroundDrawable)?.fullBorderRadius ?: 0f
9
+ get() = (background as? CSSBackgroundDrawable)?.fullBorderWidth ?: 0f
@@ -5,8 +5,6 @@ import android.view.View;
5
5
  import android.view.ViewGroup;
6
6
  import android.view.ViewParent;
7
7
 
8
- import com.facebook.react.views.view.ReactViewBackgroundDrawable;
9
-
10
8
  import java.util.ArrayList;
11
9
  import java.util.List;
12
10
 
@@ -14,6 +12,9 @@ import androidx.annotation.Nullable;
14
12
 
15
13
  import static com.reactnativenavigation.utils.ObjectUtils.perform;
16
14
 
15
+ import com.facebook.react.common.annotations.UnstableReactNativeAPI;
16
+ import com.facebook.react.uimanager.drawable.CSSBackgroundDrawable;
17
+
17
18
  public class ViewUtils {
18
19
  @Nullable
19
20
  public static <T extends View> T findChildByClass(ViewGroup root, Class<T> clazz) {
@@ -107,9 +108,10 @@ public class ViewUtils {
107
108
  return ((ViewGroup) parent).indexOfChild(view);
108
109
  }
109
110
 
111
+ @UnstableReactNativeAPI
110
112
  public static int getBackgroundColor(View view) {
111
- if (view.getBackground() instanceof ReactViewBackgroundDrawable) {
112
- return ((ReactViewBackgroundDrawable) view.getBackground()).getColor();
113
+ if (view.getBackground() instanceof CSSBackgroundDrawable) {
114
+ return ((CSSBackgroundDrawable) view.getBackground()).getColor();
113
115
  }
114
116
  throw new RuntimeException(view.getBackground().getClass().getSimpleName() + " is not ReactViewBackgroundDrawable");
115
117
  }
@@ -1,15 +1,19 @@
1
1
  package com.reactnativenavigation.viewcontrollers.viewcontroller
2
2
 
3
+ import android.annotation.SuppressLint
3
4
  import com.facebook.react.ReactInstanceManager
4
5
  import com.facebook.react.modules.i18nmanager.I18nUtil
5
6
  import com.reactnativenavigation.options.Options
6
7
 
7
8
  class LayoutDirectionApplier {
8
- fun apply(root: ViewController<*>, options: Options, instanceManager: ReactInstanceManager) {
9
- if (options.layout.direction.hasValue() && instanceManager.currentReactContext != null) {
9
+ @SuppressLint("WrongConstant")
10
+ fun apply(root: ViewController<*>, options: Options) {
11
+ val currentContext = root.view?.context ?: return
12
+
13
+ if (options.layout.direction.hasValue()) {
10
14
  root.activity.window.decorView.layoutDirection = options.layout.direction.get()
11
- I18nUtil.getInstance().allowRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
12
- I18nUtil.getInstance().forceRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
15
+ I18nUtil.instance.allowRTL(currentContext, options.layout.direction.isRtl)
16
+ I18nUtil.instance.forceRTL(currentContext, options.layout.direction.isRtl)
13
17
  }
14
18
  }
15
19
  }
@@ -35,7 +35,7 @@ public class RootPresenter {
35
35
  }
36
36
 
37
37
  public void setRoot(ViewController appearingRoot, ViewController<?> disappearingRoot, Options defaultOptions, CommandListener listener, ReactInstanceManager reactInstanceManager) {
38
- layoutDirectionApplier.apply(appearingRoot, defaultOptions, reactInstanceManager);
38
+ layoutDirectionApplier.apply(appearingRoot, defaultOptions);
39
39
  rootLayout.addView(appearingRoot.getView(), matchParentWithBehaviour(new BehaviourDelegate(appearingRoot)));
40
40
  Options options = appearingRoot.resolveCurrentOptions(defaultOptions);
41
41
  AnimationOptions enter = options.animations.setRoot.getEnter();
@@ -4,21 +4,23 @@ import android.animation.Animator
4
4
  import android.animation.ObjectAnimator
5
5
  import android.view.View
6
6
  import android.view.ViewGroup
7
+ import com.facebook.react.common.annotations.UnstableReactNativeAPI
8
+ import com.facebook.react.uimanager.drawable.CSSBackgroundDrawable
7
9
  import com.facebook.react.views.text.ReactTextView
8
- import com.facebook.react.views.view.ReactViewBackgroundDrawable
9
10
  import com.reactnativenavigation.options.SharedElementTransitionOptions
10
11
  import com.reactnativenavigation.utils.*
11
12
 
13
+ @OptIn(UnstableReactNativeAPI::class)
12
14
  class BackgroundColorAnimator(from: View, to: View) : PropertyAnimatorCreator<ViewGroup>(from, to) {
13
15
  override fun shouldAnimateProperty(fromChild: ViewGroup, toChild: ViewGroup): Boolean {
14
- return fromChild.background is ReactViewBackgroundDrawable &&
15
- toChild.background is ReactViewBackgroundDrawable && (fromChild.background as ReactViewBackgroundDrawable).color != (toChild.background as ReactViewBackgroundDrawable).color
16
+ return fromChild.background is CSSBackgroundDrawable &&
17
+ toChild.background is CSSBackgroundDrawable && (fromChild.background as CSSBackgroundDrawable).color != (toChild.background as CSSBackgroundDrawable).color
16
18
  }
17
19
 
18
20
  override fun excludedViews() = listOf(ReactTextView::class.java)
19
21
 
20
22
  override fun create(options: SharedElementTransitionOptions): Animator {
21
- val backgroundColorEvaluator = BackgroundColorEvaluator(to.background as ReactViewBackgroundDrawable)
23
+ val backgroundColorEvaluator = BackgroundColorEvaluator(to.background as CSSBackgroundDrawable)
22
24
  val fromColor = ColorUtils.colorToLAB(ViewUtils.getBackgroundColor(from))
23
25
  val toColor = ColorUtils.colorToLAB(ViewUtils.getBackgroundColor(to))
24
26
 
@@ -2,11 +2,13 @@ package com.reactnativenavigation.views.element.animators
2
2
 
3
3
  import android.animation.TypeEvaluator
4
4
  import androidx.core.graphics.ColorUtils
5
- import com.facebook.react.views.view.ReactViewBackgroundDrawable
5
+ import com.facebook.react.common.annotations.UnstableReactNativeAPI
6
+ import com.facebook.react.uimanager.drawable.CSSBackgroundDrawable
6
7
 
7
- class BackgroundColorEvaluator(private val background: ReactViewBackgroundDrawable) : TypeEvaluator<DoubleArray> {
8
+ class BackgroundColorEvaluator @OptIn(UnstableReactNativeAPI::class) constructor(private val background: CSSBackgroundDrawable) : TypeEvaluator<DoubleArray> {
8
9
  private val color = DoubleArray(3)
9
10
 
11
+ @OptIn(UnstableReactNativeAPI::class)
10
12
  override fun evaluate(ratio: Float, from: DoubleArray, to: DoubleArray): DoubleArray {
11
13
  ColorUtils.blendLAB(from, to, ratio.toDouble(), color)
12
14
  background.color = com.reactnativenavigation.utils.ColorUtils.labToColor(color)
@@ -49,17 +49,17 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
49
49
  updateFirstChildView()
50
50
  }
51
51
  }
52
- override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent?) {
52
+ override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent) {
53
53
  mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
54
54
  }
55
- override fun onChildStartedNativeGesture(androidEvent: MotionEvent?) {
55
+ override fun onChildStartedNativeGesture(androidEvent: MotionEvent) {
56
56
  mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
57
57
  }
58
- override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent?) {
58
+ override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent) {
59
59
  mJSTouchDispatcher.onChildEndedNativeGesture(androidEvent, this.getEventDispatcher())
60
60
  }
61
61
  override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {}
62
- private fun getEventDispatcher(): EventDispatcher? {
62
+ private fun getEventDispatcher(): EventDispatcher {
63
63
  val reactContext: ReactContext = this.getReactContext()
64
64
  return reactContext.getNativeModule(UIManagerModule::class.java)!!.eventDispatcher
65
65
  }
@@ -73,12 +73,12 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
73
73
  return this.context as ReactContext
74
74
  }
75
75
 
76
- override fun onInterceptTouchEvent(event: MotionEvent?): Boolean {
76
+ override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
77
77
  mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
78
78
  return super.onInterceptTouchEvent(event)
79
79
  }
80
80
 
81
- override fun onTouchEvent(event: MotionEvent?): Boolean {
81
+ override fun onTouchEvent(event: MotionEvent): Boolean {
82
82
  mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
83
83
  super.onTouchEvent(event)
84
84
  return true
@@ -4,13 +4,11 @@ interface ApplicationProps {
4
4
  }
5
5
  export declare const Application: {
6
6
  new (props: ApplicationProps): {
7
- render(): JSX.Element;
8
- context: any;
7
+ render(): React.JSX.Element;
8
+ context: unknown;
9
9
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ApplicationProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
10
10
  forceUpdate(callback?: (() => void) | undefined): void;
11
- readonly props: Readonly<ApplicationProps> & Readonly<{
12
- children?: React.ReactNode;
13
- }>;
11
+ readonly props: Readonly<ApplicationProps>;
14
12
  state: Readonly<{}>;
15
13
  refs: {
16
14
  [key: string]: React.ReactInstance;
@@ -28,6 +26,6 @@ export declare const Application: {
28
26
  componentWillUpdate?(nextProps: Readonly<ApplicationProps>, nextState: Readonly<{}>, nextContext: any): void;
29
27
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ApplicationProps>, nextState: Readonly<{}>, nextContext: any): void;
30
28
  };
31
- contextType?: React.Context<any>;
29
+ contextType?: React.Context<any> | undefined;
32
30
  };
33
31
  export {};
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ComponentProps } from '../ComponentProps';
3
3
  export declare const BottomTabs: {
4
- new (props: Readonly<ComponentProps>): {
5
- render(): JSX.Element[];
6
- context: any;
4
+ new (props: ComponentProps): {
5
+ render(): React.JSX.Element[];
6
+ context: unknown;
7
7
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
8
8
  forceUpdate(callback?: (() => void) | undefined): void;
9
- readonly props: Readonly<ComponentProps> & Readonly<{
10
- children?: React.ReactNode;
11
- }>;
9
+ readonly props: Readonly<ComponentProps>;
12
10
  state: Readonly<{}>;
13
11
  refs: {
14
12
  [key: string]: React.ReactInstance;
@@ -26,14 +24,12 @@ export declare const BottomTabs: {
26
24
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
27
25
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
28
26
  };
29
- new (props: ComponentProps, context?: any): {
30
- render(): JSX.Element[];
31
- context: any;
27
+ new (props: ComponentProps, context: any): {
28
+ render(): React.JSX.Element[];
29
+ context: unknown;
32
30
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
33
31
  forceUpdate(callback?: (() => void) | undefined): void;
34
- readonly props: Readonly<ComponentProps> & Readonly<{
35
- children?: React.ReactNode;
36
- }>;
32
+ readonly props: Readonly<ComponentProps>;
37
33
  state: Readonly<{}>;
38
34
  refs: {
39
35
  [key: string]: React.ReactInstance;
@@ -51,5 +47,5 @@ export declare const BottomTabs: {
51
47
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
52
48
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
53
49
  };
54
- contextType?: React.Context<any>;
50
+ contextType?: React.Context<any> | undefined;
55
51
  };
@@ -4,14 +4,12 @@ export declare const ComponentScreen: {
4
4
  new (props: ComponentProps): {
5
5
  componentDidMount(): void;
6
6
  isVisible(): boolean;
7
- renderTabBar(): JSX.Element | null;
8
- render(): JSX.Element;
9
- context: any;
7
+ renderTabBar(): React.JSX.Element | null;
8
+ render(): React.JSX.Element;
9
+ context: unknown;
10
10
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
11
11
  forceUpdate(callback?: (() => void) | undefined): void;
12
- readonly props: Readonly<ComponentProps> & Readonly<{
13
- children?: React.ReactNode;
14
- }>;
12
+ readonly props: Readonly<ComponentProps>;
15
13
  state: Readonly<{}>;
16
14
  refs: {
17
15
  [key: string]: React.ReactInstance;
@@ -28,5 +26,5 @@ export declare const ComponentScreen: {
28
26
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
29
27
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
30
28
  };
31
- contextType?: React.Context<any>;
29
+ contextType?: React.Context<any> | undefined;
32
30
  };
@@ -34,7 +34,9 @@ exports.ComponentScreen = (0, connect_1.connect)(class extends react_1.Component
34
34
  return null;
35
35
  const buttons = bottomTabs.children.map((child, i) => {
36
36
  const bottomTabOptions = child.resolveOptions().bottomTab;
37
- const icon = bottomTabs.selectedIndex === i ? bottomTabOptions?.selectedIcon : bottomTabOptions?.icon;
37
+ const icon = bottomTabs.selectedIndex === i
38
+ ? bottomTabOptions?.selectedIcon
39
+ : bottomTabOptions?.icon;
38
40
  const iconURI = isURISource(icon) ? icon.uri : undefined;
39
41
  return (react_1.default.createElement(react_native_1.View, { key: `tab-${i}` },
40
42
  react_1.default.createElement(react_native_1.TouchableOpacity, { style: { padding: 10 }, testID: bottomTabOptions?.testID, onPress: () => {
@@ -46,10 +48,15 @@ exports.ComponentScreen = (0, connect_1.connect)(class extends react_1.Component
46
48
  } },
47
49
  react_1.default.createElement(react_native_1.View, { style: { justifyContent: 'center', alignItems: 'center' } },
48
50
  react_1.default.createElement(react_native_1.Text, null, bottomTabOptions?.badge),
49
- iconURI && react_1.default.createElement(react_native_1.Image, { style: { width: 18, height: 18, marginBottom: 5 }, source: { uri: iconURI } }),
51
+ iconURI && (react_1.default.createElement(react_native_1.Image, { style: { width: 18, height: 18, marginBottom: 5 }, source: { uri: iconURI } })),
50
52
  react_1.default.createElement(react_native_1.Text, { style: { fontSize: 12 } }, bottomTabOptions?.text || '')))));
51
53
  });
52
- return (react_1.default.createElement(react_native_1.View, { testID: bottomTabsOptions?.testID, style: { flexDirection: 'row', justifyContent: 'center', width: '100%', backgroundColor: '#F0F2F5' } }, buttons));
54
+ return (react_1.default.createElement(react_native_1.View, { testID: bottomTabsOptions?.testID, style: {
55
+ flexDirection: 'row',
56
+ justifyContent: 'center',
57
+ width: '100%',
58
+ backgroundColor: '#F0F2F5',
59
+ } }, buttons));
53
60
  }
54
61
  render() {
55
62
  const Component = react_native_navigation_1.Navigation.mock.store.getWrappedComponent(this.props.layoutNode.data.name);
@@ -1,15 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ComponentProps } from '../ComponentProps';
3
3
  export declare const LayoutComponent: {
4
- new (props: Readonly<ComponentProps>): {
5
- render(): JSX.Element;
4
+ new (props: ComponentProps): {
5
+ render(): React.JSX.Element;
6
6
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
7
- context: any;
7
+ context: unknown;
8
8
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
9
9
  forceUpdate(callback?: (() => void) | undefined): void;
10
- readonly props: Readonly<ComponentProps> & Readonly<{
11
- children?: React.ReactNode;
12
- }>;
10
+ readonly props: Readonly<ComponentProps>;
13
11
  state: Readonly<{}>;
14
12
  refs: {
15
13
  [key: string]: React.ReactInstance;
@@ -26,15 +24,13 @@ export declare const LayoutComponent: {
26
24
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
27
25
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
28
26
  };
29
- new (props: ComponentProps, context?: any): {
30
- render(): JSX.Element;
27
+ new (props: ComponentProps, context: any): {
28
+ render(): React.JSX.Element;
31
29
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
32
- context: any;
30
+ context: unknown;
33
31
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
34
32
  forceUpdate(callback?: (() => void) | undefined): void;
35
- readonly props: Readonly<ComponentProps> & Readonly<{
36
- children?: React.ReactNode;
37
- }>;
33
+ readonly props: Readonly<ComponentProps>;
38
34
  state: Readonly<{}>;
39
35
  refs: {
40
36
  [key: string]: React.ReactInstance;
@@ -51,5 +47,5 @@ export declare const LayoutComponent: {
51
47
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
52
48
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
53
49
  };
54
- contextType?: React.Context<any>;
50
+ contextType?: React.Context<any> | undefined;
55
51
  };
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ComponentProps } from '../ComponentProps';
3
3
  export declare const Modals: {
4
- new (props: Readonly<ComponentProps>): {
5
- render(): JSX.Element;
6
- context: any;
4
+ new (props: ComponentProps): {
5
+ render(): React.JSX.Element;
6
+ context: unknown;
7
7
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
8
8
  forceUpdate(callback?: (() => void) | undefined): void;
9
- readonly props: Readonly<ComponentProps> & Readonly<{
10
- children?: React.ReactNode;
11
- }>;
9
+ readonly props: Readonly<ComponentProps>;
12
10
  state: Readonly<{}>;
13
11
  refs: {
14
12
  [key: string]: React.ReactInstance;
@@ -26,14 +24,12 @@ export declare const Modals: {
26
24
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
27
25
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
28
26
  };
29
- new (props: ComponentProps, context?: any): {
30
- render(): JSX.Element;
31
- context: any;
27
+ new (props: ComponentProps, context: any): {
28
+ render(): React.JSX.Element;
29
+ context: unknown;
32
30
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
33
31
  forceUpdate(callback?: (() => void) | undefined): void;
34
- readonly props: Readonly<ComponentProps> & Readonly<{
35
- children?: React.ReactNode;
36
- }>;
32
+ readonly props: Readonly<ComponentProps>;
37
33
  state: Readonly<{}>;
38
34
  refs: {
39
35
  [key: string]: React.ReactInstance;
@@ -51,5 +47,5 @@ export declare const Modals: {
51
47
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
52
48
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
53
49
  };
54
- contextType?: React.Context<any>;
50
+ contextType?: React.Context<any> | undefined;
55
51
  };
@@ -5,17 +5,15 @@ interface ButtonProps {
5
5
  componentId: string;
6
6
  }
7
7
  export declare const NavigationButton: {
8
- new (props: Readonly<ButtonProps>): {
8
+ new (props: ButtonProps): {
9
9
  ref: undefined;
10
- render(): JSX.Element;
11
- renderButtonComponent(): JSX.Element;
10
+ render(): React.JSX.Element;
11
+ renderButtonComponent(): React.JSX.Element;
12
12
  invokeOnClick(stateNode: any): void;
13
- context: any;
13
+ context: unknown;
14
14
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ButtonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
15
15
  forceUpdate(callback?: (() => void) | undefined): void;
16
- readonly props: Readonly<ButtonProps> & Readonly<{
17
- children?: React.ReactNode;
18
- }>;
16
+ readonly props: Readonly<ButtonProps>;
19
17
  state: Readonly<{}>;
20
18
  refs: {
21
19
  [key: string]: React.ReactInstance;
@@ -33,17 +31,15 @@ export declare const NavigationButton: {
33
31
  componentWillUpdate?(nextProps: Readonly<ButtonProps>, nextState: Readonly<{}>, nextContext: any): void;
34
32
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ButtonProps>, nextState: Readonly<{}>, nextContext: any): void;
35
33
  };
36
- new (props: ButtonProps, context?: any): {
34
+ new (props: ButtonProps, context: any): {
37
35
  ref: undefined;
38
- render(): JSX.Element;
39
- renderButtonComponent(): JSX.Element;
36
+ render(): React.JSX.Element;
37
+ renderButtonComponent(): React.JSX.Element;
40
38
  invokeOnClick(stateNode: any): void;
41
- context: any;
39
+ context: unknown;
42
40
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ButtonProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
43
41
  forceUpdate(callback?: (() => void) | undefined): void;
44
- readonly props: Readonly<ButtonProps> & Readonly<{
45
- children?: React.ReactNode;
46
- }>;
42
+ readonly props: Readonly<ButtonProps>;
47
43
  state: Readonly<{}>;
48
44
  refs: {
49
45
  [key: string]: React.ReactInstance;
@@ -61,6 +57,6 @@ export declare const NavigationButton: {
61
57
  componentWillUpdate?(nextProps: Readonly<ButtonProps>, nextState: Readonly<{}>, nextContext: any): void;
62
58
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ButtonProps>, nextState: Readonly<{}>, nextContext: any): void;
63
59
  };
64
- contextType?: React.Context<any>;
60
+ contextType?: React.Context<any> | undefined;
65
61
  };
66
62
  export {};
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ComponentProps } from '../ComponentProps';
3
3
  export declare const Overlays: {
4
- new (props: Readonly<ComponentProps>): {
5
- render(): JSX.Element;
6
- context: any;
4
+ new (props: ComponentProps): {
5
+ render(): React.JSX.Element;
6
+ context: unknown;
7
7
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
8
8
  forceUpdate(callback?: (() => void) | undefined): void;
9
- readonly props: Readonly<ComponentProps> & Readonly<{
10
- children?: React.ReactNode;
11
- }>;
9
+ readonly props: Readonly<ComponentProps>;
12
10
  state: Readonly<{}>;
13
11
  refs: {
14
12
  [key: string]: React.ReactInstance;
@@ -26,14 +24,12 @@ export declare const Overlays: {
26
24
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
27
25
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
28
26
  };
29
- new (props: ComponentProps, context?: any): {
30
- render(): JSX.Element;
31
- context: any;
27
+ new (props: ComponentProps, context: any): {
28
+ render(): React.JSX.Element;
29
+ context: unknown;
32
30
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
33
31
  forceUpdate(callback?: (() => void) | undefined): void;
34
- readonly props: Readonly<ComponentProps> & Readonly<{
35
- children?: React.ReactNode;
36
- }>;
32
+ readonly props: Readonly<ComponentProps>;
37
33
  state: Readonly<{}>;
38
34
  refs: {
39
35
  [key: string]: React.ReactInstance;
@@ -51,5 +47,5 @@ export declare const Overlays: {
51
47
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
52
48
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
53
49
  };
54
- contextType?: React.Context<any>;
50
+ contextType?: React.Context<any> | undefined;
55
51
  };
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ComponentProps } from '../ComponentProps';
3
3
  export declare const Stack: {
4
- new (props: Readonly<ComponentProps>): {
5
- render(): JSX.Element[];
6
- context: any;
4
+ new (props: ComponentProps): {
5
+ render(): React.JSX.Element[];
6
+ context: unknown;
7
7
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
8
8
  forceUpdate(callback?: (() => void) | undefined): void;
9
- readonly props: Readonly<ComponentProps> & Readonly<{
10
- children?: React.ReactNode;
11
- }>;
9
+ readonly props: Readonly<ComponentProps>;
12
10
  state: Readonly<{}>;
13
11
  refs: {
14
12
  [key: string]: React.ReactInstance;
@@ -26,14 +24,12 @@ export declare const Stack: {
26
24
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
27
25
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
28
26
  };
29
- new (props: ComponentProps, context?: any): {
30
- render(): JSX.Element[];
31
- context: any;
27
+ new (props: ComponentProps, context: any): {
28
+ render(): React.JSX.Element[];
29
+ context: unknown;
32
30
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ComponentProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
33
31
  forceUpdate(callback?: (() => void) | undefined): void;
34
- readonly props: Readonly<ComponentProps> & Readonly<{
35
- children?: React.ReactNode;
36
- }>;
32
+ readonly props: Readonly<ComponentProps>;
37
33
  state: Readonly<{}>;
38
34
  refs: {
39
35
  [key: string]: React.ReactInstance;
@@ -51,5 +47,5 @@ export declare const Stack: {
51
47
  componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
52
48
  UNSAFE_componentWillUpdate?(nextProps: Readonly<ComponentProps>, nextState: Readonly<{}>, nextContext: any): void;
53
49
  };
54
- contextType?: React.Context<any>;
50
+ contextType?: React.Context<any> | undefined;
55
51
  };
@@ -8,17 +8,15 @@ export interface TopBarProps {
8
8
  }
9
9
  export declare const TopBar: {
10
10
  new (props: TopBarProps): {
11
- render(): JSX.Element | null;
11
+ render(): React.JSX.Element | null;
12
12
  shouldRenderBackButton(layoutNode: ParentNode): boolean;
13
- renderButtons(buttons?: OptionsTopBarButton[]): JSX.Element[];
14
- renderBackButton(): JSX.Element;
15
- renderComponent(id: string, name: string, testID?: string): JSX.Element;
16
- context: any;
13
+ renderButtons(buttons?: OptionsTopBarButton[]): React.JSX.Element[];
14
+ renderBackButton(): React.JSX.Element;
15
+ renderComponent(id: string, name: string, testID?: string): React.JSX.Element;
16
+ context: unknown;
17
17
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<TopBarProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
18
18
  forceUpdate(callback?: (() => void) | undefined): void;
19
- readonly props: Readonly<TopBarProps> & Readonly<{
20
- children?: React.ReactNode;
21
- }>;
19
+ readonly props: Readonly<TopBarProps>;
22
20
  state: Readonly<{}>;
23
21
  refs: {
24
22
  [key: string]: React.ReactInstance;
@@ -36,5 +34,5 @@ export declare const TopBar: {
36
34
  componentWillUpdate?(nextProps: Readonly<TopBarProps>, nextState: Readonly<{}>, nextContext: any): void;
37
35
  UNSAFE_componentWillUpdate?(nextProps: Readonly<TopBarProps>, nextState: Readonly<{}>, nextContext: any): void;
38
36
  };
39
- contextType?: React.Context<any>;
37
+ contextType?: React.Context<any> | undefined;
40
38
  };
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connect = connect;
3
+ exports.connect = void 0;
4
4
  const remx_1 = require("remx");
5
5
  function connect(component) {
6
6
  // @ts-ignore
7
7
  return (0, remx_1.connect)()(component);
8
8
  }
9
+ exports.connect = connect;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApplicationMock = void 0;
4
- exports.mockNativeComponents = mockNativeComponents;
3
+ exports.mockNativeComponents = exports.ApplicationMock = void 0;
5
4
  const tslib_1 = require("tslib");
6
5
  exports.ApplicationMock = require('./Application').Application;
7
6
  tslib_1.__exportStar(require("./constants"), exports);
@@ -12,3 +11,4 @@ function mockNativeComponents() {
12
11
  const { Navigation } = require('react-native-navigation');
13
12
  Navigation.mockNativeComponents(new NativeCommandsSender(), new NativeEventsReceiver(), new AppRegistryService());
14
13
  }
14
+ exports.mockNativeComponents = mockNativeComponents;
@@ -8,7 +8,7 @@ class NativeEventsReceiver {
8
8
  try {
9
9
  this.emitter = new react_native_1.NativeEventEmitter(react_native_1.NativeModules.RNNEventEmitter);
10
10
  }
11
- catch (e) {
11
+ catch {
12
12
  this.emitter = {
13
13
  addListener: () => {
14
14
  return {
@@ -8,7 +8,7 @@ interface GestureResponderEventWithForce extends NativeSyntheticEvent<NativeTouc
8
8
  }
9
9
  export interface Props {
10
10
  children?: React.ReactNode;
11
- touchableComponent?: TouchableHighlight | TouchableOpacity | TouchableNativeFeedback | TouchableWithoutFeedback | React.ReactNode;
11
+ touchableComponent?: typeof TouchableHighlight | typeof TouchableOpacity | TouchableNativeFeedback | TouchableWithoutFeedback | React.ReactNode;
12
12
  onPress?: () => void;
13
13
  onPressIn?: (payload: {
14
14
  reactTag: number | null;
@@ -38,6 +38,6 @@ export declare class TouchablePreview extends React.PureComponent<Props> {
38
38
  onTouchStart: (event: GestureResponderEvent) => void;
39
39
  onTouchMove: (event: GestureResponderEventWithForce) => void;
40
40
  onTouchEnd: () => void;
41
- render(): JSX.Element;
41
+ render(): React.JSX.Element;
42
42
  }
43
43
  export {};
@@ -13,4 +13,4 @@ var LayoutType;
13
13
  LayoutType["TopTabs"] = "TopTabs";
14
14
  LayoutType["ExternalComponent"] = "ExternalComponent";
15
15
  LayoutType["SplitView"] = "SplitView";
16
- })(LayoutType || (exports.LayoutType = LayoutType = {}));
16
+ })(LayoutType = exports.LayoutType || (exports.LayoutType = {}));
@@ -15,6 +15,6 @@ export declare class Modal extends React.Component<RNNModalProps> {
15
15
  animationType: string;
16
16
  };
17
17
  constructor(props: RNNModalProps);
18
- render(): JSX.Element | null;
18
+ render(): React.JSX.Element | null;
19
19
  private proccessProps;
20
20
  }
@@ -19,4 +19,4 @@ var CommandName;
19
19
  CommandName["DismissOverlay"] = "dismissOverlay";
20
20
  CommandName["DismissAllOverlays"] = "dismissAllOverlays";
21
21
  CommandName["GetLaunchArgs"] = "getLaunchArgs";
22
- })(CommandName || (exports.CommandName = CommandName = {}));
22
+ })(CommandName = exports.CommandName || (exports.CommandName = {}));
@@ -11,11 +11,11 @@ var OptionsModalPresentationStyle;
11
11
  OptionsModalPresentationStyle["popover"] = "popover";
12
12
  OptionsModalPresentationStyle["fullScreen"] = "fullScreen";
13
13
  OptionsModalPresentationStyle["none"] = "none";
14
- })(OptionsModalPresentationStyle || (exports.OptionsModalPresentationStyle = OptionsModalPresentationStyle = {}));
14
+ })(OptionsModalPresentationStyle = exports.OptionsModalPresentationStyle || (exports.OptionsModalPresentationStyle = {}));
15
15
  var OptionsModalTransitionStyle;
16
16
  (function (OptionsModalTransitionStyle) {
17
17
  OptionsModalTransitionStyle["coverVertical"] = "coverVertical";
18
18
  OptionsModalTransitionStyle["crossDissolve"] = "crossDissolve";
19
19
  OptionsModalTransitionStyle["flipHorizontal"] = "flipHorizontal";
20
20
  OptionsModalTransitionStyle["partialCurl"] = "partialCurl";
21
- })(OptionsModalTransitionStyle || (exports.OptionsModalTransitionStyle = OptionsModalTransitionStyle = {}));
21
+ })(OptionsModalTransitionStyle = exports.OptionsModalTransitionStyle || (exports.OptionsModalTransitionStyle = {}));
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare module 'react-lifecycles-compat' {
2
3
  import * as React from 'react';
3
4
  function polyfill(component: React.ComponentClass<any>): void;
@@ -1,6 +1,7 @@
1
1
  #import "BottomTabsBasePresenter.h"
2
2
  #import "RNNBottomTabsController.h"
3
3
  #import "UIImage+utils.h"
4
+ #import "RNNConvert.h"
4
5
 
5
6
  @implementation BottomTabsBasePresenter
6
7
 
@@ -29,7 +30,7 @@
29
30
  [self applyBackgroundColor:[withDefault.bottomTabs.backgroundColor withDefault:nil]
30
31
  translucent:[withDefault.bottomTabs.translucent withDefault:NO]];
31
32
  [bottomTabs setTabBarHideShadow:[withDefault.bottomTabs.hideShadow withDefault:NO]];
32
- [bottomTabs setTabBarStyle:[RCTConvert UIBarStyle:[withDefault.bottomTabs.barStyle
33
+ [bottomTabs setTabBarStyle:[RNNConvert UIBarStyle:[withDefault.bottomTabs.barStyle
33
34
  withDefault:@"default"]]];
34
35
  [self applyTabBarBorder:withDefault.bottomTabs];
35
36
  [self applyTabBarShadow:withDefault.bottomTabs.shadow];
@@ -60,7 +61,7 @@
60
61
  }
61
62
 
62
63
  if (mergeOptions.bottomTabs.barStyle.hasValue) {
63
- [bottomTabs setTabBarStyle:[RCTConvert UIBarStyle:mergeOptions.bottomTabs.barStyle.get]];
64
+ [bottomTabs setTabBarStyle:[RNNConvert UIBarStyle:mergeOptions.bottomTabs.barStyle.get]];
64
65
  }
65
66
 
66
67
  if (mergeOptions.bottomTabs.translucent.hasValue) {
@@ -2,8 +2,7 @@
2
2
  #import <ReactNativeNavigation/ReactNativeNavigation.h>
3
3
 
4
4
  #if RCT_NEW_ARCH_ENABLED
5
- #import "RCTAppSetupUtils.h"
6
- #import "RCTLegacyInteropComponents.h"
5
+
7
6
  #import <React/CoreModulesPlugins.h>
8
7
  #import <React/RCTCxxBridgeDelegate.h>
9
8
  #import <React/RCTLegacyViewManagerInteropComponentView.h>
@@ -7,4 +7,7 @@
7
7
 
8
8
  + (UIModalTransitionStyle)UIModalTransitionStyle:(id)json;
9
9
 
10
+ + (UIBarStyle)UIBarStyle:(id)json;
11
+
12
+
10
13
  @end
@@ -32,4 +32,13 @@ RCT_ENUM_CONVERTER(UIModalPresentationStyle, (@{
32
32
  }),
33
33
  UIModalPresentationFullScreen, integerValue)
34
34
 
35
+ RCT_ENUM_CONVERTER(
36
+ UIBarStyle,
37
+ (@{
38
+ @"default" : @(UIBarStyleDefault),
39
+ @"black" : @(UIBarStyleBlack)
40
+ }),
41
+ UIBarStyleDefault,
42
+ integerValue)
43
+
35
44
  @end
@@ -5,6 +5,7 @@
5
5
  #import "RNNStackController.h"
6
6
  #import "TopBarPresenterCreator.h"
7
7
  #import "UINavigationController+RNNOptions.h"
8
+ #import "RNNConvert.h"
8
9
 
9
10
  @interface RNNStackPresenter () {
10
11
  RNNReactComponentRegistry *_componentRegistry;
@@ -68,7 +69,7 @@
68
69
  stack.interactivePopGestureRecognizer.delegate = _interactivePopGestureDelegate;
69
70
 
70
71
  [stack
71
- setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle withDefault:@"default"]]];
72
+ setBarStyle:[RNNConvert UIBarStyle:[withDefault.topBar.barStyle withDefault:@"default"]]];
72
73
  [stack setRootBackgroundImage:[withDefault.rootBackgroundImage withDefault:nil]];
73
74
  [stack setNavigationBarTestId:[withDefault.topBar.testID withDefault:nil]];
74
75
  [stack setNavigationBarVisible:[withDefault.topBar.visible withDefault:YES]
@@ -126,7 +127,7 @@
126
127
  }
127
128
 
128
129
  if (mergeOptions.topBar.barStyle.hasValue) {
129
- [stack setBarStyle:[RCTConvert UIBarStyle:mergeOptions.topBar.barStyle.get]];
130
+ [stack setBarStyle:[RNNConvert UIBarStyle:mergeOptions.topBar.barStyle.get]];
130
131
  }
131
132
 
132
133
  if (mergeOptions.topBar.background.clipToBounds.hasValue) {
@@ -23,14 +23,14 @@ export class NativeEventsReceiver {
23
23
  constructor() {
24
24
  try {
25
25
  this.emitter = new NativeEventEmitter(NativeModules.RNNEventEmitter);
26
- } catch (e) {
27
- this.emitter = ({
26
+ } catch {
27
+ this.emitter = {
28
28
  addListener: () => {
29
29
  return {
30
30
  remove: () => undefined,
31
31
  };
32
32
  },
33
- } as any) as NativeEventEmitter;
33
+ } as any as NativeEventEmitter;
34
34
  }
35
35
  }
36
36
 
@@ -22,8 +22,8 @@ interface GestureResponderEventWithForce extends NativeSyntheticEvent<NativeTouc
22
22
  export interface Props {
23
23
  children?: React.ReactNode;
24
24
  touchableComponent?:
25
- | TouchableHighlight
26
- | TouchableOpacity
25
+ | typeof TouchableHighlight
26
+ | typeof TouchableOpacity
27
27
  | TouchableNativeFeedback
28
28
  | TouchableWithoutFeedback
29
29
  | React.ReactNode;
@@ -121,7 +121,7 @@ export class TouchablePreview extends React.PureComponent<Props> {
121
121
  const Touchable =
122
122
  Platform.OS === 'ios' && touchableComponent instanceof TouchableNativeFeedback
123
123
  ? TouchableWithoutFeedback
124
- : (touchableComponent as typeof React.Component);
124
+ : (touchableComponent as React.Component);
125
125
 
126
126
  // Wrap component with Touchable for handling platform touches
127
127
  // and a single react View for detecting force and timing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-navigation",
3
- "version": "7.41.0-test01",
3
+ "version": "7.42.0",
4
4
  "description": "React Native Navigation - truly native navigation for iOS and Android",
5
5
  "license": "MIT",
6
6
  "nativePackage": true,
@@ -64,40 +64,43 @@
64
64
  "hoist-non-react-statics": "3.x.x",
65
65
  "lodash": "4.17.x",
66
66
  "prop-types": "15.x.x",
67
- "react-lifecycles-compat": "2.0.0",
67
+ "react-lifecycles-compat": "^3.0.4",
68
68
  "tslib": "1.9.3"
69
69
  },
70
70
  "devDependencies": {
71
- "@babel/core": "7.22.9",
71
+ "@babel/core": "^7.25.2",
72
72
  "@babel/plugin-proposal-export-default-from": "7.10.1",
73
73
  "@babel/plugin-proposal-export-namespace-from": "7.10.1",
74
- "@babel/runtime": "7.22.6",
75
- "@babel/types": "7.22.5",
76
- "@babel/preset-env": "^7.22.9",
77
- "@react-native/metro-config": "^0.73.2",
78
- "@react-native/babel-preset": "^0.73.18",
79
- "@react-native/typescript-config": "^0.73.1",
80
- "@react-native-community/blur": "^4.4.1",
81
- "@react-native-community/datetimepicker": "^3.4.7",
82
- "@react-native-community/eslint-config": "2.0.0",
83
- "@react-native-community/netinfo": "^5.9.4",
74
+ "@babel/preset-env": "^7.25.3",
75
+ "@babel/runtime": "^7.25.0",
76
+ "@babel/types": "7.25.0",
77
+ "@react-native-community/cli": "15.0.1",
78
+ "@react-native-community/cli-platform-android": "15.0.1",
79
+ "@react-native-community/cli-platform-ios": "15.0.1",
80
+ "@react-native-community/datetimepicker": "^8.2.0",
81
+ "@react-native-community/eslint-config": "3.2.0",
82
+ "@react-native-community/netinfo": "^11.4.1",
83
+ "@react-native/babel-preset": "0.76.6",
84
+ "@react-native/eslint-config": "0.76.6",
85
+ "@react-native/metro-config": "0.76.6",
86
+ "@react-native/typescript-config": "0.76.6",
84
87
  "@testing-library/jest-native": "^5.4.2",
85
- "@testing-library/react-native": "^12.0.1",
86
- "@types/hoist-non-react-statics": "^3.0.1",
88
+ "@testing-library/react-native": "^13.0.1",
89
+ "@types/hoist-non-react-statics": "^3.3.6",
87
90
  "@types/jasmine": "3.5.10",
88
91
  "@types/jest": "27.0.2",
89
92
  "@types/lodash": "^4.14.149",
90
- "@types/react": "16.9.41",
91
- "@types/react-native": "0.63.1",
92
- "@types/react-test-renderer": "16.9.2",
93
- "@typescript-eslint/eslint-plugin": "4.33.0",
94
- "@typescript-eslint/parser": "4.33.0",
93
+ "@types/react": "^18.2.6",
94
+ "@types/react-test-renderer": "^18.0.0",
95
+ "@typescript-eslint/eslint-plugin": "8.21.0",
96
+ "@typescript-eslint/parser": "8.21.0",
95
97
  "babel-jest": "^27.0.0",
96
98
  "clang-format": "^1.4.0",
97
- "detox": "20.19.5",
99
+ "detox": "20.32.0",
98
100
  "detox-testing-library-rnn-adapter": "^2.0.3",
99
- "eslint": "7.32.0",
101
+ "eslint": "^8.19.0",
100
102
  "eslint-config-prettier": "6.11.0",
103
+ "eslint-formatter-codeframe": "^7.32.1",
101
104
  "eslint-plugin-prettier": "3.1.4",
102
105
  "github-release-notes": "https://github.com/yogevbd/github-release-notes/tarball/e601b3dba72dcd6cba323c1286ea6dd0c0110b58",
103
106
  "husky": "4.2.5",
@@ -107,22 +110,22 @@
107
110
  "metro-react-native-babel-preset": "^0.76.2",
108
111
  "pixelmatch": "^5.2.1",
109
112
  "pngjs": "^6.0.0",
110
- "prettier": "2.1.2",
111
- "react": "18.2.0",
112
- "react-native": "0.73.3",
113
+ "prettier": "2.8.8",
114
+ "react": "18.3.1",
115
+ "react-native": "0.76.6",
113
116
  "react-native-fast-image": "^8.6.3",
114
- "react-native-gesture-handler": "2.14.1",
115
- "react-native-reanimated": "3.16.1",
117
+ "react-native-gesture-handler": "^2.22.1",
118
+ "react-native-reanimated": "3.16.7",
116
119
  "react-native-ui-lib": "7.3.6",
117
120
  "react-redux": "5.x.x",
118
- "react-test-renderer": "18.2.0",
121
+ "react-test-renderer": "18.3.1",
119
122
  "redux": "3.x.x",
120
123
  "remx": "3.x.x",
121
124
  "semver": "5.x.x",
122
125
  "shell-utils": "1.x.x",
123
126
  "ts-mockito": "^2.3.1",
124
127
  "typedoc": "0.x.x",
125
- "typescript": "5.5.4"
128
+ "typescript": "5.0.4"
126
129
  },
127
130
  "husky": {
128
131
  "hooks": {
@@ -168,7 +171,7 @@
168
171
  "emulator": {
169
172
  "type": "android.emulator",
170
173
  "device": {
171
- "avdName": "Pixel_API_28"
174
+ "avdName": "Pixel_3a_API_34"
172
175
  }
173
176
  }
174
177
  },
@@ -188,7 +191,10 @@
188
191
  "type": "android.apk",
189
192
  "binaryPath": "playground/android/app/build/outputs/apk/debug/app-debug.apk",
190
193
  "start": "npm start -- --e2e",
191
- "build": "cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug"
194
+ "build": "cd playground/android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug",
195
+ "reversePorts": [
196
+ 8081
197
+ ]
192
198
  },
193
199
  "android.release": {
194
200
  "type": "android.apk",