react-native-screens 3.13.0 → 3.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/RNScreens.podspec +5 -4
- package/android/build.gradle +18 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +8 -4
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +14 -18
- package/android/src/main/jni/Android.mk +1 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +39 -14
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +15 -6
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -1
- package/common/cpp/Android.mk +1 -2
- package/createNativeStackNavigator/README.md +4 -0
- package/ios/RNSConvert.h +30 -0
- package/ios/RNSConvert.mm +120 -0
- package/ios/RNSEnums.h +59 -0
- package/ios/RNSFullWindowOverlay.h +17 -2
- package/ios/RNSFullWindowOverlay.mm +199 -0
- package/ios/RNSScreen.h +70 -79
- package/ios/{RNSScreen.m → RNSScreen.mm} +679 -302
- package/ios/RNSScreenContainer.h +15 -1
- package/ios/{RNSScreenContainer.m → RNSScreenContainer.mm} +99 -8
- package/ios/{RNSScreenNavigationContainer.m → RNSScreenNavigationContainer.mm} +22 -0
- package/ios/RNSScreenStack.h +19 -3
- package/ios/{RNSScreenStack.m → RNSScreenStack.mm} +377 -126
- package/ios/{RNSScreenStackAnimator.m → RNSScreenStackAnimator.mm} +19 -14
- package/ios/RNSScreenStackHeaderConfig.h +20 -21
- package/ios/{RNSScreenStackHeaderConfig.m → RNSScreenStackHeaderConfig.mm} +232 -117
- package/ios/RNSScreenStackHeaderSubview.h +45 -0
- package/ios/RNSScreenStackHeaderSubview.mm +137 -0
- package/ios/RNSScreenViewEvent.h +12 -0
- package/ios/RNSScreenViewEvent.mm +59 -0
- package/ios/{RNSScreenWindowTraits.m → RNSScreenWindowTraits.mm} +3 -2
- package/ios/RNSSearchBar.h +14 -1
- package/ios/RNSSearchBar.mm +351 -0
- package/ios/{UIViewController+RNScreens.m → UIViewController+RNScreens.mm} +0 -0
- package/ios/{UIWindow+RNScreens.m → UIWindow+RNScreens.mm} +0 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js +26 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +21 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/Screen.js +10 -8
- package/lib/commonjs/fabric/Screen.js.map +1 -1
- package/lib/commonjs/fabric/ScreenContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStack.js +6 -7
- package/lib/commonjs/fabric/ScreenStack.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubview.js +4 -1
- package/lib/commonjs/fabric/ScreenStackHeaderSubview.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBar.js +37 -0
- package/lib/commonjs/fabric/SearchBar.js.map +1 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +25 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/index.js +32 -0
- package/lib/commonjs/fabric/index.js.map +1 -1
- package/lib/commonjs/index.native.js +14 -18
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +4 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +8 -2
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlay.js +15 -0
- package/lib/module/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +9 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/module/fabric/Screen.js +8 -3
- package/lib/module/fabric/Screen.js.map +1 -1
- package/lib/module/fabric/ScreenContainer.js +17 -0
- package/lib/module/fabric/ScreenContainer.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainer.js +17 -0
- package/lib/module/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStack.js +5 -2
- package/lib/module/fabric/ScreenStack.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackHeaderSubview.js +4 -1
- package/lib/module/fabric/ScreenStackHeaderSubview.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBar.js +24 -0
- package/lib/module/fabric/SearchBar.js.map +1 -0
- package/lib/module/fabric/SearchBarNativeComponent.js +11 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/module/fabric/index.js +5 -1
- package/lib/module/fabric/index.js.map +1 -1
- package/lib/module/index.native.js +15 -20
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +4 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +7 -2
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +12 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +24 -0
- package/native-stack/README.md +21 -0
- package/package.json +2 -2
- package/src/fabric/FullWindowOverlay.js +13 -0
- package/src/fabric/FullWindowOverlayNativeComponent.js +19 -0
- package/src/fabric/Screen.js +5 -2
- package/src/fabric/ScreenContainer.js +16 -0
- package/src/fabric/ScreenContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenNativeComponent.js +41 -8
- package/src/fabric/ScreenNavigationContainer.js +16 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenStack.js +4 -2
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -1
- package/src/fabric/ScreenStackHeaderSubview.js +3 -1
- package/src/fabric/ScreenStackNativeComponent.js +4 -0
- package/src/fabric/SearchBar.js +20 -0
- package/src/fabric/SearchBarNativeComponent.js +62 -0
- package/src/fabric/index.js +8 -0
- package/src/index.native.tsx +20 -19
- package/src/native-stack/types.tsx +12 -0
- package/src/native-stack/views/NativeStackView.tsx +4 -0
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +6 -0
- package/src/types.tsx +25 -0
- package/ios/RNSFullWindowOverlay.m +0 -105
- package/ios/RNSScreenComponentView.h +0 -23
- package/ios/RNSScreenComponentView.mm +0 -159
- package/ios/RNSScreenController.h +0 -10
- package/ios/RNSScreenController.mm +0 -79
- package/ios/RNSScreenStackComponentView.h +0 -15
- package/ios/RNSScreenStackComponentView.mm +0 -295
- package/ios/RNSScreenStackHeaderConfigComponentView.h +0 -42
- package/ios/RNSScreenStackHeaderConfigComponentView.mm +0 -662
- package/ios/RNSScreenStackHeaderSubviewComponentView.h +0 -14
- package/ios/RNSScreenStackHeaderSubviewComponentView.mm +0 -77
- package/ios/RNSSearchBar.m +0 -198
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
|
|
3
|
+
#ifdef RN_FABRIC_ENABLED
|
|
4
|
+
#import <React/RCTViewComponentView.h>
|
|
5
|
+
#else
|
|
1
6
|
#import <React/RCTInvalidating.h>
|
|
2
7
|
#import <React/RCTView.h>
|
|
3
|
-
#
|
|
8
|
+
#endif
|
|
4
9
|
|
|
5
10
|
@interface RNSFullWindowOverlayManager : RCTViewManager
|
|
6
11
|
|
|
@@ -10,6 +15,16 @@
|
|
|
10
15
|
|
|
11
16
|
@end
|
|
12
17
|
|
|
13
|
-
@interface RNSFullWindowOverlay :
|
|
18
|
+
@interface RNSFullWindowOverlay :
|
|
19
|
+
#ifdef RN_FABRIC_ENABLED
|
|
20
|
+
RCTViewComponentView
|
|
21
|
+
#else
|
|
22
|
+
RCTView <RCTInvalidating>
|
|
23
|
+
#endif // RN_FABRIC_ENABLED
|
|
24
|
+
|
|
25
|
+
#ifdef RN_FABRIC_ENABLED
|
|
26
|
+
@property (nonatomic) facebook::react::LayoutMetrics oldLayoutMetrics;
|
|
27
|
+
@property (nonatomic) facebook::react::LayoutMetrics newLayoutMetrics;
|
|
28
|
+
#endif // RN_FABRIC_ENABLED
|
|
14
29
|
|
|
15
30
|
@end
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
#import "RNSFullWindowOverlay.h"
|
|
4
|
+
|
|
5
|
+
#ifdef RN_FABRIC_ENABLED
|
|
6
|
+
#import <React/RCTConversions.h>
|
|
7
|
+
#import <React/RCTSurfaceTouchHandler.h>
|
|
8
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
9
|
+
#import <react/renderer/components/rnscreens/Props.h>
|
|
10
|
+
#import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
|
|
11
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
12
|
+
#else
|
|
13
|
+
#import <React/RCTTouchHandler.h>
|
|
14
|
+
#endif // RN_FABRIC_ENABLED
|
|
15
|
+
|
|
16
|
+
@implementation RNSFullWindowOverlayContainer
|
|
17
|
+
|
|
18
|
+
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
|
|
19
|
+
{
|
|
20
|
+
for (UIView *view in [self subviews]) {
|
|
21
|
+
if (view.userInteractionEnabled && [view pointInside:[self convertPoint:point toView:view] withEvent:event]) {
|
|
22
|
+
return YES;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return NO;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@end
|
|
29
|
+
|
|
30
|
+
@implementation RNSFullWindowOverlay {
|
|
31
|
+
__weak RCTBridge *_bridge;
|
|
32
|
+
RNSFullWindowOverlayContainer *_container;
|
|
33
|
+
CGRect _reactFrame;
|
|
34
|
+
#ifdef RN_FABRIC_ENABLED
|
|
35
|
+
RCTSurfaceTouchHandler *_touchHandler;
|
|
36
|
+
#else
|
|
37
|
+
RCTTouchHandler *_touchHandler;
|
|
38
|
+
#endif // RN_FABRIC_ENABLED
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#ifdef RN_FABRIC_ENABLED
|
|
42
|
+
- (instancetype)init
|
|
43
|
+
{
|
|
44
|
+
if (self = [super init]) {
|
|
45
|
+
static const auto defaultProps = std::make_shared<const facebook::react::RNSFullWindowOverlayProps>();
|
|
46
|
+
_props = defaultProps;
|
|
47
|
+
[self _initCommon];
|
|
48
|
+
}
|
|
49
|
+
return self;
|
|
50
|
+
}
|
|
51
|
+
#endif // RN_FABRIC_ENABLED
|
|
52
|
+
|
|
53
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
54
|
+
{
|
|
55
|
+
if (self = [super init]) {
|
|
56
|
+
_bridge = bridge;
|
|
57
|
+
[self _initCommon];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return self;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (void)_initCommon
|
|
64
|
+
{
|
|
65
|
+
_reactFrame = CGRectNull;
|
|
66
|
+
_container = self.container;
|
|
67
|
+
[self show];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
- (void)addSubview:(UIView *)view
|
|
71
|
+
{
|
|
72
|
+
[_container addSubview:view];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
- (RNSFullWindowOverlayContainer *)container
|
|
76
|
+
{
|
|
77
|
+
if (_container == nil) {
|
|
78
|
+
_container = [[RNSFullWindowOverlayContainer alloc] initWithFrame:_reactFrame];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return _container;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
- (void)show
|
|
85
|
+
{
|
|
86
|
+
UIWindow *window = RCTSharedApplication().delegate.window;
|
|
87
|
+
[window addSubview:_container];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
- (void)didMoveToWindow
|
|
91
|
+
{
|
|
92
|
+
if (self.window == nil) {
|
|
93
|
+
if (_container != nil) {
|
|
94
|
+
[_container removeFromSuperview];
|
|
95
|
+
[_touchHandler detachFromView:_container];
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
if (_touchHandler == nil) {
|
|
99
|
+
#ifdef RN_FABRIC_ENABLED
|
|
100
|
+
_touchHandler = [RCTSurfaceTouchHandler new];
|
|
101
|
+
#else
|
|
102
|
+
_touchHandler = [[RCTTouchHandler alloc] initWithBridge:_bridge];
|
|
103
|
+
#endif
|
|
104
|
+
}
|
|
105
|
+
[_touchHandler attachToView:_container];
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
#ifdef RN_FABRIC_ENABLED
|
|
110
|
+
#pragma mark - Fabric Specific
|
|
111
|
+
|
|
112
|
+
// When the component unmounts we remove it from window's children,
|
|
113
|
+
// so when the component gets recycled we need to add it back.
|
|
114
|
+
- (void)maybeShow
|
|
115
|
+
{
|
|
116
|
+
UIWindow *window = RCTSharedApplication().delegate.window;
|
|
117
|
+
if (![[window subviews] containsObject:self]) {
|
|
118
|
+
[window addSubview:_container];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
123
|
+
{
|
|
124
|
+
return facebook::react::concreteComponentDescriptorProvider<
|
|
125
|
+
facebook::react::RNSFullWindowOverlayComponentDescriptor>();
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
- (void)prepareForRecycle
|
|
129
|
+
{
|
|
130
|
+
[_container removeFromSuperview];
|
|
131
|
+
// Due to view recycling we don't really want to set _container = nil
|
|
132
|
+
// as it won't be instantiated when the component appears for the second time.
|
|
133
|
+
// We could consider nulling in here & using container (lazy getter) everywhere else.
|
|
134
|
+
// _container = nil;
|
|
135
|
+
[super prepareForRecycle];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
139
|
+
{
|
|
140
|
+
// When the component unmounts we remove it from window's children,
|
|
141
|
+
// so when the component gets recycled we need to add it back.
|
|
142
|
+
// As for now it is called here as we lack of method that is called
|
|
143
|
+
// just before component gets restored (from recycle pool).
|
|
144
|
+
[self maybeShow];
|
|
145
|
+
[self addSubview:childComponentView];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
149
|
+
{
|
|
150
|
+
[childComponentView removeFromSuperview];
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
- (void)updateLayoutMetrics:(facebook::react::LayoutMetrics const &)layoutMetrics
|
|
154
|
+
oldLayoutMetrics:(facebook::react::LayoutMetrics const &)oldLayoutMetrics
|
|
155
|
+
{
|
|
156
|
+
CGRect frame = RCTCGRectFromRect(layoutMetrics.frame);
|
|
157
|
+
_reactFrame = frame;
|
|
158
|
+
[_container setFrame:frame];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#else
|
|
162
|
+
#pragma mark - Paper specific
|
|
163
|
+
|
|
164
|
+
- (void)reactSetFrame:(CGRect)frame
|
|
165
|
+
{
|
|
166
|
+
_reactFrame = frame;
|
|
167
|
+
[_container setFrame:frame];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
- (void)invalidate
|
|
171
|
+
{
|
|
172
|
+
[_container removeFromSuperview];
|
|
173
|
+
_container = nil;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#endif // RN_FABRIC_ENABLED
|
|
177
|
+
|
|
178
|
+
@end
|
|
179
|
+
|
|
180
|
+
#ifdef RN_FABRIC_ENABLED
|
|
181
|
+
Class<RCTComponentViewProtocol> RNSFullWindowOverlayCls(void)
|
|
182
|
+
{
|
|
183
|
+
return RNSFullWindowOverlay.class;
|
|
184
|
+
}
|
|
185
|
+
#endif // RN_FABRIC_ENABLED
|
|
186
|
+
|
|
187
|
+
@implementation RNSFullWindowOverlayManager
|
|
188
|
+
|
|
189
|
+
RCT_EXPORT_MODULE()
|
|
190
|
+
|
|
191
|
+
#ifdef RN_FABRIC_ENABLED
|
|
192
|
+
#else
|
|
193
|
+
- (UIView *)view
|
|
194
|
+
{
|
|
195
|
+
return [[RNSFullWindowOverlay alloc] initWithBridge:self.bridge];
|
|
196
|
+
}
|
|
197
|
+
#endif // RN_FABRIC_ENABLED
|
|
198
|
+
|
|
199
|
+
@end
|
package/ios/RNSScreen.h
CHANGED
|
@@ -1,59 +1,16 @@
|
|
|
1
1
|
#import <React/RCTComponent.h>
|
|
2
|
-
#import <React/RCTView.h>
|
|
3
2
|
#import <React/RCTViewManager.h>
|
|
4
3
|
|
|
4
|
+
#import "RNSEnums.h"
|
|
5
5
|
#import "RNSScreenContainer.h"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
RNSScreenStackPresentationFormSheet
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
typedef NS_ENUM(NSInteger, RNSScreenStackAnimation) {
|
|
18
|
-
RNSScreenStackAnimationDefault,
|
|
19
|
-
RNSScreenStackAnimationNone,
|
|
20
|
-
RNSScreenStackAnimationFade,
|
|
21
|
-
RNSScreenStackAnimationFadeFromBottom,
|
|
22
|
-
RNSScreenStackAnimationFlip,
|
|
23
|
-
RNSScreenStackAnimationSlideFromBottom,
|
|
24
|
-
RNSScreenStackAnimationSimplePush,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
typedef NS_ENUM(NSInteger, RNSScreenReplaceAnimation) {
|
|
28
|
-
RNSScreenReplaceAnimationPop,
|
|
29
|
-
RNSScreenReplaceAnimationPush,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
typedef NS_ENUM(NSInteger, RNSScreenSwipeDirection) {
|
|
33
|
-
RNSScreenSwipeDirectionHorizontal,
|
|
34
|
-
RNSScreenSwipeDirectionVertical,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
typedef NS_ENUM(NSInteger, RNSActivityState) {
|
|
38
|
-
RNSActivityStateInactive = 0,
|
|
39
|
-
RNSActivityStateTransitioningOrBelowTop = 1,
|
|
40
|
-
RNSActivityStateOnTop = 2
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
typedef NS_ENUM(NSInteger, RNSStatusBarStyle) {
|
|
44
|
-
RNSStatusBarStyleAuto,
|
|
45
|
-
RNSStatusBarStyleInverted,
|
|
46
|
-
RNSStatusBarStyleLight,
|
|
47
|
-
RNSStatusBarStyleDark,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
typedef NS_ENUM(NSInteger, RNSWindowTrait) {
|
|
51
|
-
RNSWindowTraitStyle,
|
|
52
|
-
RNSWindowTraitAnimation,
|
|
53
|
-
RNSWindowTraitHidden,
|
|
54
|
-
RNSWindowTraitOrientation,
|
|
55
|
-
RNSWindowTraitHomeIndicatorHidden,
|
|
56
|
-
};
|
|
7
|
+
#if RN_FABRIC_ENABLED
|
|
8
|
+
#import <React/RCTViewComponentView.h>
|
|
9
|
+
#else
|
|
10
|
+
#import <React/RCTView.h>
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
57
14
|
|
|
58
15
|
@interface RCTConvert (RNSScreen)
|
|
59
16
|
|
|
@@ -62,61 +19,89 @@ typedef NS_ENUM(NSInteger, RNSWindowTrait) {
|
|
|
62
19
|
|
|
63
20
|
#if !TARGET_OS_TV
|
|
64
21
|
+ (RNSStatusBarStyle)RNSStatusBarStyle:(id)json;
|
|
22
|
+
+ (UIStatusBarAnimation)UIStatusBarAnimation:(id)json;
|
|
65
23
|
+ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(id)json;
|
|
66
24
|
#endif
|
|
67
25
|
|
|
68
26
|
@end
|
|
69
27
|
|
|
28
|
+
@class RNSScreenView;
|
|
29
|
+
|
|
70
30
|
@interface RNSScreen : UIViewController <RNScreensViewControllerDelegate>
|
|
71
31
|
|
|
72
32
|
- (instancetype)initWithView:(UIView *)view;
|
|
73
|
-
- (void)notifyFinishTransitioning;
|
|
74
33
|
- (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includingModals:(BOOL)includingModals;
|
|
34
|
+
- (void)notifyFinishTransitioning;
|
|
35
|
+
- (RNSScreenView *)screenView;
|
|
36
|
+
#ifdef RN_FABRIC_ENABLED
|
|
37
|
+
- (void)setViewToSnapshot:(UIView *)snapshot;
|
|
38
|
+
- (void)resetViewToScreen;
|
|
39
|
+
#endif
|
|
75
40
|
|
|
76
41
|
@end
|
|
77
42
|
|
|
78
|
-
@interface
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
@property (nonatomic, copy) RCTDirectEventBlock onAppear;
|
|
85
|
-
@property (nonatomic, copy) RCTDirectEventBlock onDisappear;
|
|
86
|
-
@property (nonatomic, copy) RCTDirectEventBlock onDismissed;
|
|
87
|
-
@property (nonatomic, copy) RCTDirectEventBlock onWillAppear;
|
|
88
|
-
@property (nonatomic, copy) RCTDirectEventBlock onWillDisappear;
|
|
89
|
-
@property (nonatomic, copy) RCTDirectEventBlock onNativeDismissCancelled;
|
|
90
|
-
@property (nonatomic, copy) RCTDirectEventBlock onTransitionProgress;
|
|
43
|
+
@interface RNSScreenView :
|
|
44
|
+
#ifdef RN_FABRIC_ENABLED
|
|
45
|
+
RCTViewComponentView
|
|
46
|
+
#else
|
|
47
|
+
RCTView
|
|
48
|
+
#endif
|
|
91
49
|
|
|
92
|
-
@property (
|
|
93
|
-
@property (nonatomic, retain) UIViewController *controller;
|
|
94
|
-
@property (nonatomic, readonly) BOOL dismissed;
|
|
95
|
-
@property (nonatomic) int activityState;
|
|
50
|
+
@property (nonatomic) BOOL fullScreenSwipeEnabled;
|
|
96
51
|
@property (nonatomic) BOOL gestureEnabled;
|
|
97
|
-
@property (nonatomic)
|
|
98
|
-
@property (nonatomic) RNSScreenStackPresentation stackPresentation;
|
|
99
|
-
@property (nonatomic) RNSScreenReplaceAnimation replaceAnimation;
|
|
100
|
-
@property (nonatomic) RNSScreenSwipeDirection swipeDirection;
|
|
101
|
-
@property (nonatomic) BOOL preventNativeDismiss;
|
|
102
|
-
@property (nonatomic) BOOL hasOrientationSet;
|
|
52
|
+
@property (nonatomic) BOOL hasStatusBarHiddenSet;
|
|
103
53
|
@property (nonatomic) BOOL hasStatusBarStyleSet;
|
|
104
54
|
@property (nonatomic) BOOL hasStatusBarAnimationSet;
|
|
105
|
-
@property (nonatomic) BOOL hasStatusBarHiddenSet;
|
|
106
55
|
@property (nonatomic) BOOL hasHomeIndicatorHiddenSet;
|
|
107
|
-
@property (nonatomic) BOOL
|
|
108
|
-
@property (nonatomic)
|
|
56
|
+
@property (nonatomic) BOOL hasOrientationSet;
|
|
57
|
+
@property (nonatomic) RNSScreenStackAnimation stackAnimation;
|
|
58
|
+
@property (nonatomic) RNSScreenStackPresentation stackPresentation;
|
|
59
|
+
@property (nonatomic) RNSScreenSwipeDirection swipeDirection;
|
|
60
|
+
@property (nonatomic) RNSScreenReplaceAnimation replaceAnimation;
|
|
109
61
|
@property (nonatomic, retain) NSNumber *transitionDuration;
|
|
62
|
+
@property (nonatomic, readonly) BOOL dismissed;
|
|
63
|
+
@property (nonatomic) BOOL hideKeyboardOnSwipe;
|
|
64
|
+
@property (nonatomic) BOOL customAnimationOnSwipe;
|
|
65
|
+
@property (nonatomic) BOOL preventNativeDismiss;
|
|
66
|
+
@property (nonatomic, retain) RNSScreen *controller;
|
|
67
|
+
@property (nonatomic, copy) NSDictionary *gestureResponseDistance;
|
|
68
|
+
@property (nonatomic) int activityState;
|
|
69
|
+
@property (weak, nonatomic) UIView<RNSScreenContainerDelegate> *reactSuperview;
|
|
110
70
|
|
|
111
71
|
#if !TARGET_OS_TV
|
|
112
72
|
@property (nonatomic) RNSStatusBarStyle statusBarStyle;
|
|
113
73
|
@property (nonatomic) UIStatusBarAnimation statusBarAnimation;
|
|
114
|
-
@property (nonatomic) BOOL statusBarHidden;
|
|
115
74
|
@property (nonatomic) UIInterfaceOrientationMask screenOrientation;
|
|
75
|
+
@property (nonatomic) BOOL statusBarHidden;
|
|
116
76
|
@property (nonatomic) BOOL homeIndicatorHidden;
|
|
117
77
|
#endif
|
|
118
78
|
|
|
79
|
+
#ifdef RN_FABRIC_ENABLED
|
|
80
|
+
// we recreate the behavior of `reactSetFrame` on new architecture
|
|
81
|
+
@property (nonatomic) facebook::react::LayoutMetrics oldLayoutMetrics;
|
|
82
|
+
@property (nonatomic) facebook::react::LayoutMetrics newLayoutMetrics;
|
|
83
|
+
@property (weak, nonatomic) UIView *config;
|
|
84
|
+
#else
|
|
85
|
+
@property (nonatomic, copy) RCTDirectEventBlock onAppear;
|
|
86
|
+
@property (nonatomic, copy) RCTDirectEventBlock onDisappear;
|
|
87
|
+
@property (nonatomic, copy) RCTDirectEventBlock onDismissed;
|
|
88
|
+
@property (nonatomic, copy) RCTDirectEventBlock onWillAppear;
|
|
89
|
+
@property (nonatomic, copy) RCTDirectEventBlock onWillDisappear;
|
|
90
|
+
@property (nonatomic, copy) RCTDirectEventBlock onNativeDismissCancelled;
|
|
91
|
+
@property (nonatomic, copy) RCTDirectEventBlock onTransitionProgress;
|
|
92
|
+
#endif
|
|
93
|
+
|
|
119
94
|
- (void)notifyFinishTransitioning;
|
|
95
|
+
|
|
96
|
+
#ifdef RN_FABRIC_ENABLED
|
|
97
|
+
- (void)notifyWillAppear;
|
|
98
|
+
- (void)notifyWillDisappear;
|
|
99
|
+
- (void)notifyAppear;
|
|
100
|
+
- (void)notifyDisappear;
|
|
101
|
+
- (void)updateBounds;
|
|
102
|
+
- (void)notifyDismissedWithCount:(int)dismissCount;
|
|
103
|
+
#endif
|
|
104
|
+
|
|
120
105
|
- (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingForward:(BOOL)goingForward;
|
|
121
106
|
|
|
122
107
|
@end
|
|
@@ -124,3 +109,9 @@ typedef NS_ENUM(NSInteger, RNSWindowTrait) {
|
|
|
124
109
|
@interface UIView (RNSScreen)
|
|
125
110
|
- (UIViewController *)parentViewController;
|
|
126
111
|
@end
|
|
112
|
+
|
|
113
|
+
@interface RNSScreenManager : RCTViewManager
|
|
114
|
+
|
|
115
|
+
@end
|
|
116
|
+
|
|
117
|
+
NS_ASSUME_NONNULL_END
|