react-native-screens 4.19.0-nightly-20251029-460569215 → 4.19.0-nightly-20251031-690f01275
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/android/src/main/cpp/NativeProxy.cpp +4 -0
- package/android/src/main/cpp/NativeProxy.h +3 -0
- package/ios/RNSScreen.h +9 -1
- package/ios/RNSScreen.mm +8 -1
- package/ios/RNSScreenContainer.mm +1 -1
- package/ios/RNSScreenStack.mm +4 -0
- package/ios/bottom-tabs/RNSBottomTabsHostComponentView.mm +1 -1
- package/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm +1 -1
- package/ios/gamma/split-view/RNSSplitViewHostComponentView.mm +1 -19
- package/ios/gamma/split-view/RNSSplitViewScreenComponentView.h +0 -7
- package/ios/gamma/split-view/RNSSplitViewScreenComponentView.mm +9 -9
- package/ios/gamma/stack/RNSScreenStackHostComponentView.mm +1 -1
- package/ios/gamma/stack/RNSStackScreenComponentView.mm +1 -1
- package/ios/safe-area/RNSSafeAreaViewComponentView.mm +1 -1
- package/lib/commonjs/components/gamma/split-view/SplitViewHost.js +15 -1
- package/lib/commonjs/components/gamma/split-view/SplitViewHost.js.map +1 -1
- package/lib/module/components/gamma/split-view/SplitViewHost.js +16 -1
- package/lib/module/components/gamma/split-view/SplitViewHost.js.map +1 -1
- package/lib/typescript/components/gamma/split-view/SplitViewHost.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/gamma/split-view/SplitViewHost.tsx +20 -1
|
@@ -53,6 +53,8 @@ void NativeProxy::nativeAddMutationsListener(
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
void NativeProxy::cleanupExpiredMountingCoordinators() {
|
|
56
|
+
std::lock_guard<std::mutex> lock(coordinatorsMutex_);
|
|
57
|
+
|
|
56
58
|
coordinatorsWithMountingOverrides_.erase(
|
|
57
59
|
std::remove_if(
|
|
58
60
|
coordinatorsWithMountingOverrides_.begin(),
|
|
@@ -65,6 +67,8 @@ void NativeProxy::cleanupExpiredMountingCoordinators() {
|
|
|
65
67
|
void NativeProxy::addMountingCoordinatorIfNeeded(
|
|
66
68
|
const std::shared_ptr<const facebook::react::MountingCoordinator>
|
|
67
69
|
&coordinator) {
|
|
70
|
+
std::lock_guard<std::mutex> lock(coordinatorsMutex_);
|
|
71
|
+
|
|
68
72
|
bool wasRegistered = std::ranges::any_of(
|
|
69
73
|
coordinatorsWithMountingOverrides_,
|
|
70
74
|
[&coordinator](
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#include <react/fabric/JFabricUIManager.h>
|
|
5
5
|
#include "RNSScreenRemovalListener.h"
|
|
6
6
|
|
|
7
|
+
#include <mutex>
|
|
7
8
|
#include <string>
|
|
8
9
|
|
|
9
10
|
namespace rnscreens {
|
|
@@ -25,6 +26,8 @@ class NativeProxy : public jni::HybridClass<NativeProxy> {
|
|
|
25
26
|
friend HybridBase;
|
|
26
27
|
jni::global_ref<NativeProxy::javaobject> javaPart_;
|
|
27
28
|
|
|
29
|
+
std::mutex coordinatorsMutex_;
|
|
30
|
+
|
|
28
31
|
explicit NativeProxy(jni::alias_ref<NativeProxy::javaobject> jThis);
|
|
29
32
|
|
|
30
33
|
void nativeAddMutationsListener(
|
package/ios/RNSScreen.h
CHANGED
|
@@ -171,13 +171,21 @@ namespace react = facebook::react;
|
|
|
171
171
|
- (BOOL)isModal;
|
|
172
172
|
- (BOOL)isPresentedAsNativeModal;
|
|
173
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Tell `Screen` component that it has been removed from react state and can safely cleanup
|
|
176
|
+
* any retained resources.
|
|
177
|
+
*/
|
|
178
|
+
- (void)invalidateImpl;
|
|
179
|
+
|
|
180
|
+
#ifndef RCT_NEW_ARCH_ENABLED
|
|
174
181
|
/**
|
|
175
182
|
* Tell `Screen` component that it has been removed from react state and can safely cleanup
|
|
176
183
|
* any retained resources.
|
|
177
184
|
*
|
|
178
|
-
*
|
|
185
|
+
* On old architecture this method might be called by RN via `RCTInvalidating` protocol.
|
|
179
186
|
*/
|
|
180
187
|
- (void)invalidate;
|
|
188
|
+
#endif // !RCT_NEW_ARCH_ENABLED
|
|
181
189
|
|
|
182
190
|
/**
|
|
183
191
|
* Looks for header configuration in instance's `reactSubviews` and returns it. If not present returns `nil`.
|
package/ios/RNSScreen.mm
CHANGED
|
@@ -934,12 +934,19 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
934
934
|
self.controller.modalPresentationStyle == UIModalPresentationOverCurrentContext;
|
|
935
935
|
}
|
|
936
936
|
|
|
937
|
-
- (void)
|
|
937
|
+
- (void)invalidateImpl
|
|
938
938
|
{
|
|
939
939
|
_controller = nil;
|
|
940
940
|
[_sheetsScrollView removeObserver:self forKeyPath:@"bounds" context:nil];
|
|
941
941
|
}
|
|
942
942
|
|
|
943
|
+
#ifndef RCT_NEW_ARCH_ENABLED
|
|
944
|
+
- (void)invalidate
|
|
945
|
+
{
|
|
946
|
+
[self invalidateImpl];
|
|
947
|
+
}
|
|
948
|
+
#endif
|
|
949
|
+
|
|
943
950
|
#if !TARGET_OS_TV && !TARGET_OS_VISION
|
|
944
951
|
|
|
945
952
|
- (void)setPropertyForSheet:(UISheetPresentationController *)sheet withBlock:(void (^)(void))block animate:(BOOL)animate
|
|
@@ -266,7 +266,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
266
266
|
[super load];
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
#pragma mark -
|
|
269
|
+
#pragma mark - RCTComponentViewProtocol
|
|
270
270
|
|
|
271
271
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
272
272
|
{
|
package/ios/RNSScreenStack.mm
CHANGED
|
@@ -1409,7 +1409,11 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
1411
|
for (RNSScreenView *screenRef : strongSelf->_toBeDeletedScreens) {
|
|
1412
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
1413
|
+
[screenRef invalidateImpl];
|
|
1414
|
+
#else
|
|
1412
1415
|
[screenRef invalidate];
|
|
1416
|
+
#endif
|
|
1413
1417
|
}
|
|
1414
1418
|
strongSelf->_toBeDeletedScreens.clear();
|
|
1415
1419
|
});
|
|
@@ -207,7 +207,7 @@ namespace react = facebook::react;
|
|
|
207
207
|
return [_reactEventEmitter emitOnNativeFocusChange:OnNativeFocusChangePayload{.tabKey = tabScreen.tabKey}];
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
#pragma mark -
|
|
210
|
+
#pragma mark - RCTComponentViewProtocol
|
|
211
211
|
#if RCT_NEW_ARCH_ENABLED
|
|
212
212
|
|
|
213
213
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
@@ -243,7 +243,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
#if RCT_NEW_ARCH_ENABLED
|
|
246
|
-
#pragma mark -
|
|
246
|
+
#pragma mark - RCTComponentViewProtocol
|
|
247
247
|
|
|
248
248
|
- (void)updateProps:(const facebook::react::Props::Shared &)props
|
|
249
249
|
oldProps:(const facebook::react::Props::Shared &)oldProps
|
|
@@ -116,13 +116,6 @@ static const CGFloat epsilon = 1e-6;
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
- (void)willMoveToWindow:(UIWindow *)newWindow
|
|
120
|
-
{
|
|
121
|
-
if (newWindow == nil) {
|
|
122
|
-
[self invalidate];
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
119
|
- (void)didMoveToWindow
|
|
127
120
|
{
|
|
128
121
|
[self setupController];
|
|
@@ -148,17 +141,6 @@ static const CGFloat epsilon = 1e-6;
|
|
|
148
141
|
}
|
|
149
142
|
}
|
|
150
143
|
|
|
151
|
-
- (void)invalidate
|
|
152
|
-
{
|
|
153
|
-
// We assume that split host is removed from view hierarchy **only** when
|
|
154
|
-
// whole component is destroyed & therefore we do the necessary cleanup here.
|
|
155
|
-
// If at some point that statement does not hold anymore, this cleanup
|
|
156
|
-
// should be moved to a different place.
|
|
157
|
-
for (RNSSplitViewScreenComponentView *subview in _reactSubviews) {
|
|
158
|
-
[subview invalidate];
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
144
|
RNS_IGNORE_SUPER_CALL_BEGIN
|
|
163
145
|
- (nonnull NSMutableArray<RNSSplitViewScreenComponentView *> *)reactSubviews
|
|
164
146
|
{
|
|
@@ -176,7 +158,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
176
158
|
return _controller;
|
|
177
159
|
}
|
|
178
160
|
|
|
179
|
-
#pragma mark -
|
|
161
|
+
#pragma mark - RCTComponentViewProtocol
|
|
180
162
|
|
|
181
163
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
182
164
|
{
|
|
@@ -21,13 +21,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
21
21
|
@property (nonatomic, strong, readonly, nonnull) RNSSplitViewScreenController *controller;
|
|
22
22
|
@property (nonatomic, weak, readwrite, nullable) RNSSplitViewHostComponentView *splitViewHost;
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
* @brief A function responsible for requesting a cleanup in the SplitViewScreen component.
|
|
26
|
-
*
|
|
27
|
-
* Should be called when the component is about to be deleted.
|
|
28
|
-
*/
|
|
29
|
-
- (void)invalidate;
|
|
30
|
-
|
|
31
24
|
@end
|
|
32
25
|
|
|
33
26
|
#pragma mark - ShadowTreeState
|
|
@@ -85,14 +85,6 @@ namespace react = facebook::react;
|
|
|
85
85
|
_columnType = RNSSplitViewScreenColumnTypeColumn;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
- (void)invalidate
|
|
89
|
-
{
|
|
90
|
-
// Controller keeps the strong reference to the component via the `.view` property.
|
|
91
|
-
// Therefore, we need to enforce a proper cleanup, breaking the retain cycle,
|
|
92
|
-
// when we want to destroy the component.
|
|
93
|
-
_controller = nil;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
88
|
- (void)registerForFrameCorrection:(UIView *)view
|
|
97
89
|
{
|
|
98
90
|
[_viewsForFrameCorrection addObject:view];
|
|
@@ -155,7 +147,7 @@ namespace react = facebook::react;
|
|
|
155
147
|
[self dispatchSafeAreaDidChangeNotification];
|
|
156
148
|
}
|
|
157
149
|
|
|
158
|
-
#pragma mark -
|
|
150
|
+
#pragma mark - RCTComponentViewProtocol
|
|
159
151
|
|
|
160
152
|
+ (react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
161
153
|
{
|
|
@@ -196,6 +188,14 @@ namespace react = facebook::react;
|
|
|
196
188
|
updateEventEmitter:std::static_pointer_cast<const react::RNSSplitViewScreenEventEmitter>(eventEmitter)];
|
|
197
189
|
}
|
|
198
190
|
|
|
191
|
+
- (void)invalidate
|
|
192
|
+
{
|
|
193
|
+
// Controller keeps the strong reference to the component via the `.view` property.
|
|
194
|
+
// Therefore, we need to enforce a proper cleanup, breaking the retain cycle,
|
|
195
|
+
// when we want to destroy the component.
|
|
196
|
+
_controller = nil;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
199
|
@end
|
|
200
200
|
|
|
201
201
|
Class<RCTComponentViewProtocol> RNSSplitViewScreenCls(void)
|
|
@@ -75,7 +75,7 @@ RNS_IGNORE_SUPER_CALL_END
|
|
|
75
75
|
return _controller;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
#pragma mark -
|
|
78
|
+
#pragma mark - RCTComponentViewProtocol
|
|
79
79
|
|
|
80
80
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
81
81
|
{
|
|
@@ -66,7 +66,7 @@ namespace react = facebook::react;
|
|
|
66
66
|
return _reactEventEmitter;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
#pragma mark -
|
|
69
|
+
#pragma mark - RCTComponentViewProtocol
|
|
70
70
|
|
|
71
71
|
- (void)updateProps:(const facebook::react::Props::Shared &)props
|
|
72
72
|
oldProps:(const facebook::react::Props::Shared &)oldProps
|
|
@@ -166,7 +166,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
|
166
166
|
#endif // RCT_NEW_ARCH_ENABLED
|
|
167
167
|
|
|
168
168
|
#if RCT_NEW_ARCH_ENABLED
|
|
169
|
-
#pragma mark -
|
|
169
|
+
#pragma mark - RCTComponentViewProtocol
|
|
170
170
|
|
|
171
171
|
+ (react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
172
172
|
{
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _SplitViewHostNativeComponent = _interopRequireDefault(require("../../../fabric/gamma/SplitViewHostNativeComponent"));
|
|
10
|
+
var _SplitViewScreen = _interopRequireDefault(require("./SplitViewScreen"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
13
|
// According to the UIKit documentation: https://developer.apple.com/documentation/uikit/uisplitviewcontroller/displaymode-swift.enum
|
|
@@ -44,7 +45,20 @@ function SplitViewHost(props) {
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
}, [preferredDisplayMode, preferredSplitBehavior]);
|
|
47
|
-
|
|
48
|
+
const children = _react.default.Children.toArray(props.children);
|
|
49
|
+
const columns = children.filter(
|
|
50
|
+
// @ts-ignore - type is valid attribute for child
|
|
51
|
+
child => child.type === _SplitViewScreen.default.Column);
|
|
52
|
+
const inspectors = children.filter(
|
|
53
|
+
// @ts-ignore - type is valid attribute for child
|
|
54
|
+
child => child.type === _SplitViewScreen.default.Inspector);
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_SplitViewHostNativeComponent.default
|
|
56
|
+
// UISplitViewController requires the number of columns to be specified at initialization and it cannot be changed dynamically later.
|
|
57
|
+
// By using a specific key in this form, we can detect changes in the number of React children.
|
|
58
|
+
// This enables us to fully recreate the SplitView when necessary, ensuring the correct column configuration is always applied.
|
|
59
|
+
, _extends({
|
|
60
|
+
key: `columns-${columns.length}-inspectors-${inspectors.length}`
|
|
61
|
+
}, props, {
|
|
48
62
|
style: styles.container
|
|
49
63
|
}), props.children);
|
|
50
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_SplitViewHostNativeComponent","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","displayModeForSplitViewCompatibilityMap","tile","overlay","displace","automatic","isValidDisplayModeForSplitBehavior","displayMode","splitBehavior","includes","SplitViewHost","props","preferredDisplayMode","preferredSplitBehavior","React","useEffect","isValid","validDisplayModes","console","warn","join","createElement","style","styles","container","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_SplitViewHostNativeComponent","_SplitViewScreen","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","displayModeForSplitViewCompatibilityMap","tile","overlay","displace","automatic","isValidDisplayModeForSplitBehavior","displayMode","splitBehavior","includes","SplitViewHost","props","preferredDisplayMode","preferredSplitBehavior","React","useEffect","isValid","validDisplayModes","console","warn","join","children","Children","toArray","columns","filter","child","type","SplitViewScreen","Column","inspectors","Inspector","createElement","key","style","styles","container","StyleSheet","create","flex","_default","exports"],"sourceRoot":"../../../../../src","sources":["components/gamma/split-view/SplitViewHost.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA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ArD,OAAA,GAEYsB,aAAa","ignoreList":[]}
|
|
@@ -2,6 +2,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import SplitViewHostNativeComponent from '../../../fabric/gamma/SplitViewHostNativeComponent';
|
|
5
|
+
import SplitViewScreen from './SplitViewScreen';
|
|
6
|
+
|
|
5
7
|
// According to the UIKit documentation: https://developer.apple.com/documentation/uikit/uisplitviewcontroller/displaymode-swift.enum
|
|
6
8
|
// Only specific pairs for displayMode - splitBehavior are valid and others may lead to unexpected results.
|
|
7
9
|
// Therefore, we're adding check on the JS side to return a feedback to the client when that pairing isn't valid.
|
|
@@ -37,7 +39,20 @@ function SplitViewHost(props) {
|
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
}, [preferredDisplayMode, preferredSplitBehavior]);
|
|
40
|
-
|
|
42
|
+
const children = React.Children.toArray(props.children);
|
|
43
|
+
const columns = children.filter(
|
|
44
|
+
// @ts-ignore - type is valid attribute for child
|
|
45
|
+
child => child.type === SplitViewScreen.Column);
|
|
46
|
+
const inspectors = children.filter(
|
|
47
|
+
// @ts-ignore - type is valid attribute for child
|
|
48
|
+
child => child.type === SplitViewScreen.Inspector);
|
|
49
|
+
return /*#__PURE__*/React.createElement(SplitViewHostNativeComponent
|
|
50
|
+
// UISplitViewController requires the number of columns to be specified at initialization and it cannot be changed dynamically later.
|
|
51
|
+
// By using a specific key in this form, we can detect changes in the number of React children.
|
|
52
|
+
// This enables us to fully recreate the SplitView when necessary, ensuring the correct column configuration is always applied.
|
|
53
|
+
, _extends({
|
|
54
|
+
key: `columns-${columns.length}-inspectors-${inspectors.length}`
|
|
55
|
+
}, props, {
|
|
41
56
|
style: styles.container
|
|
42
57
|
}), props.children);
|
|
43
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","SplitViewHostNativeComponent","displayModeForSplitViewCompatibilityMap","tile","overlay","displace","automatic","isValidDisplayModeForSplitBehavior","displayMode","splitBehavior","includes","SplitViewHost","props","preferredDisplayMode","preferredSplitBehavior","useEffect","isValid","validDisplayModes","console","warn","join","createElement","_extends","style","styles","container","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","SplitViewHostNativeComponent","SplitViewScreen","displayModeForSplitViewCompatibilityMap","tile","overlay","displace","automatic","isValidDisplayModeForSplitBehavior","displayMode","splitBehavior","includes","SplitViewHost","props","preferredDisplayMode","preferredSplitBehavior","useEffect","isValid","validDisplayModes","console","warn","join","children","Children","toArray","columns","filter","child","type","Column","inspectors","Inspector","createElement","_extends","key","length","style","styles","container","create","flex"],"sourceRoot":"../../../../../src","sources":["components/gamma/split-view/SplitViewHost.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,4BAA4B,MAAM,oDAAoD;AAM7F,OAAOC,eAAe,MAAM,mBAAmB;;AAE/C;AACA;AACA;AACA;AACA,MAAMC,uCAGL,GAAG;EACFC,IAAI,EAAE,CAAC,eAAe,EAAE,oBAAoB,EAAE,oBAAoB,CAAC;EACnEC,OAAO,EAAE,CAAC,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,CAAC;EAClEC,QAAQ,EAAE,CAAC,eAAe,EAAE,oBAAoB,EAAE,sBAAsB,CAAC;EACzEC,SAAS,EAAE,EAAE,CAAE;AACjB,CAAC;AAED,MAAMC,kCAAkC,GAAGA,CACzCC,WAAiC,EACjCC,aAAqC,KAClC;EACH,IAAIA,aAAa,KAAK,WAAW,EAAE;IACjC;IACA,OAAO,IAAI;EACb;EACA,OAAOP,uCAAuC,CAACO,aAAa,CAAC,CAACC,QAAQ,CACpEF,WACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA,SAASG,aAAaA,CAACC,KAAyB,EAAE;EAChD,MAAM;IAAEC,oBAAoB;IAAEC;EAAuB,CAAC,GAAGF,KA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-
{"version":3,"file":"SplitViewHost.d.ts","sourceRoot":"","sources":["../../../../../src/components/gamma/split-view/SplitViewHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"SplitViewHost.d.ts","sourceRoot":"","sources":["../../../../../src/components/gamma/split-view/SplitViewHost.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AA8B/B;;GAEG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA6C/C;AAQD,eAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screens",
|
|
3
|
-
"version": "4.19.0-nightly-
|
|
3
|
+
"version": "4.19.0-nightly-20251031-690f01275",
|
|
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 ../)",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"@react-native-community/cli": "20.0.0-alpha.2",
|
|
87
87
|
"@react-native-community/cli-platform-android": "20.0.0-alpha.2",
|
|
88
88
|
"@react-native-community/cli-platform-ios": "20.0.0-alpha.2",
|
|
89
|
-
"@react-native/babel-preset": "0.82.
|
|
90
|
-
"@react-native/eslint-config": "0.82.
|
|
91
|
-
"@react-native/metro-config": "0.82.
|
|
92
|
-
"@react-native/typescript-config": "0.82.
|
|
89
|
+
"@react-native/babel-preset": "0.82.1",
|
|
90
|
+
"@react-native/eslint-config": "0.82.1",
|
|
91
|
+
"@react-native/metro-config": "0.82.1",
|
|
92
|
+
"@react-native/typescript-config": "0.82.1",
|
|
93
93
|
"@react-navigation/native": "^5.8.0",
|
|
94
94
|
"@react-navigation/stack": "^5.10.0",
|
|
95
95
|
"@types/jest": "^29.5.13",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"prettier": "^2.8.8",
|
|
113
113
|
"react": "^19.1.1",
|
|
114
114
|
"react-dom": "^19.1.0",
|
|
115
|
-
"react-native": "0.82.
|
|
115
|
+
"react-native": "0.82.1",
|
|
116
116
|
"react-native-builder-bob": "^0.23.2",
|
|
117
117
|
"react-native-gesture-handler": "^2.28.0",
|
|
118
118
|
"react-native-reanimated": "^3.19.0",
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
SplitViewHostProps,
|
|
7
7
|
SplitViewSplitBehavior,
|
|
8
8
|
} from './SplitViewHost.types';
|
|
9
|
+
import SplitViewScreen from './SplitViewScreen';
|
|
9
10
|
|
|
10
11
|
// According to the UIKit documentation: https://developer.apple.com/documentation/uikit/uisplitviewcontroller/displaymode-swift.enum
|
|
11
12
|
// Only specific pairs for displayMode - splitBehavior are valid and others may lead to unexpected results.
|
|
@@ -59,8 +60,26 @@ function SplitViewHost(props: SplitViewHostProps) {
|
|
|
59
60
|
}
|
|
60
61
|
}, [preferredDisplayMode, preferredSplitBehavior]);
|
|
61
62
|
|
|
63
|
+
const children = React.Children.toArray(props.children);
|
|
64
|
+
|
|
65
|
+
const columns = children.filter(
|
|
66
|
+
// @ts-ignore - type is valid attribute for child
|
|
67
|
+
child => child.type === SplitViewScreen.Column,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const inspectors = children.filter(
|
|
71
|
+
// @ts-ignore - type is valid attribute for child
|
|
72
|
+
child => child.type === SplitViewScreen.Inspector,
|
|
73
|
+
);
|
|
74
|
+
|
|
62
75
|
return (
|
|
63
|
-
<SplitViewHostNativeComponent
|
|
76
|
+
<SplitViewHostNativeComponent
|
|
77
|
+
// UISplitViewController requires the number of columns to be specified at initialization and it cannot be changed dynamically later.
|
|
78
|
+
// By using a specific key in this form, we can detect changes in the number of React children.
|
|
79
|
+
// This enables us to fully recreate the SplitView when necessary, ensuring the correct column configuration is always applied.
|
|
80
|
+
key={`columns-${columns.length}-inspectors-${inspectors.length}`}
|
|
81
|
+
{...props}
|
|
82
|
+
style={styles.container}>
|
|
64
83
|
{props.children}
|
|
65
84
|
</SplitViewHostNativeComponent>
|
|
66
85
|
);
|