react-native-screens 4.11.0-beta.1 → 4.11.0-beta.2
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/RNScreens.podspec +3 -1
- package/common/cpp/react/renderer/components/rnscreens/RNSScreenShadowNode.cpp +1 -2
- package/ios/RNSConvert.mm +44 -47
- package/ios/RNSFullWindowOverlay.h +2 -0
- package/ios/RNSFullWindowOverlay.mm +32 -8
- package/ios/RNSScreen.mm +20 -34
- package/ios/RNSScreenStack.mm +6 -8
- package/ios/RNSScreenStackHeaderConfig.mm +120 -223
- package/ios/RNSScreenWindowTraits.mm +19 -37
- package/ios/RNSSearchBar.mm +15 -24
- package/lib/commonjs/components/FullWindowOverlay.js +2 -1
- package/lib/commonjs/components/FullWindowOverlay.js.map +1 -1
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/module/components/FullWindowOverlay.js +2 -1
- package/lib/module/components/FullWindowOverlay.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +3 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -1
- package/lib/typescript/components/FullWindowOverlay.d.ts +4 -2
- package/lib/typescript/components/FullWindowOverlay.d.ts.map +1 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts +3 -1
- package/lib/typescript/fabric/FullWindowOverlayNativeComponent.d.ts.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +1 -1
- package/lib/typescript/types.d.ts +2 -2
- package/native-stack/README.md +2 -2
- package/package.json +1 -1
- package/src/components/FullWindowOverlay.tsx +14 -3
- package/src/fabric/FullWindowOverlayNativeComponent.ts +5 -1
- package/src/native-stack/types.tsx +1 -1
- package/src/types.tsx +2 -2
package/RNScreens.podspec
CHANGED
|
@@ -4,6 +4,8 @@ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
|
4
4
|
|
|
5
5
|
new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
6
6
|
min_supported_ios_version = new_arch_enabled ? "15.1" : "15.1"
|
|
7
|
+
min_supported_tvos_version = "15.1"
|
|
8
|
+
min_supported_visionos_version = "1.0"
|
|
7
9
|
source_files = new_arch_enabled ? 'ios/**/*.{h,m,mm,cpp}' : ["ios/**/*.{h,m,mm}", "cpp/RNScreensTurboModule.cpp", "cpp/RNScreensTurboModule.h"]
|
|
8
10
|
|
|
9
11
|
Pod::Spec.new do |s|
|
|
@@ -16,7 +18,7 @@ Pod::Spec.new do |s|
|
|
|
16
18
|
s.homepage = "https://github.com/software-mansion/react-native-screens"
|
|
17
19
|
s.license = "MIT"
|
|
18
20
|
s.author = { "author" => "author@domain.cn" }
|
|
19
|
-
s.platforms = { :ios => min_supported_ios_version, :tvos =>
|
|
21
|
+
s.platforms = { :ios => min_supported_ios_version, :tvos => min_supported_tvos_version, :visionos => min_supported_visionos_version }
|
|
20
22
|
s.source = { :git => "https://github.com/software-mansion/react-native-screens.git", :tag => "#{s.version}" }
|
|
21
23
|
s.source_files = source_files
|
|
22
24
|
s.project_header_files = "cpp/**/*.h" # Don't expose C++ headers publicly to allow importing framework into Swift files
|
|
@@ -11,8 +11,7 @@ extern const char RNSScreenComponentName[] = "RNSScreen";
|
|
|
11
11
|
Point RNSScreenShadowNode::getContentOriginOffset(
|
|
12
12
|
bool /*includeTransform*/) const {
|
|
13
13
|
auto stateData = getStateData();
|
|
14
|
-
|
|
15
|
-
return {contentOffset.x, contentOffset.y};
|
|
14
|
+
return stateData.contentOffset;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
std::optional<std::reference_wrapper<const ShadowNode::Shared>>
|
package/ios/RNSConvert.mm
CHANGED
|
@@ -195,53 +195,50 @@
|
|
|
195
195
|
+ (RNSBlurEffectStyle)RNSBlurEffectStyleFromCppEquivalent:(react::RNSScreenStackHeaderConfigBlurEffect)blurEffect
|
|
196
196
|
{
|
|
197
197
|
using enum react::RNSScreenStackHeaderConfigBlurEffect;
|
|
198
|
-
#if !TARGET_OS_TV
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
case SystemChromeMaterialDark:
|
|
243
|
-
return RNSBlurEffectStyleSystemChromeMaterialDark;
|
|
244
|
-
}
|
|
198
|
+
#if !TARGET_OS_TV
|
|
199
|
+
switch (blurEffect) {
|
|
200
|
+
case None:
|
|
201
|
+
return RNSBlurEffectStyleNone;
|
|
202
|
+
case ExtraLight:
|
|
203
|
+
return RNSBlurEffectStyleExtraLight;
|
|
204
|
+
case Light:
|
|
205
|
+
return RNSBlurEffectStyleLight;
|
|
206
|
+
case Dark:
|
|
207
|
+
return RNSBlurEffectStyleDark;
|
|
208
|
+
case Regular:
|
|
209
|
+
return RNSBlurEffectStyleRegular;
|
|
210
|
+
case Prominent:
|
|
211
|
+
return RNSBlurEffectStyleProminent;
|
|
212
|
+
case SystemUltraThinMaterial:
|
|
213
|
+
return RNSBlurEffectStyleSystemUltraThinMaterial;
|
|
214
|
+
case SystemThinMaterial:
|
|
215
|
+
return RNSBlurEffectStyleSystemThinMaterial;
|
|
216
|
+
case SystemMaterial:
|
|
217
|
+
return RNSBlurEffectStyleSystemMaterial;
|
|
218
|
+
case SystemThickMaterial:
|
|
219
|
+
return RNSBlurEffectStyleSystemThickMaterial;
|
|
220
|
+
case SystemChromeMaterial:
|
|
221
|
+
return RNSBlurEffectStyleSystemChromeMaterial;
|
|
222
|
+
case SystemUltraThinMaterialLight:
|
|
223
|
+
return RNSBlurEffectStyleSystemUltraThinMaterialLight;
|
|
224
|
+
case SystemThinMaterialLight:
|
|
225
|
+
return RNSBlurEffectStyleSystemThinMaterialLight;
|
|
226
|
+
case SystemMaterialLight:
|
|
227
|
+
return RNSBlurEffectStyleSystemMaterialLight;
|
|
228
|
+
case SystemThickMaterialLight:
|
|
229
|
+
return RNSBlurEffectStyleSystemThickMaterialLight;
|
|
230
|
+
case SystemChromeMaterialLight:
|
|
231
|
+
return RNSBlurEffectStyleSystemChromeMaterialLight;
|
|
232
|
+
case SystemUltraThinMaterialDark:
|
|
233
|
+
return RNSBlurEffectStyleSystemUltraThinMaterialDark;
|
|
234
|
+
case SystemThinMaterialDark:
|
|
235
|
+
return RNSBlurEffectStyleSystemThinMaterialDark;
|
|
236
|
+
case SystemMaterialDark:
|
|
237
|
+
return RNSBlurEffectStyleSystemMaterialDark;
|
|
238
|
+
case SystemThickMaterialDark:
|
|
239
|
+
return RNSBlurEffectStyleSystemThickMaterialDark;
|
|
240
|
+
case SystemChromeMaterialDark:
|
|
241
|
+
return RNSBlurEffectStyleSystemChromeMaterialDark;
|
|
245
242
|
}
|
|
246
243
|
#endif
|
|
247
244
|
|
|
@@ -26,6 +26,8 @@ namespace react = facebook::react;
|
|
|
26
26
|
RCTView <RCTInvalidating>
|
|
27
27
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
28
28
|
|
|
29
|
+
@property (nonatomic) BOOL accessibilityContainerViewIsModal;
|
|
30
|
+
|
|
29
31
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
30
32
|
@property (nonatomic) react::LayoutMetrics oldLayoutMetrics;
|
|
31
33
|
@property (nonatomic) react::LayoutMetrics newLayoutMetrics;
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
@implementation RNSFullWindowOverlayContainer
|
|
19
19
|
|
|
20
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
20
|
+
- (instancetype)initWithFrame:(CGRect)frame accessibilityViewIsModal:(BOOL)accessibilityViewIsModal
|
|
21
21
|
{
|
|
22
22
|
if (self = [super initWithFrame:frame]) {
|
|
23
|
-
self.accessibilityViewIsModal =
|
|
23
|
+
self.accessibilityViewIsModal = accessibilityViewIsModal;
|
|
24
24
|
}
|
|
25
25
|
return self;
|
|
26
26
|
}
|
|
@@ -92,29 +92,37 @@
|
|
|
92
92
|
if (self = [super init]) {
|
|
93
93
|
static const auto defaultProps = std::make_shared<const react::RNSFullWindowOverlayProps>();
|
|
94
94
|
_props = defaultProps;
|
|
95
|
-
[self
|
|
95
|
+
[self initCommonProps];
|
|
96
96
|
}
|
|
97
97
|
return self;
|
|
98
98
|
}
|
|
99
|
-
#
|
|
100
|
-
|
|
99
|
+
#else
|
|
101
100
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
102
101
|
{
|
|
103
102
|
if (self = [super init]) {
|
|
104
103
|
_bridge = bridge;
|
|
105
|
-
[self
|
|
104
|
+
[self initCommonProps];
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
return self;
|
|
109
108
|
}
|
|
109
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
110
110
|
|
|
111
|
-
- (void)
|
|
111
|
+
- (void)initCommonProps
|
|
112
112
|
{
|
|
113
|
+
// Default value used by container.
|
|
114
|
+
_accessibilityContainerViewIsModal = YES;
|
|
113
115
|
_reactFrame = CGRectNull;
|
|
114
116
|
_container = self.container;
|
|
115
117
|
[self show];
|
|
116
118
|
}
|
|
117
119
|
|
|
120
|
+
- (void)setAccessibilityContainerViewIsModal:(BOOL)accessibilityContainerViewIsModal
|
|
121
|
+
{
|
|
122
|
+
_accessibilityContainerViewIsModal = accessibilityContainerViewIsModal;
|
|
123
|
+
self.container.accessibilityViewIsModal = accessibilityContainerViewIsModal;
|
|
124
|
+
}
|
|
125
|
+
|
|
118
126
|
- (void)addSubview:(UIView *)view
|
|
119
127
|
{
|
|
120
128
|
[_container addSubview:view];
|
|
@@ -123,7 +131,8 @@
|
|
|
123
131
|
- (RNSFullWindowOverlayContainer *)container
|
|
124
132
|
{
|
|
125
133
|
if (_container == nil) {
|
|
126
|
-
_container = [[RNSFullWindowOverlayContainer alloc] initWithFrame:_reactFrame
|
|
134
|
+
_container = [[RNSFullWindowOverlayContainer alloc] initWithFrame:_reactFrame
|
|
135
|
+
accessibilityViewIsModal:_accessibilityContainerViewIsModal];
|
|
127
136
|
}
|
|
128
137
|
|
|
129
138
|
return _container;
|
|
@@ -220,6 +229,19 @@ RNS_IGNORE_SUPER_CALL_BEGIN
|
|
|
220
229
|
|
|
221
230
|
RNS_IGNORE_SUPER_CALL_END
|
|
222
231
|
|
|
232
|
+
- (void)updateProps:(const facebook::react::Props::Shared &)props
|
|
233
|
+
oldProps:(const facebook::react::Props::Shared &)oldProps
|
|
234
|
+
{
|
|
235
|
+
const auto &oldComponentProps = *std::static_pointer_cast<const react::RNSFullWindowOverlayProps>(_props);
|
|
236
|
+
const auto &newComponentProps = *std::static_pointer_cast<const react::RNSFullWindowOverlayProps>(props);
|
|
237
|
+
|
|
238
|
+
if (newComponentProps.accessibilityContainerViewIsModal != oldComponentProps.accessibilityContainerViewIsModal) {
|
|
239
|
+
[self setAccessibilityContainerViewIsModal:newComponentProps.accessibilityContainerViewIsModal];
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
[super updateProps:props oldProps:oldProps];
|
|
243
|
+
}
|
|
244
|
+
|
|
223
245
|
#else
|
|
224
246
|
#pragma mark - Paper specific
|
|
225
247
|
|
|
@@ -250,6 +272,8 @@ Class<RCTComponentViewProtocol> RNSFullWindowOverlayCls(void)
|
|
|
250
272
|
|
|
251
273
|
RCT_EXPORT_MODULE()
|
|
252
274
|
|
|
275
|
+
RCT_EXPORT_VIEW_PROPERTY(accessibilityContainerViewIsModal, BOOL)
|
|
276
|
+
|
|
253
277
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
254
278
|
#else
|
|
255
279
|
- (UIView *)view
|
package/ios/RNSScreen.mm
CHANGED
|
@@ -151,12 +151,20 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
151
151
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
152
152
|
if (_state != nullptr) {
|
|
153
153
|
RNSScreenStackHeaderConfig *config = [self findHeaderConfig];
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
|
|
155
|
+
// in large title, ScrollView handles the offset of content so we cannot set it here also
|
|
156
|
+
// TODO: Why is it assumed in comment above, that large title uses scrollview here? What if only SafeAreaView is
|
|
157
|
+
// used?
|
|
158
|
+
// When config.translucent == true, we currently use `edgesForExtendedLayout` and the screen is laid out under the
|
|
159
|
+
// navigation bar, therefore there is no need to set content offset in shadow tree.
|
|
160
|
+
const CGFloat effectiveContentOffsetY = config.largeTitle || config.translucent
|
|
161
|
+
? 0
|
|
162
|
+
: [_controller calculateHeaderHeightIsModal:self.isPresentedAsNativeModal];
|
|
163
|
+
|
|
164
|
+
auto newState = react::RNSScreenState{RCTSizeFromCGSize(self.bounds.size), {0, effectiveContentOffsetY}};
|
|
159
165
|
_state->updateState(std::move(newState));
|
|
166
|
+
|
|
167
|
+
// TODO: Requesting layout on every layout is wrong. We should look for a way to get rid of this.
|
|
160
168
|
UINavigationController *navctr = _controller.navigationController;
|
|
161
169
|
[navctr.view setNeedsLayout];
|
|
162
170
|
}
|
|
@@ -237,16 +245,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
237
245
|
{
|
|
238
246
|
switch (stackPresentation) {
|
|
239
247
|
case RNSScreenStackPresentationModal:
|
|
240
|
-
|
|
241
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
242
|
-
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
|
243
|
-
_controller.modalPresentationStyle = UIModalPresentationAutomatic;
|
|
244
|
-
} else {
|
|
245
|
-
_controller.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
246
|
-
}
|
|
247
|
-
#else
|
|
248
|
-
_controller.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
249
|
-
#endif
|
|
248
|
+
_controller.modalPresentationStyle = UIModalPresentationAutomatic;
|
|
250
249
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_17_0) && \
|
|
251
250
|
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_17_0 && !TARGET_OS_TV
|
|
252
251
|
if (@available(iOS 18.0, *)) {
|
|
@@ -337,12 +336,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
337
336
|
|
|
338
337
|
- (void)setGestureEnabled:(BOOL)gestureEnabled
|
|
339
338
|
{
|
|
340
|
-
|
|
341
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
342
|
-
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
|
343
|
-
_controller.modalInPresentation = !gestureEnabled;
|
|
344
|
-
}
|
|
345
|
-
#endif
|
|
339
|
+
_controller.modalInPresentation = !gestureEnabled;
|
|
346
340
|
|
|
347
341
|
_gestureEnabled = gestureEnabled;
|
|
348
342
|
}
|
|
@@ -753,8 +747,6 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
753
747
|
return _gestureEnabled;
|
|
754
748
|
}
|
|
755
749
|
|
|
756
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
757
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
758
750
|
- (void)presentationControllerDidAttemptToDismiss:(UIPresentationController *)presentationController
|
|
759
751
|
{
|
|
760
752
|
// NOTE(kkafar): We should consider depracating the use of gesture cancel here & align
|
|
@@ -764,7 +756,6 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
764
756
|
[self notifyDismissCancelledWithDismissCount:1];
|
|
765
757
|
}
|
|
766
758
|
}
|
|
767
|
-
#endif
|
|
768
759
|
|
|
769
760
|
- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController
|
|
770
761
|
{
|
|
@@ -1572,18 +1563,12 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
1572
1563
|
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
1573
1564
|
CGSize fallbackStatusBarSize = [[UIApplication sharedApplication] statusBarFrame].size;
|
|
1574
1565
|
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
if (@available(iOS 13.0, *)) {
|
|
1578
|
-
CGSize primaryStatusBarSize = self.view.window.windowScene.statusBarManager.statusBarFrame.size;
|
|
1579
|
-
if (primaryStatusBarSize.height == 0 || primaryStatusBarSize.width == 0)
|
|
1580
|
-
return fallbackStatusBarSize;
|
|
1581
|
-
|
|
1582
|
-
return primaryStatusBarSize;
|
|
1583
|
-
} else {
|
|
1566
|
+
CGSize primaryStatusBarSize = self.view.window.windowScene.statusBarManager.statusBarFrame.size;
|
|
1567
|
+
if (primaryStatusBarSize.height == 0 || primaryStatusBarSize.width == 0) {
|
|
1584
1568
|
return fallbackStatusBarSize;
|
|
1585
1569
|
}
|
|
1586
|
-
|
|
1570
|
+
|
|
1571
|
+
return primaryStatusBarSize;
|
|
1587
1572
|
|
|
1588
1573
|
#else
|
|
1589
1574
|
// TVOS does not have status bar.
|
|
@@ -1914,6 +1899,7 @@ Class<RCTComponentViewProtocol> RNSScreenCls(void)
|
|
|
1914
1899
|
// if we dismissed the view natively, it will already be detached from view hierarchy
|
|
1915
1900
|
if (self.view.window != nil) {
|
|
1916
1901
|
UIView *snapshot = [self.view snapshotViewAfterScreenUpdates:NO];
|
|
1902
|
+
snapshot.frame = self.view.frame;
|
|
1917
1903
|
[self.view removeFromSuperview];
|
|
1918
1904
|
self.view = snapshot;
|
|
1919
1905
|
[superView addSubview:snapshot];
|
package/ios/RNSScreenStack.mm
CHANGED
|
@@ -492,14 +492,9 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
492
492
|
UIViewController *next = controllers[i];
|
|
493
493
|
BOOL lastModal = (i == controllers.count - 1);
|
|
494
494
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
// Inherit UI style from its parent - solves an issue with incorrect style being applied to some UIKit views
|
|
499
|
-
// like date picker or segmented control.
|
|
500
|
-
next.overrideUserInterfaceStyle = self->_controller.overrideUserInterfaceStyle;
|
|
501
|
-
}
|
|
502
|
-
#endif
|
|
495
|
+
// Inherit UI style from its parent - solves an issue with incorrect style being applied to some UIKit views
|
|
496
|
+
// like date picker or segmented control.
|
|
497
|
+
next.overrideUserInterfaceStyle = self->_controller.overrideUserInterfaceStyle;
|
|
503
498
|
|
|
504
499
|
BOOL shouldAnimate = lastModal && [next isKindOfClass:[RNSScreen class]] &&
|
|
505
500
|
((RNSScreen *)next).screenView.stackAnimation != RNSScreenStackAnimationNone;
|
|
@@ -1234,6 +1229,9 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
1234
1229
|
withSurfaceTelemetry:(const facebook::react::SurfaceTelemetry &)surfaceTelemetry
|
|
1235
1230
|
{
|
|
1236
1231
|
for (const auto &mutation : transaction.getMutations()) {
|
|
1232
|
+
// Note that self.tag might be invalid in cases this stack is removed.
|
|
1233
|
+
// This mostlikely does not cause any problems now, but it is something
|
|
1234
|
+
// worth to be aware of.
|
|
1237
1235
|
if (MUTATION_PARENT_TAG(mutation) == self.tag &&
|
|
1238
1236
|
(mutation.type == react::ShadowViewMutation::Type::Insert ||
|
|
1239
1237
|
mutation.type == react::ShadowViewMutation::Type::Remove)) {
|
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
namespace react = facebook::react;
|
|
36
36
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
static constexpr auto DEFAULT_TITLE_FONT_SIZE = @17;
|
|
39
|
+
static constexpr auto DEFAULT_TITLE_LARGE_FONT_SIZE = @34;
|
|
40
|
+
|
|
41
|
+
#if !defined(RCT_NEW_ARCH_ENABLED)
|
|
39
42
|
// Some RN private method hacking below. Couldn't figure out better way to access image data
|
|
40
43
|
// of a given RCTImageView. See more comments in the code section processing SubviewTypeBackButton
|
|
41
44
|
@interface RCTImageView (Private)
|
|
@@ -276,96 +279,9 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
276
279
|
+ (void)setAnimatedConfig:(UIViewController *)vc withConfig:(RNSScreenStackHeaderConfig *)config
|
|
277
280
|
{
|
|
278
281
|
UINavigationBar *navbar = ((UINavigationController *)vc.parentViewController).navigationBar;
|
|
279
|
-
// It is workaround for loading custom back icon when transitioning from a screen without header to the screen which
|
|
280
|
-
// has one. This action fails when navigating to the screen with header for the second time and loads default back
|
|
281
|
-
// button. It looks like changing the tint color of navbar triggers an update of the items belonging to it and it
|
|
282
|
-
// seems to load the custom back image so we change the tint color's alpha by a very small amount and then set it to
|
|
283
|
-
// the one it should have.
|
|
284
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_14_0) && \
|
|
285
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0
|
|
286
|
-
// it brakes the behavior of `headerRight` in iOS 14, where the bug desribed above seems to be fixed, so we do nothing
|
|
287
|
-
// in iOS 14
|
|
288
|
-
if (@available(iOS 14.0, *)) {
|
|
289
|
-
} else
|
|
290
|
-
#endif
|
|
291
|
-
{
|
|
292
|
-
[navbar setTintColor:[config.color colorWithAlphaComponent:CGColorGetAlpha(config.color.CGColor) - 0.01]];
|
|
293
|
-
}
|
|
294
282
|
[navbar setTintColor:config.color];
|
|
295
283
|
|
|
296
|
-
|
|
297
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
298
|
-
if (@available(iOS 13.0, *)) {
|
|
299
|
-
// font customized on the navigation item level, so nothing to do here
|
|
300
|
-
} else
|
|
301
|
-
#endif
|
|
302
|
-
{
|
|
303
|
-
BOOL hideShadow = config.hideShadow;
|
|
304
|
-
|
|
305
|
-
if (config.backgroundColor && CGColorGetAlpha(config.backgroundColor.CGColor) == 0.) {
|
|
306
|
-
[navbar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
|
307
|
-
[navbar setBarTintColor:[UIColor clearColor]];
|
|
308
|
-
hideShadow = YES;
|
|
309
|
-
} else {
|
|
310
|
-
[navbar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
|
|
311
|
-
[navbar setBarTintColor:config.backgroundColor];
|
|
312
|
-
}
|
|
313
|
-
[navbar setTranslucent:config.translucent];
|
|
314
|
-
[navbar setValue:@(hideShadow ? YES : NO) forKey:@"hidesShadow"];
|
|
315
|
-
|
|
316
|
-
if (config.titleFontFamily || config.titleFontSize || config.titleFontWeight || config.titleColor) {
|
|
317
|
-
NSMutableDictionary *attrs = [NSMutableDictionary new];
|
|
318
|
-
|
|
319
|
-
if (config.titleColor) {
|
|
320
|
-
attrs[NSForegroundColorAttributeName] = config.titleColor;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
NSString *family = config.titleFontFamily ?: nil;
|
|
324
|
-
NSNumber *size = config.titleFontSize ?: @17;
|
|
325
|
-
NSString *weight = config.titleFontWeight ?: nil;
|
|
326
|
-
if (family || weight) {
|
|
327
|
-
attrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
328
|
-
withFamily:family
|
|
329
|
-
size:size
|
|
330
|
-
weight:weight
|
|
331
|
-
style:nil
|
|
332
|
-
variant:nil
|
|
333
|
-
scaleMultiplier:1.0];
|
|
334
|
-
} else {
|
|
335
|
-
attrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:[size floatValue]];
|
|
336
|
-
}
|
|
337
|
-
[navbar setTitleTextAttributes:attrs];
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
341
|
-
if (@available(iOS 11.0, *)) {
|
|
342
|
-
if (config.largeTitle &&
|
|
343
|
-
(config.largeTitleFontFamily || config.largeTitleFontSize || config.largeTitleFontWeight ||
|
|
344
|
-
config.largeTitleColor || config.titleColor)) {
|
|
345
|
-
NSMutableDictionary *largeAttrs = [NSMutableDictionary new];
|
|
346
|
-
if (config.largeTitleColor || config.titleColor) {
|
|
347
|
-
largeAttrs[NSForegroundColorAttributeName] =
|
|
348
|
-
config.largeTitleColor ? config.largeTitleColor : config.titleColor;
|
|
349
|
-
}
|
|
350
|
-
NSString *largeFamily = config.largeTitleFontFamily ?: nil;
|
|
351
|
-
NSNumber *largeSize = config.largeTitleFontSize ?: @34;
|
|
352
|
-
NSString *largeWeight = config.largeTitleFontWeight ?: nil;
|
|
353
|
-
if (largeFamily || largeWeight) {
|
|
354
|
-
largeAttrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
355
|
-
withFamily:largeFamily
|
|
356
|
-
size:largeSize
|
|
357
|
-
weight:largeWeight
|
|
358
|
-
style:nil
|
|
359
|
-
variant:nil
|
|
360
|
-
scaleMultiplier:1.0];
|
|
361
|
-
} else {
|
|
362
|
-
largeAttrs[NSFontAttributeName] = [UIFont systemFontOfSize:[largeSize floatValue] weight:UIFontWeightBold];
|
|
363
|
-
}
|
|
364
|
-
[navbar setLargeTitleTextAttributes:largeAttrs];
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
#endif
|
|
368
|
-
}
|
|
284
|
+
// font customized on the navigation item level, so nothing to do here
|
|
369
285
|
}
|
|
370
286
|
|
|
371
287
|
+ (void)setTitleAttibutes:(NSDictionary *)attrs forButton:(UIBarButtonItem *)button
|
|
@@ -476,8 +392,6 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
476
392
|
}
|
|
477
393
|
}
|
|
478
394
|
|
|
479
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
480
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0
|
|
481
395
|
+ (UINavigationBarAppearance *)buildAppearance:(UIViewController *)vc
|
|
482
396
|
withConfig:(RNSScreenStackHeaderConfig *)config API_AVAILABLE(ios(13.0))
|
|
483
397
|
{
|
|
@@ -525,7 +439,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
525
439
|
#endif
|
|
526
440
|
|
|
527
441
|
NSString *family = config.titleFontFamily ?: nil;
|
|
528
|
-
NSNumber *size = config.titleFontSize ?:
|
|
442
|
+
NSNumber *size = config.titleFontSize ?: DEFAULT_TITLE_FONT_SIZE;
|
|
529
443
|
NSString *weight = config.titleFontWeight ?: nil;
|
|
530
444
|
if (family || weight) {
|
|
531
445
|
attrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
@@ -553,7 +467,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
553
467
|
#endif
|
|
554
468
|
|
|
555
469
|
NSString *largeFamily = config.largeTitleFontFamily ?: nil;
|
|
556
|
-
NSNumber *largeSize = config.largeTitleFontSize ?:
|
|
470
|
+
NSNumber *largeSize = config.largeTitleFontSize ?: DEFAULT_TITLE_LARGE_FONT_SIZE;
|
|
557
471
|
NSString *largeWeight = config.largeTitleFontWeight ?: nil;
|
|
558
472
|
if (largeFamily || largeWeight) {
|
|
559
473
|
largeAttrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
@@ -578,7 +492,6 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
578
492
|
}
|
|
579
493
|
return appearance;
|
|
580
494
|
}
|
|
581
|
-
#endif // Check for >= iOS 13.0
|
|
582
495
|
|
|
583
496
|
+ (void)updateViewController:(UIViewController *)vc
|
|
584
497
|
withConfig:(RNSScreenStackHeaderConfig *)config
|
|
@@ -603,7 +516,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
603
516
|
BOOL shouldHide = config == nil || !config.shouldHeaderBeVisible;
|
|
604
517
|
|
|
605
518
|
if (!shouldHide && !config.translucent) {
|
|
606
|
-
// when nav bar is not translucent we
|
|
519
|
+
// when nav bar is not translucent we change edgesForExtendedLayout to avoid system laying out
|
|
607
520
|
// the screen underneath navigation controllers
|
|
608
521
|
vc.edgesForExtendedLayout = UIRectEdgeNone;
|
|
609
522
|
} else {
|
|
@@ -621,118 +534,44 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
621
534
|
}
|
|
622
535
|
|
|
623
536
|
#if !TARGET_OS_TV
|
|
624
|
-
|
|
625
|
-
NSString *resolvedBackTitle = isBackTitleBlank ? prevItem.title : config.backTitle;
|
|
626
|
-
RNSUIBarButtonItem *backBarButtonItem = [[RNSUIBarButtonItem alloc] initWithTitle:resolvedBackTitle
|
|
627
|
-
style:UIBarButtonItemStylePlain
|
|
628
|
-
target:nil
|
|
629
|
-
action:nil];
|
|
630
|
-
[backBarButtonItem setMenuHidden:config.disableBackButtonMenu];
|
|
631
|
-
|
|
632
|
-
auto shouldUseCustomBackBarButtonItem = !isBackTitleBlank || config.disableBackButtonMenu;
|
|
633
|
-
|
|
634
|
-
// This has any effect only in case the `backBarButtonItem` is not set.
|
|
635
|
-
// We apply it before we configure the back item, because it might get overriden.
|
|
636
|
-
prevItem.backButtonDisplayMode = config.backButtonDisplayMode;
|
|
637
|
-
|
|
638
|
-
if (config.isBackTitleVisible) {
|
|
639
|
-
if ((config.backTitleFontFamily &&
|
|
640
|
-
// While being used by react-navigation, the `backTitleFontFamily` will
|
|
641
|
-
// be set to "System" by default - which is the system default font.
|
|
642
|
-
// To avoid always considering the font as customized, we need to have an additional check.
|
|
643
|
-
// See: https://github.com/software-mansion/react-native-screens/pull/2105#discussion_r1565222738
|
|
644
|
-
![config.backTitleFontFamily isEqual:@"System"]) ||
|
|
645
|
-
config.backTitleFontSize) {
|
|
646
|
-
shouldUseCustomBackBarButtonItem = YES;
|
|
647
|
-
NSMutableDictionary *attrs = [NSMutableDictionary new];
|
|
648
|
-
NSNumber *size = config.backTitleFontSize ?: @17;
|
|
649
|
-
if (config.backTitleFontFamily) {
|
|
650
|
-
attrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
651
|
-
withFamily:config.backTitleFontFamily
|
|
652
|
-
size:size
|
|
653
|
-
weight:nil
|
|
654
|
-
style:nil
|
|
655
|
-
variant:nil
|
|
656
|
-
scaleMultiplier:1.0];
|
|
657
|
-
} else {
|
|
658
|
-
attrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:[size floatValue]];
|
|
659
|
-
}
|
|
660
|
-
[self setTitleAttibutes:attrs forButton:backBarButtonItem];
|
|
661
|
-
}
|
|
662
|
-
} else {
|
|
663
|
-
// back button title should be not visible next to back button,
|
|
664
|
-
// but it should still appear in back menu (if one is enabled)
|
|
665
|
-
|
|
666
|
-
prevItem.backButtonTitle = resolvedBackTitle;
|
|
667
|
-
prevItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal;
|
|
668
|
-
shouldUseCustomBackBarButtonItem = NO;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
// Prevent unnecessary assignment of backBarButtonItem if it is not customized,
|
|
672
|
-
// as assigning one will override the native behavior of automatically shortening
|
|
673
|
-
// the title to "Back" or hide the back title if there's not enough space.
|
|
674
|
-
// See: https://github.com/software-mansion/react-native-screens/issues/1589
|
|
675
|
-
if (shouldUseCustomBackBarButtonItem) {
|
|
676
|
-
prevItem.backBarButtonItem = backBarButtonItem;
|
|
677
|
-
}
|
|
537
|
+
[config configureBackItem:prevItem];
|
|
678
538
|
|
|
679
|
-
if (
|
|
680
|
-
|
|
681
|
-
navctr.navigationBar.prefersLargeTitles = YES;
|
|
682
|
-
}
|
|
683
|
-
navitem.largeTitleDisplayMode =
|
|
684
|
-
config.largeTitle ? UINavigationItemLargeTitleDisplayModeAlways : UINavigationItemLargeTitleDisplayModeNever;
|
|
539
|
+
if (config.largeTitle) {
|
|
540
|
+
navctr.navigationBar.prefersLargeTitles = YES;
|
|
685
541
|
}
|
|
542
|
+
navitem.largeTitleDisplayMode =
|
|
543
|
+
config.largeTitle ? UINavigationItemLargeTitleDisplayModeAlways : UINavigationItemLargeTitleDisplayModeNever;
|
|
686
544
|
#endif
|
|
687
545
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
UINavigationBarAppearance *appearance = [self buildAppearance:vc withConfig:config];
|
|
692
|
-
navitem.standardAppearance = appearance;
|
|
693
|
-
navitem.compactAppearance = appearance;
|
|
546
|
+
UINavigationBarAppearance *appearance = [self buildAppearance:vc withConfig:config];
|
|
547
|
+
navitem.standardAppearance = appearance;
|
|
548
|
+
navitem.compactAppearance = appearance;
|
|
694
549
|
|
|
695
550
|
// appearance does not apply to the tvOS so we need to use lagacy customization
|
|
696
551
|
#if TARGET_OS_TV
|
|
697
|
-
|
|
698
|
-
|
|
552
|
+
navctr.navigationBar.titleTextAttributes = appearance.titleTextAttributes;
|
|
553
|
+
navctr.navigationBar.backgroundColor = appearance.backgroundColor;
|
|
699
554
|
#endif
|
|
700
555
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
if (config.largeTitleHideShadow) {
|
|
717
|
-
scrollEdgeAppearance.shadowColor = nil;
|
|
718
|
-
}
|
|
719
|
-
navitem.scrollEdgeAppearance = scrollEdgeAppearance;
|
|
720
|
-
} else
|
|
721
|
-
#endif
|
|
722
|
-
{
|
|
723
|
-
#if !TARGET_OS_TV
|
|
724
|
-
// updating backIndicatotImage does not work when called during transition. On iOS pre 13 we need
|
|
725
|
-
// to update it before the navigation starts.
|
|
726
|
-
UIImage *backButtonImage = [config loadBackButtonImageInViewController:vc];
|
|
727
|
-
if (backButtonImage) {
|
|
728
|
-
navctr.navigationBar.backIndicatorImage = backButtonImage;
|
|
729
|
-
navctr.navigationBar.backIndicatorTransitionMaskImage = backButtonImage;
|
|
730
|
-
} else if (navctr.navigationBar.backIndicatorImage) {
|
|
731
|
-
navctr.navigationBar.backIndicatorImage = nil;
|
|
732
|
-
navctr.navigationBar.backIndicatorTransitionMaskImage = nil;
|
|
556
|
+
UINavigationBarAppearance *scrollEdgeAppearance =
|
|
557
|
+
[[UINavigationBarAppearance alloc] initWithBarAppearance:appearance];
|
|
558
|
+
if (config.largeTitleBackgroundColor != nil) {
|
|
559
|
+
// Add support for using a fully transparent bar when the backgroundColor is set to transparent.
|
|
560
|
+
if (CGColorGetAlpha(config.largeTitleBackgroundColor.CGColor) == 0.) {
|
|
561
|
+
// This will also remove the background blur effect in the large title which is otherwise inherited from the
|
|
562
|
+
// standard appearance.
|
|
563
|
+
[scrollEdgeAppearance configureWithTransparentBackground];
|
|
564
|
+
// This must be set to nil otherwise a default view will be added to the navigation bar background with an
|
|
565
|
+
// opaque background.
|
|
566
|
+
scrollEdgeAppearance.backgroundColor = nil;
|
|
567
|
+
} else {
|
|
568
|
+
scrollEdgeAppearance.backgroundColor = config.largeTitleBackgroundColor;
|
|
733
569
|
}
|
|
734
|
-
#endif
|
|
735
570
|
}
|
|
571
|
+
if (config.largeTitleHideShadow) {
|
|
572
|
+
scrollEdgeAppearance.shadowColor = nil;
|
|
573
|
+
}
|
|
574
|
+
navitem.scrollEdgeAppearance = scrollEdgeAppearance;
|
|
736
575
|
#if !TARGET_OS_TV
|
|
737
576
|
navitem.hidesBackButton = config.hideBackButton;
|
|
738
577
|
#endif
|
|
@@ -828,6 +667,71 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
828
667
|
}
|
|
829
668
|
}
|
|
830
669
|
|
|
670
|
+
- (void)configureBackItem:(nullable UINavigationItem *)prevItem API_UNAVAILABLE(tvos)
|
|
671
|
+
{
|
|
672
|
+
#if !TARGET_OS_TV
|
|
673
|
+
if (prevItem == nil) {
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
const auto *config = self;
|
|
678
|
+
|
|
679
|
+
const auto isBackTitleBlank = [NSString rnscreens_isBlankOrNull:config.backTitle] == YES;
|
|
680
|
+
NSString *resolvedBackTitle = isBackTitleBlank ? prevItem.title : config.backTitle;
|
|
681
|
+
RNSUIBarButtonItem *backBarButtonItem = [[RNSUIBarButtonItem alloc] initWithTitle:resolvedBackTitle
|
|
682
|
+
style:UIBarButtonItemStylePlain
|
|
683
|
+
target:nil
|
|
684
|
+
action:nil];
|
|
685
|
+
[backBarButtonItem setMenuHidden:config.disableBackButtonMenu];
|
|
686
|
+
|
|
687
|
+
auto shouldUseCustomBackBarButtonItem = config.disableBackButtonMenu;
|
|
688
|
+
|
|
689
|
+
// This has any effect only in case the `backBarButtonItem` is not set.
|
|
690
|
+
// We apply it before we configure the back item, because it might get overriden.
|
|
691
|
+
prevItem.backButtonDisplayMode = config.backButtonDisplayMode;
|
|
692
|
+
prevItem.backButtonTitle = resolvedBackTitle;
|
|
693
|
+
|
|
694
|
+
if (config.isBackTitleVisible) {
|
|
695
|
+
if ((config.backTitleFontFamily &&
|
|
696
|
+
// While being used by react-navigation, the `backTitleFontFamily` will
|
|
697
|
+
// be set to "System" by default - which is the system default font.
|
|
698
|
+
// To avoid always considering the font as customized, we need to have an additional check.
|
|
699
|
+
// See: https://github.com/software-mansion/react-native-screens/pull/2105#discussion_r1565222738
|
|
700
|
+
![config.backTitleFontFamily isEqual:@"System"]) ||
|
|
701
|
+
config.backTitleFontSize) {
|
|
702
|
+
shouldUseCustomBackBarButtonItem = YES;
|
|
703
|
+
NSMutableDictionary *attrs = [NSMutableDictionary new];
|
|
704
|
+
NSNumber *size = config.backTitleFontSize ?: @17;
|
|
705
|
+
if (config.backTitleFontFamily) {
|
|
706
|
+
attrs[NSFontAttributeName] = [RCTFont updateFont:nil
|
|
707
|
+
withFamily:config.backTitleFontFamily
|
|
708
|
+
size:size
|
|
709
|
+
weight:nil
|
|
710
|
+
style:nil
|
|
711
|
+
variant:nil
|
|
712
|
+
scaleMultiplier:1.0];
|
|
713
|
+
} else {
|
|
714
|
+
attrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:[size floatValue]];
|
|
715
|
+
}
|
|
716
|
+
[RNSScreenStackHeaderConfig setTitleAttibutes:attrs forButton:backBarButtonItem];
|
|
717
|
+
}
|
|
718
|
+
} else {
|
|
719
|
+
// back button title should be not visible next to back button,
|
|
720
|
+
// but it should still appear in back menu
|
|
721
|
+
prevItem.backButtonDisplayMode = UINavigationItemBackButtonDisplayModeMinimal;
|
|
722
|
+
shouldUseCustomBackBarButtonItem = NO;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// Prevent unnecessary assignment of backBarButtonItem if it is not customized,
|
|
726
|
+
// as assigning one will override the native behavior of automatically shortening
|
|
727
|
+
// the title to "Back" or hide the back title if there's not enough space.
|
|
728
|
+
// See: https://github.com/software-mansion/react-native-screens/issues/1589
|
|
729
|
+
if (shouldUseCustomBackBarButtonItem) {
|
|
730
|
+
prevItem.backBarButtonItem = backBarButtonItem;
|
|
731
|
+
}
|
|
732
|
+
#endif
|
|
733
|
+
}
|
|
734
|
+
|
|
831
735
|
- (void)applySemanticContentAttributeIfNeededToNavCtrl:(UINavigationController *)navCtrl
|
|
832
736
|
{
|
|
833
737
|
if ((self.direction == UISemanticContentAttributeForceLeftToRight ||
|
|
@@ -1239,35 +1143,28 @@ RCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)
|
|
|
1239
1143
|
@"extraLight" : @(RNSBlurEffectStyleExtraLight),
|
|
1240
1144
|
@"light" : @(RNSBlurEffectStyleLight),
|
|
1241
1145
|
@"dark" : @(RNSBlurEffectStyleDark),
|
|
1146
|
+
@"regular" : @(RNSBlurEffectStyleRegular),
|
|
1147
|
+
@"prominent" : @(RNSBlurEffectStyleProminent),
|
|
1242
1148
|
}];
|
|
1243
1149
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
@"systemThickMaterialLight" : @(RNSBlurEffectStyleSystemThickMaterialLight),
|
|
1263
|
-
@"systemChromeMaterialLight" : @(RNSBlurEffectStyleSystemChromeMaterialLight),
|
|
1264
|
-
@"systemUltraThinMaterialDark" : @(RNSBlurEffectStyleSystemUltraThinMaterialDark),
|
|
1265
|
-
@"systemThinMaterialDark" : @(RNSBlurEffectStyleSystemThinMaterialDark),
|
|
1266
|
-
@"systemMaterialDark" : @(RNSBlurEffectStyleSystemMaterialDark),
|
|
1267
|
-
@"systemThickMaterialDark" : @(RNSBlurEffectStyleSystemThickMaterialDark),
|
|
1268
|
-
@"systemChromeMaterialDark" : @(RNSBlurEffectStyleSystemChromeMaterialDark),
|
|
1269
|
-
}];
|
|
1270
|
-
}
|
|
1150
|
+
#if !TARGET_OS_TV
|
|
1151
|
+
[blurEffects addEntriesFromDictionary:@{
|
|
1152
|
+
@"systemUltraThinMaterial" : @(RNSBlurEffectStyleSystemUltraThinMaterial),
|
|
1153
|
+
@"systemThinMaterial" : @(RNSBlurEffectStyleSystemThinMaterial),
|
|
1154
|
+
@"systemMaterial" : @(RNSBlurEffectStyleSystemMaterial),
|
|
1155
|
+
@"systemThickMaterial" : @(RNSBlurEffectStyleSystemThickMaterial),
|
|
1156
|
+
@"systemChromeMaterial" : @(RNSBlurEffectStyleSystemChromeMaterial),
|
|
1157
|
+
@"systemUltraThinMaterialLight" : @(RNSBlurEffectStyleSystemUltraThinMaterialLight),
|
|
1158
|
+
@"systemThinMaterialLight" : @(RNSBlurEffectStyleSystemThinMaterialLight),
|
|
1159
|
+
@"systemMaterialLight" : @(RNSBlurEffectStyleSystemMaterialLight),
|
|
1160
|
+
@"systemThickMaterialLight" : @(RNSBlurEffectStyleSystemThickMaterialLight),
|
|
1161
|
+
@"systemChromeMaterialLight" : @(RNSBlurEffectStyleSystemChromeMaterialLight),
|
|
1162
|
+
@"systemUltraThinMaterialDark" : @(RNSBlurEffectStyleSystemUltraThinMaterialDark),
|
|
1163
|
+
@"systemThinMaterialDark" : @(RNSBlurEffectStyleSystemThinMaterialDark),
|
|
1164
|
+
@"systemMaterialDark" : @(RNSBlurEffectStyleSystemMaterialDark),
|
|
1165
|
+
@"systemThickMaterialDark" : @(RNSBlurEffectStyleSystemThickMaterialDark),
|
|
1166
|
+
@"systemChromeMaterialDark" : @(RNSBlurEffectStyleSystemChromeMaterialDark),
|
|
1167
|
+
}];
|
|
1271
1168
|
#endif
|
|
1272
1169
|
return blurEffects;
|
|
1273
1170
|
}
|
|
@@ -40,32 +40,22 @@
|
|
|
40
40
|
#if !TARGET_OS_TV
|
|
41
41
|
+ (UIStatusBarStyle)statusBarStyleForRNSStatusBarStyle:(RNSStatusBarStyle)statusBarStyle
|
|
42
42
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return UIStatusBarStyleDarkContent;
|
|
59
|
-
default:
|
|
60
|
-
return UIStatusBarStyleLightContent;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
#endif
|
|
64
|
-
// it is the only non-default style available for iOS < 13
|
|
65
|
-
if (statusBarStyle == RNSStatusBarStyleLight) {
|
|
66
|
-
return UIStatusBarStyleLightContent;
|
|
43
|
+
switch (statusBarStyle) {
|
|
44
|
+
case RNSStatusBarStyleAuto:
|
|
45
|
+
return [UITraitCollection.currentTraitCollection userInterfaceStyle] == UIUserInterfaceStyleDark
|
|
46
|
+
? UIStatusBarStyleLightContent
|
|
47
|
+
: UIStatusBarStyleDarkContent;
|
|
48
|
+
case RNSStatusBarStyleInverted:
|
|
49
|
+
return [UITraitCollection.currentTraitCollection userInterfaceStyle] == UIUserInterfaceStyleDark
|
|
50
|
+
? UIStatusBarStyleDarkContent
|
|
51
|
+
: UIStatusBarStyleLightContent;
|
|
52
|
+
case RNSStatusBarStyleLight:
|
|
53
|
+
return UIStatusBarStyleLightContent;
|
|
54
|
+
case RNSStatusBarStyleDark:
|
|
55
|
+
return UIStatusBarStyleDarkContent;
|
|
56
|
+
default:
|
|
57
|
+
return UIStatusBarStyleLightContent;
|
|
67
58
|
}
|
|
68
|
-
return UIStatusBarStyleDefault;
|
|
69
59
|
}
|
|
70
60
|
#endif
|
|
71
61
|
|
|
@@ -194,19 +184,11 @@
|
|
|
194
184
|
// https://stackoverflow.com/questions/57965701/statusbarorientation-was-deprecated-in-ios-13-0-when-attempting-to-get-app-ori/61249908#61249908
|
|
195
185
|
+ (UIInterfaceOrientation)interfaceOrientation
|
|
196
186
|
{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
UIWindowScene *windowScene = RCTKeyWindow().windowScene;
|
|
201
|
-
if (windowScene == nil) {
|
|
202
|
-
return UIInterfaceOrientationUnknown;
|
|
203
|
-
}
|
|
204
|
-
return windowScene.interfaceOrientation;
|
|
205
|
-
} else
|
|
206
|
-
#endif
|
|
207
|
-
{
|
|
208
|
-
return UIApplication.sharedApplication.statusBarOrientation;
|
|
187
|
+
UIWindowScene *windowScene = RCTKeyWindow().windowScene;
|
|
188
|
+
if (windowScene == nil) {
|
|
189
|
+
return UIInterfaceOrientationUnknown;
|
|
209
190
|
}
|
|
191
|
+
return windowScene.interfaceOrientation;
|
|
210
192
|
}
|
|
211
193
|
#endif
|
|
212
194
|
|
package/ios/RNSSearchBar.mm
CHANGED
|
@@ -173,11 +173,8 @@ namespace react = facebook::react;
|
|
|
173
173
|
|
|
174
174
|
- (void)setBarTintColor:(UIColor *)barTintColor
|
|
175
175
|
{
|
|
176
|
-
#if
|
|
177
|
-
|
|
178
|
-
if (@available(iOS 13.0, *)) {
|
|
179
|
-
[_controller.searchBar.searchTextField setBackgroundColor:barTintColor];
|
|
180
|
-
}
|
|
176
|
+
#if !TARGET_OS_TV
|
|
177
|
+
[_controller.searchBar.searchTextField setBackgroundColor:barTintColor];
|
|
181
178
|
#endif
|
|
182
179
|
}
|
|
183
180
|
|
|
@@ -188,12 +185,9 @@ namespace react = facebook::react;
|
|
|
188
185
|
|
|
189
186
|
- (void)setTextColor:(UIColor *)textColor
|
|
190
187
|
{
|
|
191
|
-
#if
|
|
192
|
-
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 && !TARGET_OS_TV
|
|
188
|
+
#if !TARGET_OS_TV
|
|
193
189
|
_textColor = textColor;
|
|
194
|
-
|
|
195
|
-
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
196
|
-
}
|
|
190
|
+
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
197
191
|
#endif
|
|
198
192
|
}
|
|
199
193
|
|
|
@@ -205,11 +199,11 @@ namespace react = facebook::react;
|
|
|
205
199
|
- (void)hideCancelButton
|
|
206
200
|
{
|
|
207
201
|
#if !TARGET_OS_TV
|
|
208
|
-
if (
|
|
202
|
+
if (!_controller.automaticallyShowsCancelButton) {
|
|
203
|
+
[_controller.searchBar setShowsCancelButton:NO animated:YES];
|
|
204
|
+
} else {
|
|
209
205
|
// On iOS 13+ UISearchController automatically shows/hides cancel button
|
|
210
206
|
// https://developer.apple.com/documentation/uikit/uisearchcontroller/3152926-automaticallyshowscancelbutton?language=objc
|
|
211
|
-
} else {
|
|
212
|
-
[_controller.searchBar setShowsCancelButton:NO animated:YES];
|
|
213
207
|
}
|
|
214
208
|
#endif
|
|
215
209
|
}
|
|
@@ -217,11 +211,11 @@ namespace react = facebook::react;
|
|
|
217
211
|
- (void)showCancelButton
|
|
218
212
|
{
|
|
219
213
|
#if !TARGET_OS_TV
|
|
220
|
-
if (
|
|
214
|
+
if (!_controller.automaticallyShowsCancelButton) {
|
|
215
|
+
[_controller.searchBar setShowsCancelButton:YES animated:YES];
|
|
216
|
+
} else {
|
|
221
217
|
// On iOS 13+ UISearchController automatically shows/hides cancel button
|
|
222
218
|
// https://developer.apple.com/documentation/uikit/uisearchcontroller/3152926-automaticallyshowscancelbutton?language=objc
|
|
223
|
-
} else {
|
|
224
|
-
[_controller.searchBar setShowsCancelButton:YES animated:YES];
|
|
225
219
|
}
|
|
226
220
|
#endif
|
|
227
221
|
}
|
|
@@ -246,14 +240,11 @@ namespace react = facebook::react;
|
|
|
246
240
|
|
|
247
241
|
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
|
|
248
242
|
{
|
|
249
|
-
#if
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (_textColor != nil) {
|
|
255
|
-
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
256
|
-
}
|
|
243
|
+
#if !TARGET_OS_TV
|
|
244
|
+
// for some reason, the color does not change when set at the beginning,
|
|
245
|
+
// so we apply it again here
|
|
246
|
+
if (_textColor != nil) {
|
|
247
|
+
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
257
248
|
}
|
|
258
249
|
#endif
|
|
259
250
|
|
|
@@ -24,7 +24,8 @@ function FullWindowOverlay(props) {
|
|
|
24
24
|
style: [_reactNative.StyleSheet.absoluteFill, {
|
|
25
25
|
width,
|
|
26
26
|
height
|
|
27
|
-
}]
|
|
27
|
+
}],
|
|
28
|
+
accessibilityContainerViewIsModal: props.unstable_accessibilityContainerViewIsModal
|
|
28
29
|
}, props.children);
|
|
29
30
|
}
|
|
30
31
|
var _default = exports.default = FullWindowOverlay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_FullWindowOverlayNativeComponent","e","__esModule","default","NativeFullWindowOverlay","FullWindowOverlayNativeComponent","FullWindowOverlay","props","width","height","useWindowDimensions","Platform","OS","console","warn","createElement","View","style","StyleSheet","absoluteFill","children","_default","exports"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,iCAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0F,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAD1F;;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_FullWindowOverlayNativeComponent","e","__esModule","default","NativeFullWindowOverlay","FullWindowOverlayNativeComponent","FullWindowOverlay","props","width","height","useWindowDimensions","Platform","OS","console","warn","createElement","View","style","StyleSheet","absoluteFill","accessibilityContainerViewIsModal","unstable_accessibilityContainerViewIsModal","children","_default","exports"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,iCAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0F,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAD1F;;AAIA,MAAMG,uBAKL,GAAGC,yCAAuC;AAO3C,SAASC,iBAAiBA,CAACC,KAA6B,EAAE;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAG,IAAAC,gCAAmB,EAAC,CAAC;EAC/C,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzBC,OAAO,CAACC,IAAI,CAAC,uDAAuD,CAAC;IACrE,oBAAOlB,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAAChB,YAAA,CAAAiB,IAAI,EAAKT,KAAQ,CAAC;EAC5B;EACA,oBACEX,MAAA,CAAAO,OAAA,CAAAY,aAAA,CAACX,uBAAuB;IACtBa,KAAK,EAAE,CAACC,uBAAU,CAACC,YAAY,EAAE;MAAEX,KAAK;MAAEC;IAAO,CAAC,CAAE;IACpDW,iCAAiC,EAC/Bb,KAAK,CAACc;EACP,GACAd,KAAK,CAACe,QACgB,CAAC;AAE9B;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArB,OAAA,GAEcG,iBAAiB","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
// Internal export, not part of stable library API.
|
|
10
11
|
var _default = exports.default = (0, _codegenNativeComponent.default)('RNSFullWindowOverlay', {
|
|
11
12
|
interfaceOnly: true
|
|
12
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Object","defineProperty","exports","value","default","_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","_default","codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["fabric/FullWindowOverlayNativeComponent.ts"],"mappings":";AAAA,YAAY;;AAACA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA,CAAAE,OAAA;AAEb,IAAAC,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAJ,OAAA,EAAAI,CAAA;AAAA,IAAAE,QAAA,GAAAR,OAAA,CAAAE,OAAA,
|
|
1
|
+
{"version":3,"names":["Object","defineProperty","exports","value","default","_codegenNativeComponent","_interopRequireDefault","require","e","__esModule","_default","codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["fabric/FullWindowOverlayNativeComponent.ts"],"mappings":";AAAA,YAAY;;AAACA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA,CAAAE,OAAA;AAEb,IAAAC,uBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6F,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAJ,OAAA,EAAAI,CAAA;AAI7F;AAAA,IAAAE,QAAA,GAAAR,OAAA,CAAAE,OAAA,GAKe,IAAAO,+BAAsB,EAAc,sBAAsB,EAAE;EACzEC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -17,7 +17,8 @@ function FullWindowOverlay(props) {
|
|
|
17
17
|
style: [StyleSheet.absoluteFill, {
|
|
18
18
|
width,
|
|
19
19
|
height
|
|
20
|
-
}]
|
|
20
|
+
}],
|
|
21
|
+
accessibilityContainerViewIsModal: props.unstable_accessibilityContainerViewIsModal
|
|
21
22
|
}, props.children);
|
|
22
23
|
}
|
|
23
24
|
export default FullWindowOverlay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","StyleSheet","View","useWindowDimensions","FullWindowOverlayNativeComponent","NativeFullWindowOverlay","FullWindowOverlay","props","width","height","OS","console","warn","createElement","style","absoluteFill","children"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAwC,OAAO;AAC3D,SACEC,QAAQ,EAERC,UAAU,EACVC,IAAI,EAEJC,mBAAmB,QACd,cAAc;;AAErB;AACA,OAAOC,gCAAgC,MAAM,4CAA4C;
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","View","useWindowDimensions","FullWindowOverlayNativeComponent","NativeFullWindowOverlay","FullWindowOverlay","props","width","height","OS","console","warn","createElement","style","absoluteFill","accessibilityContainerViewIsModal","unstable_accessibilityContainerViewIsModal","children"],"sourceRoot":"../../../src","sources":["components/FullWindowOverlay.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAwC,OAAO;AAC3D,SACEC,QAAQ,EAERC,UAAU,EACVC,IAAI,EAEJC,mBAAmB,QACd,cAAc;;AAErB;AACA,OAAOC,gCAAgC,MAAM,4CAA4C;AAGzF,MAAMC,uBAKL,GAAGD,gCAAuC;AAO3C,SAASE,iBAAiBA,CAACC,KAA6B,EAAE;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGN,mBAAmB,CAAC,CAAC;EAC/C,IAAIH,QAAQ,CAACU,EAAE,KAAK,KAAK,EAAE;IACzBC,OAAO,CAACC,IAAI,CAAC,uDAAuD,CAAC;IACrE,oBAAOb,KAAA,CAAAc,aAAA,CAACX,IAAI,EAAKK,KAAQ,CAAC;EAC5B;EACA,oBACER,KAAA,CAAAc,aAAA,CAACR,uBAAuB;IACtBS,KAAK,EAAE,CAACb,UAAU,CAACc,YAAY,EAAE;MAAEP,KAAK;MAAEC;IAAO,CAAC,CAAE;IACpDO,iCAAiC,EAC/BT,KAAK,CAACU;EACP,GACAV,KAAK,CAACW,QACgB,CAAC;AAE9B;AAEA,eAAeZ,iBAAiB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["fabric/FullWindowOverlayNativeComponent.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,sBAAsB,MAAM,yDAAyD
|
|
1
|
+
{"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../src","sources":["fabric/FullWindowOverlayNativeComponent.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,sBAAsB,MAAM,yDAAyD;;AAI5F;;AAKA,eAAeA,sBAAsB,CAAc,sBAAsB,EAAE;EACzEC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
type FullWindowOverlayProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
|
|
4
|
+
unstable_accessibilityContainerViewIsModal?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function FullWindowOverlay(props: FullWindowOverlayProps): React.JSX.Element;
|
|
5
7
|
export default FullWindowOverlay;
|
|
6
8
|
//# sourceMappingURL=FullWindowOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullWindowOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FullWindowOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FullWindowOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/FullWindowOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqB,SAAS,EAAE,MAAM,OAAO,CAAC;AAqB5D,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,0CAA0C,CAAC,EAAE,OAAO,CAAC;CACtD,CAAC;AAEF,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAevD;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react-native/types/modules/Codegen" />
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
|
-
|
|
3
|
+
import { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
+
export interface NativeProps extends ViewProps {
|
|
5
|
+
accessibilityContainerViewIsModal?: WithDefault<boolean, true>;
|
|
4
6
|
}
|
|
5
7
|
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
6
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FullWindowOverlayNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/fabric/FullWindowOverlayNativeComponent.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FullWindowOverlayNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/fabric/FullWindowOverlayNativeComponent.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAGxE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,iCAAiC,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;CAChE;;AAED,wBAEG"}
|
|
@@ -121,7 +121,7 @@ export type NativeStackNavigationOptions = {
|
|
|
121
121
|
*/
|
|
122
122
|
disableBackButtonMenu?: boolean;
|
|
123
123
|
/**
|
|
124
|
-
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu
|
|
124
|
+
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` and `backTitleVisible=false` is set.
|
|
125
125
|
* The following values are currently supported (they correspond to [UINavigationItemBackButtonDisplayMode](https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc)):
|
|
126
126
|
*
|
|
127
127
|
* - `default` – show given back button previous controller title, system generic or just icon based on available space
|
|
@@ -120,7 +120,7 @@ export interface ScreenProps extends ViewProps {
|
|
|
120
120
|
*
|
|
121
121
|
* @deprecated For all apps targeting Android SDK 35 or above this prop has no effect and is subject to removal in the future.
|
|
122
122
|
* For SDK below 35 this works only with specific app setup.
|
|
123
|
-
* This
|
|
123
|
+
* This prop is subject to removal in the future.
|
|
124
124
|
* See: https://developer.android.com/reference/android/view/Window#setNavigationBarColor(int)
|
|
125
125
|
*/
|
|
126
126
|
navigationBarColor?: ColorValue;
|
|
@@ -495,7 +495,7 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
|
|
|
495
495
|
*/
|
|
496
496
|
disableBackButtonMenu?: boolean;
|
|
497
497
|
/**
|
|
498
|
-
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu
|
|
498
|
+
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` and `backTitleVisible=false` is set.
|
|
499
499
|
* The following values are currently supported (they correspond to [UINavigationItemBackButtonDisplayMode](https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc)):
|
|
500
500
|
*
|
|
501
501
|
* - `default` – show given back button previous controller title, system generic or just icon based on available space
|
package/native-stack/README.md
CHANGED
|
@@ -82,7 +82,7 @@ Boolean indicating whether to show the menu on longPress of iOS >= 14 back butto
|
|
|
82
82
|
|
|
83
83
|
#### `backButtonDisplayMode` (iOS only)
|
|
84
84
|
|
|
85
|
-
Enum value indicating display mode of back button. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu
|
|
85
|
+
Enum value indicating display mode of back button. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` and `backTitleVisible=false` is set. The `backTitleVisible` forces `backButtonDisplayMode: minimal` and omits other values. Read more [#2800](https://github.com/software-mansion/react-native-screens/pull/2800). The other props, under the hood, customize `backButtonItem` which overrides `backButtonDisplayMode`. Read more [#2123](https://github.com/software-mansion/react-native-screens/pull/2123).
|
|
86
86
|
|
|
87
87
|
Possible options:
|
|
88
88
|
|
|
@@ -349,7 +349,7 @@ How the screen should be presented. Possible values:
|
|
|
349
349
|
- `containedModal` – will use "UIModalPresentationCurrentContext" modal style on iOS and will fallback to `"modal"` on Android.
|
|
350
350
|
- `containedTransparentModal` – will use "UIModalPresentationOverCurrentContext" modal style on iOS and will fallback to `"transparentModal"` on Android.
|
|
351
351
|
- `fullScreenModal` – will use "UIModalPresentationFullScreen" modal style on iOS and will fallback to `"modal"` on Android.
|
|
352
|
-
- `formSheet` – will use "UIModalPresentationFormSheet" modal style on iOS and
|
|
352
|
+
- `formSheet` – will use "UIModalPresentationFormSheet" modal style on iOS and "BottomSheetBehavior" on Android.
|
|
353
353
|
- `pageSheet` – will use "UIModalPresentationPageSheet" modal style on iOS and will fallback to `"modal"` on Android.
|
|
354
354
|
|
|
355
355
|
Defaults to `push`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screens",
|
|
3
|
-
"version": "4.11.0-beta.
|
|
3
|
+
"version": "4.11.0-beta.2",
|
|
4
4
|
"description": "Native navigation primitives for your React Native app.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"submodules": "git submodule update --init --recursive && (cd react-navigation && yarn && yarn build && cd ../)",
|
|
@@ -10,13 +10,21 @@ import {
|
|
|
10
10
|
|
|
11
11
|
// Native components
|
|
12
12
|
import FullWindowOverlayNativeComponent from '../fabric/FullWindowOverlayNativeComponent';
|
|
13
|
+
import type { NativeProps } from '../fabric/FullWindowOverlayNativeComponent';
|
|
14
|
+
|
|
13
15
|
const NativeFullWindowOverlay: React.ComponentType<
|
|
14
16
|
PropsWithChildren<{
|
|
15
17
|
style: StyleProp<ViewStyle>;
|
|
16
|
-
}>
|
|
18
|
+
}> &
|
|
19
|
+
NativeProps
|
|
17
20
|
> = FullWindowOverlayNativeComponent as any;
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
type FullWindowOverlayProps = {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
unstable_accessibilityContainerViewIsModal?: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function FullWindowOverlay(props: FullWindowOverlayProps) {
|
|
20
28
|
const { width, height } = useWindowDimensions();
|
|
21
29
|
if (Platform.OS !== 'ios') {
|
|
22
30
|
console.warn('Using FullWindowOverlay is only valid on iOS devices.');
|
|
@@ -24,7 +32,10 @@ function FullWindowOverlay(props: { children: ReactNode }) {
|
|
|
24
32
|
}
|
|
25
33
|
return (
|
|
26
34
|
<NativeFullWindowOverlay
|
|
27
|
-
style={[StyleSheet.absoluteFill, { width, height }]}
|
|
35
|
+
style={[StyleSheet.absoluteFill, { width, height }]}
|
|
36
|
+
accessibilityContainerViewIsModal={
|
|
37
|
+
props.unstable_accessibilityContainerViewIsModal
|
|
38
|
+
}>
|
|
28
39
|
{props.children}
|
|
29
40
|
</NativeFullWindowOverlay>
|
|
30
41
|
);
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
4
4
|
import type { ViewProps } from 'react-native';
|
|
5
|
+
import { WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
// Internal export, not part of stable library API.
|
|
8
|
+
export interface NativeProps extends ViewProps {
|
|
9
|
+
accessibilityContainerViewIsModal?: WithDefault<boolean, true>;
|
|
10
|
+
}
|
|
7
11
|
|
|
8
12
|
export default codegenNativeComponent<NativeProps>('RNSFullWindowOverlay', {
|
|
9
13
|
interfaceOnly: true,
|
|
@@ -140,7 +140,7 @@ export type NativeStackNavigationOptions = {
|
|
|
140
140
|
*/
|
|
141
141
|
disableBackButtonMenu?: boolean;
|
|
142
142
|
/**
|
|
143
|
-
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu
|
|
143
|
+
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` and `backTitleVisible=false` is set.
|
|
144
144
|
* The following values are currently supported (they correspond to [UINavigationItemBackButtonDisplayMode](https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc)):
|
|
145
145
|
*
|
|
146
146
|
* - `default` – show given back button previous controller title, system generic or just icon based on available space
|
package/src/types.tsx
CHANGED
|
@@ -188,7 +188,7 @@ export interface ScreenProps extends ViewProps {
|
|
|
188
188
|
*
|
|
189
189
|
* @deprecated For all apps targeting Android SDK 35 or above this prop has no effect and is subject to removal in the future.
|
|
190
190
|
* For SDK below 35 this works only with specific app setup.
|
|
191
|
-
* This
|
|
191
|
+
* This prop is subject to removal in the future.
|
|
192
192
|
* See: https://developer.android.com/reference/android/view/Window#setNavigationBarColor(int)
|
|
193
193
|
*/
|
|
194
194
|
navigationBarColor?: ColorValue;
|
|
@@ -576,7 +576,7 @@ export interface ScreenStackHeaderConfigProps extends ViewProps {
|
|
|
576
576
|
*/
|
|
577
577
|
disableBackButtonMenu?: boolean;
|
|
578
578
|
/**
|
|
579
|
-
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu
|
|
579
|
+
* How the back button behaves. It is used only when none of: `backTitleFontFamily`, `backTitleFontSize`, `disableBackButtonMenu` and `backTitleVisible=false` is set.
|
|
580
580
|
* The following values are currently supported (they correspond to [UINavigationItemBackButtonDisplayMode](https://developer.apple.com/documentation/uikit/uinavigationitembackbuttondisplaymode?language=objc)):
|
|
581
581
|
*
|
|
582
582
|
* - `default` – show given back button previous controller title, system generic or just icon based on available space
|