@office-iss/react-native-win32 0.0.0-canary.274 → 0.0.0-canary.275
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/.flowconfig +5 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/ActionSheetIOS/ActionSheetIOS.d.ts +1 -0
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +13 -0
- package/Libraries/Animated/animations/Animation.js +1 -5
- package/Libraries/Animated/components/AnimatedFlatList.js +1 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +3 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +16 -2
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +21 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +0 -1
- package/Libraries/Components/ScrollView/ScrollView.js +35 -74
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +0 -2
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +0 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
- package/Libraries/Components/TextInput/TextInput.js +7 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +7 -1
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +1 -2
- package/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/Core/ExceptionsManager.js +1 -4
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +20 -18
- package/Libraries/Core/setUpTimers.js +4 -12
- package/Libraries/Image/Image.d.ts +2 -0
- package/Libraries/Image/ImageProps.js +2 -1
- package/Libraries/Image/ImageResizeMode.d.ts +8 -1
- package/Libraries/Image/ImageResizeMode.js +4 -1
- package/Libraries/Image/ImageSource.d.ts +0 -2
- package/Libraries/Image/ImageSource.js +0 -2
- package/Libraries/Image/ImageUtils.js +6 -3
- package/Libraries/Inspector/Inspector.win32.js +1 -1
- package/Libraries/Interaction/InteractionManager.js +6 -1
- package/Libraries/Interaction/InteractionManagerStub.js +176 -0
- package/Libraries/Lists/FlatList.js +2 -2
- package/Libraries/LogBox/LogBox.js +1 -1
- package/Libraries/LogBox/UI/AnsiHighlight.js +26 -17
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js +6 -1
- package/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.win32.js +6 -1
- package/Libraries/Modal/Modal.d.ts +5 -0
- package/Libraries/Modal/Modal.js +17 -0
- package/Libraries/PermissionsAndroid/PermissionsAndroid.d.ts +49 -2
- package/Libraries/Pressability/usePressability.js +4 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/RendererImplementation.js +12 -12
- package/Libraries/ReactNative/renderApplication.js +3 -4
- package/Libraries/ReactNative/requireNativeComponent.js +2 -1
- package/Libraries/Renderer/implementations/ReactFabric-dev.js +26149 -15434
- package/Libraries/Renderer/implementations/ReactFabric-prod.js +1630 -2675
- package/Libraries/Renderer/implementations/ReactFabric-profiling.js +1691 -2954
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +27069 -16192
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1657 -2714
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1733 -2980
- package/Libraries/Renderer/shims/ReactFabric.js +3 -3
- package/Libraries/Renderer/shims/ReactFeatureFlags.js +2 -2
- package/Libraries/Renderer/shims/ReactNative.js +3 -3
- package/Libraries/Renderer/shims/createReactNativeComponentClass.js +2 -2
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +7 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +5 -4
- package/Libraries/Utilities/BackHandler.android.js +6 -18
- package/Libraries/Utilities/BackHandler.d.ts +0 -4
- package/Libraries/Utilities/BackHandler.ios.js +0 -7
- package/Libraries/Utilities/BackHandler.win32.js +6 -18
- package/Libraries/Utilities/__mocks__/BackHandler.js +3 -8
- package/overrides.json +8 -8
- package/package.json +13 -13
- package/src/private/components/HScrollViewNativeComponents.js +1 -26
- package/src/private/components/VScrollViewNativeComponents.js +2 -24
- package/src/private/featureflags/ReactNativeFeatureFlags.js +18 -38
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -6
- package/src/private/specs/components/RCTModalHostViewNativeComponent.js +8 -0
- package/src/private/specs/modules/NativeAccessibilityInfo.js +6 -0
- package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +6 -0
- package/src/private/specs/modules/NativeActionSheetManager.js +2 -0
- package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +7 -0
- package/Libraries/ReactNative/ReactFabricInternals.js +0 -17
- package/src/private/components/useSyncOnScroll.js +0 -48
- package/types/experimental.d.ts +0 -59
package/.flowconfig
CHANGED
|
@@ -88,6 +88,9 @@
|
|
|
88
88
|
; helloworld
|
|
89
89
|
<PROJECT_ROOT>/packages/helloworld/ios/Pods/
|
|
90
90
|
|
|
91
|
+
; Ignore rn-tester Pods
|
|
92
|
+
<PROJECT_ROOT>/packages/rn-tester/Pods/
|
|
93
|
+
|
|
91
94
|
[untyped]
|
|
92
95
|
.*/node_modules/@react-native-community/cli/.*/.*
|
|
93
96
|
; Should work out how to do this properly
|
|
@@ -136,6 +139,7 @@ suppress_type=$FlowFixMeProps
|
|
|
136
139
|
suppress_type=$FlowFixMeState
|
|
137
140
|
suppress_type=$FlowFixMeEmpty
|
|
138
141
|
|
|
142
|
+
ban_spread_key_props=true
|
|
139
143
|
|
|
140
144
|
sharedmemory.hash_table_pow=21
|
|
141
145
|
|
|
@@ -160,4 +164,4 @@ untyped-import
|
|
|
160
164
|
untyped-type-import
|
|
161
165
|
|
|
162
166
|
[version]
|
|
163
|
-
^0.
|
|
167
|
+
^0.253.0
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Sat, 14 Dec 2024 06:28:25 GMT",
|
|
6
|
+
"version": "0.0.0-canary.275",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.275",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tatianakapos@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "13d41421a38fa7ebe4c08a8f421baffebf14dac5",
|
|
14
|
+
"comment": "integrate RN Nightly 0.77.0-nightly-20241118-3986eefed"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Fri, 06 Dec 2024 06:22:27 GMT",
|
|
6
21
|
"version": "0.0.0-canary.274",
|
|
7
22
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.274",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 14 Dec 2024 06:28:25 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.0.0-canary.
|
|
7
|
+
## 0.0.0-canary.275
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Sat, 14 Dec 2024 06:28:25 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
13
|
+
- integrate RN Nightly 0.77.0-nightly-20241118-3986eefed (tatianakapos@microsoft.com)
|
|
14
14
|
|
|
15
|
+
## 0.0.0-canary.274
|
|
16
|
+
|
|
17
|
+
Fri, 06 Dec 2024 06:22:27 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- Integrate 10/31 (yajurgrover24@gmail.com)
|
|
22
|
+
|
|
15
23
|
## 0.0.0-canary.273
|
|
16
24
|
|
|
17
25
|
Sat, 23 Nov 2024 06:23:15 GMT
|
|
@@ -22,6 +22,7 @@ export interface ActionSheetIOSOptions {
|
|
|
22
22
|
anchor?: number | undefined;
|
|
23
23
|
tintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
24
24
|
cancelButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
25
|
+
disabledButtonTintColor?: ColorValue | ProcessedColorValue | undefined;
|
|
25
26
|
userInterfaceStyle?: 'light' | 'dark' | undefined;
|
|
26
27
|
disabledButtonIndices?: number[] | undefined;
|
|
27
28
|
}
|
|
@@ -49,6 +49,7 @@ const ActionSheetIOS = {
|
|
|
49
49
|
+anchor?: ?number,
|
|
50
50
|
+tintColor?: ColorValue | ProcessedColorValue,
|
|
51
51
|
+cancelButtonTintColor?: ColorValue | ProcessedColorValue,
|
|
52
|
+
+disabledButtonTintColor?: ColorValue | ProcessedColorValue,
|
|
52
53
|
+userInterfaceStyle?: string,
|
|
53
54
|
+disabledButtonIndices?: Array<number>,
|
|
54
55
|
|},
|
|
@@ -64,6 +65,7 @@ const ActionSheetIOS = {
|
|
|
64
65
|
const {
|
|
65
66
|
tintColor,
|
|
66
67
|
cancelButtonTintColor,
|
|
68
|
+
disabledButtonTintColor,
|
|
67
69
|
destructiveButtonIndex,
|
|
68
70
|
...remainingOptions
|
|
69
71
|
} = options;
|
|
@@ -77,6 +79,10 @@ const ActionSheetIOS = {
|
|
|
77
79
|
|
|
78
80
|
const processedTintColor = processColor(tintColor);
|
|
79
81
|
const processedCancelButtonTintColor = processColor(cancelButtonTintColor);
|
|
82
|
+
const processedDisabledButtonTintColor = processColor(
|
|
83
|
+
disabledButtonTintColor,
|
|
84
|
+
);
|
|
85
|
+
|
|
80
86
|
invariant(
|
|
81
87
|
processedTintColor == null || typeof processedTintColor === 'number',
|
|
82
88
|
'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions tintColor',
|
|
@@ -86,6 +92,11 @@ const ActionSheetIOS = {
|
|
|
86
92
|
typeof processedCancelButtonTintColor === 'number',
|
|
87
93
|
'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions cancelButtonTintColor',
|
|
88
94
|
);
|
|
95
|
+
invariant(
|
|
96
|
+
processedDisabledButtonTintColor == null ||
|
|
97
|
+
typeof processedDisabledButtonTintColor === 'number',
|
|
98
|
+
'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions disabledButtonTintColor',
|
|
99
|
+
);
|
|
89
100
|
RCTActionSheetManager.showActionSheetWithOptions(
|
|
90
101
|
{
|
|
91
102
|
...remainingOptions,
|
|
@@ -93,6 +104,8 @@ const ActionSheetIOS = {
|
|
|
93
104
|
tintColor: processedTintColor,
|
|
94
105
|
// $FlowFixMe[incompatible-call]
|
|
95
106
|
cancelButtonTintColor: processedCancelButtonTintColor,
|
|
107
|
+
// $FlowFixMe[incompatible-call]
|
|
108
|
+
disabledButtonTintColor: processedDisabledButtonTintColor,
|
|
96
109
|
destructiveButtonIndices,
|
|
97
110
|
},
|
|
98
111
|
callback,
|
|
@@ -165,11 +165,7 @@ export default class Animation {
|
|
|
165
165
|
const callback = this.#onEnd;
|
|
166
166
|
if (callback != null) {
|
|
167
167
|
this.#onEnd = null;
|
|
168
|
-
|
|
169
|
-
queueMicrotask(() => callback(result));
|
|
170
|
-
} else {
|
|
171
|
-
callback(result);
|
|
172
|
-
}
|
|
168
|
+
queueMicrotask(() => callback(result));
|
|
173
169
|
}
|
|
174
170
|
}
|
|
175
171
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type {SectionBase} from '../../Lists/SectionList';
|
|
11
12
|
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
|
12
13
|
|
|
13
14
|
import SectionList from '../../Lists/SectionList';
|
|
@@ -16,5 +17,6 @@ import * as React from 'react';
|
|
|
16
17
|
|
|
17
18
|
export default (createAnimatedComponent(SectionList): AnimatedComponentType<
|
|
18
19
|
React.ElementConfig<typeof SectionList>,
|
|
19
|
-
|
|
20
|
+
// $FlowExpectedError[unclear-type]
|
|
21
|
+
SectionList<SectionBase<any>>,
|
|
20
22
|
>);
|
|
@@ -55,6 +55,8 @@ const EventNames: Map<
|
|
|
55
55
|
['highTextContrastChanged', 'highTextContrastDidChange'],
|
|
56
56
|
['screenReaderChanged', 'touchExplorationDidChange'],
|
|
57
57
|
['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
|
|
58
|
+
['invertColorsChanged', 'invertColorDidChange'],
|
|
59
|
+
['grayscaleChanged', 'grayscaleModeDidChange'],
|
|
58
60
|
])
|
|
59
61
|
: new Map([
|
|
60
62
|
['announcementFinished', 'announcementFinished'],
|
|
@@ -113,7 +115,13 @@ const AccessibilityInfo = {
|
|
|
113
115
|
*/
|
|
114
116
|
isGrayscaleEnabled(): Promise<boolean> {
|
|
115
117
|
if (Platform.OS === 'android') {
|
|
116
|
-
return Promise
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) {
|
|
120
|
+
NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve);
|
|
121
|
+
} else {
|
|
122
|
+
reject(null);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
117
125
|
} else {
|
|
118
126
|
return new Promise((resolve, reject) => {
|
|
119
127
|
if (NativeAccessibilityManagerIOS != null) {
|
|
@@ -138,7 +146,13 @@ const AccessibilityInfo = {
|
|
|
138
146
|
*/
|
|
139
147
|
isInvertColorsEnabled(): Promise<boolean> {
|
|
140
148
|
if (Platform.OS === 'android') {
|
|
141
|
-
return Promise
|
|
149
|
+
return new Promise((resolve, reject) => {
|
|
150
|
+
if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
|
|
151
|
+
NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
|
|
152
|
+
} else {
|
|
153
|
+
reject(null);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
142
156
|
} else {
|
|
143
157
|
return new Promise((resolve, reject) => {
|
|
144
158
|
if (NativeAccessibilityManagerIOS != null) {
|
|
@@ -16,6 +16,7 @@ import {sendAccessibilityEvent} from '../../ReactNative/RendererProxy';
|
|
|
16
16
|
import Platform from '../../Utilities/Platform';
|
|
17
17
|
import legacySendAccessibilityEvent from './legacySendAccessibilityEvent';
|
|
18
18
|
import NativeAccessibilityInfo from './NativeAccessibilityInfo';
|
|
19
|
+
import NativeAccessibilityInfoAndroid from './NativeAccessibilityInfo';
|
|
19
20
|
import NativeAccessibilityInfoWin32 from './NativeAccessibilityInfoWin32';
|
|
20
21
|
import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
|
|
21
22
|
|
|
@@ -56,6 +57,8 @@ const EventNames: Map<
|
|
|
56
57
|
['highTextContrastChanged', 'highTextContrastDidChange'],
|
|
57
58
|
['screenReaderChanged', 'touchExplorationDidChange'],
|
|
58
59
|
['accessibilityServiceChanged', 'accessibilityServiceDidChange'],
|
|
60
|
+
['invertColorsChanged', 'invertColorDidChange'],
|
|
61
|
+
['grayscaleChanged', 'grayscaleModeDidChange'],
|
|
59
62
|
])
|
|
60
63
|
: Platform.OS === 'win32'
|
|
61
64
|
? new Map([
|
|
@@ -119,7 +122,15 @@ const AccessibilityInfo = {
|
|
|
119
122
|
* See https://reactnative.dev/docs/accessibilityinfo#isGrayscaleEnabled
|
|
120
123
|
*/
|
|
121
124
|
isGrayscaleEnabled(): Promise<boolean> {
|
|
122
|
-
if (Platform.OS === 'android'
|
|
125
|
+
if (Platform.OS === 'android') {
|
|
126
|
+
return new Promise((resolve, reject) => {
|
|
127
|
+
if (NativeAccessibilityInfoAndroid?.isGrayscaleEnabled != null) {
|
|
128
|
+
NativeAccessibilityInfoAndroid.isGrayscaleEnabled(resolve);
|
|
129
|
+
} else {
|
|
130
|
+
reject(null);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
} else if (Platform.OS === 'win32') {
|
|
123
134
|
return Promise.resolve(false);
|
|
124
135
|
} else {
|
|
125
136
|
return new Promise((resolve, reject) => {
|
|
@@ -144,7 +155,15 @@ const AccessibilityInfo = {
|
|
|
144
155
|
* See https://reactnative.dev/docs/accessibilityinfo#isInvertColorsEnabled
|
|
145
156
|
*/
|
|
146
157
|
isInvertColorsEnabled(): Promise<boolean> {
|
|
147
|
-
if (Platform.OS === 'android'
|
|
158
|
+
if (Platform.OS === 'android') {
|
|
159
|
+
return new Promise((resolve, reject) => {
|
|
160
|
+
if (NativeAccessibilityInfoAndroid?.isInvertColorsEnabled != null) {
|
|
161
|
+
NativeAccessibilityInfoAndroid.isInvertColorsEnabled(resolve);
|
|
162
|
+
} else {
|
|
163
|
+
reject(null);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
} else if (Platform.OS === 'win32') {
|
|
148
167
|
return Promise.resolve(false);
|
|
149
168
|
} else {
|
|
150
169
|
return new Promise((resolve, reject) => {
|
|
@@ -8,10 +8,6 @@
|
|
|
8
8
|
* @flow strict-local
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
TScrollViewNativeComponentInstance,
|
|
13
|
-
TScrollViewNativeImperativeHandle,
|
|
14
|
-
} from '../../../src/private/components/useSyncOnScroll';
|
|
15
11
|
import type {HostInstance} from '../../Renderer/shims/ReactNativeTypes';
|
|
16
12
|
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
|
|
17
13
|
import type {PointProp} from '../../StyleSheet/PointPropType';
|
|
@@ -46,7 +42,6 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
|
46
42
|
import Dimensions from '../../Utilities/Dimensions';
|
|
47
43
|
import dismissKeyboard from '../../Utilities/dismissKeyboard';
|
|
48
44
|
import Platform from '../../Utilities/Platform';
|
|
49
|
-
import EventEmitter from '../../vendor/emitter/EventEmitter';
|
|
50
45
|
import Keyboard from '../Keyboard/Keyboard';
|
|
51
46
|
import TextInputState from '../TextInput/TextInputState';
|
|
52
47
|
import processDecelerationRate from './processDecelerationRate';
|
|
@@ -152,7 +147,7 @@ export type DecelerationRateType = 'fast' | 'normal' | number;
|
|
|
152
147
|
export type ScrollResponderType = ScrollViewImperativeMethods;
|
|
153
148
|
|
|
154
149
|
type PublicScrollViewInstance = $ReadOnly<{|
|
|
155
|
-
|
|
150
|
+
...HostInstance,
|
|
156
151
|
...ScrollViewImperativeMethods,
|
|
157
152
|
|}>;
|
|
158
153
|
|
|
@@ -743,10 +738,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
743
738
|
_subscriptionKeyboardDidShow: ?EventSubscription = null;
|
|
744
739
|
_subscriptionKeyboardDidHide: ?EventSubscription = null;
|
|
745
740
|
|
|
746
|
-
#onScrollEmitter: ?EventEmitter<{
|
|
747
|
-
scroll: [{x: number, y: number}],
|
|
748
|
-
}> = null;
|
|
749
|
-
|
|
750
741
|
state: State = {
|
|
751
742
|
layoutHeight: null,
|
|
752
743
|
};
|
|
@@ -817,8 +808,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
817
808
|
if (this._scrollAnimatedValueAttachment) {
|
|
818
809
|
this._scrollAnimatedValueAttachment.detach();
|
|
819
810
|
}
|
|
820
|
-
|
|
821
|
-
this.#onScrollEmitter?.removeAllListeners();
|
|
822
811
|
}
|
|
823
812
|
|
|
824
813
|
/**
|
|
@@ -844,9 +833,8 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
844
833
|
return this._innerView.nativeInstance;
|
|
845
834
|
};
|
|
846
835
|
|
|
847
|
-
getNativeScrollRef: () =>
|
|
848
|
-
|
|
849
|
-
return nativeInstance == null ? null : nativeInstance.componentRef.current;
|
|
836
|
+
getNativeScrollRef: () => HostInstance | null = () => {
|
|
837
|
+
return this._scrollView.nativeInstance;
|
|
850
838
|
};
|
|
851
839
|
|
|
852
840
|
/**
|
|
@@ -937,20 +925,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
937
925
|
Commands.flashScrollIndicators(component);
|
|
938
926
|
};
|
|
939
927
|
|
|
940
|
-
_subscribeToOnScroll: (
|
|
941
|
-
callback: ({x: number, y: number}) => void,
|
|
942
|
-
) => EventSubscription = callback => {
|
|
943
|
-
let onScrollEmitter = this.#onScrollEmitter;
|
|
944
|
-
if (onScrollEmitter == null) {
|
|
945
|
-
onScrollEmitter = new EventEmitter();
|
|
946
|
-
this.#onScrollEmitter = onScrollEmitter;
|
|
947
|
-
// This is the first subscription, so make sure the native component is
|
|
948
|
-
// also configured to output synchronous scroll events.
|
|
949
|
-
this._scrollView.nativeInstance?.unstable_setEnableSyncOnScroll(true);
|
|
950
|
-
}
|
|
951
|
-
return onScrollEmitter.addListener('scroll', callback);
|
|
952
|
-
};
|
|
953
|
-
|
|
954
928
|
/**
|
|
955
929
|
* This method should be used as the callback to onFocus in a TextInputs'
|
|
956
930
|
* parent view. Note that any module using this mixin needs to return
|
|
@@ -1154,11 +1128,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1154
1128
|
_handleScroll = (e: ScrollEvent) => {
|
|
1155
1129
|
this._observedScrollSinceBecomingResponder = true;
|
|
1156
1130
|
this.props.onScroll && this.props.onScroll(e);
|
|
1157
|
-
|
|
1158
|
-
this.#onScrollEmitter?.emit('scroll', {
|
|
1159
|
-
x: e.nativeEvent.contentOffset.x,
|
|
1160
|
-
y: e.nativeEvent.contentOffset.y,
|
|
1161
|
-
});
|
|
1162
1131
|
};
|
|
1163
1132
|
|
|
1164
1133
|
_handleLayout = (e: LayoutEvent) => {
|
|
@@ -1181,45 +1150,36 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1181
1150
|
(instance: InnerViewInstance): InnerViewInstance => instance,
|
|
1182
1151
|
);
|
|
1183
1152
|
|
|
1184
|
-
_scrollView: RefForwarder<
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
scrollToEnd: this.scrollToEnd,
|
|
1212
|
-
flashScrollIndicators: this.flashScrollIndicators,
|
|
1213
|
-
scrollResponderZoomTo: this.scrollResponderZoomTo,
|
|
1214
|
-
// TODO: Replace unstable_subscribeToOnScroll once scrollView.addEventListener('scroll', (e: ScrollEvent) => {}, {passive: false});
|
|
1215
|
-
unstable_subscribeToOnScroll: this._subscribeToOnScroll,
|
|
1216
|
-
scrollResponderScrollNativeHandleToKeyboard:
|
|
1217
|
-
this.scrollResponderScrollNativeHandleToKeyboard,
|
|
1218
|
-
},
|
|
1219
|
-
);
|
|
1153
|
+
_scrollView: RefForwarder<HostInstance, PublicScrollViewInstance | null> =
|
|
1154
|
+
createRefForwarder(nativeInstance => {
|
|
1155
|
+
// This is a hack. Ideally we would forwardRef to the underlying
|
|
1156
|
+
// host component. However, since ScrollView has it's own methods that can be
|
|
1157
|
+
// called as well, if we used the standard forwardRef then these
|
|
1158
|
+
// methods wouldn't be accessible and thus be a breaking change.
|
|
1159
|
+
//
|
|
1160
|
+
// Therefore we edit ref to include ScrollView's public methods so that
|
|
1161
|
+
// they are callable from the ref.
|
|
1162
|
+
|
|
1163
|
+
// $FlowFixMe[prop-missing] - Known issue with appending custom methods.
|
|
1164
|
+
const publicInstance: PublicScrollViewInstance = Object.assign(
|
|
1165
|
+
nativeInstance,
|
|
1166
|
+
{
|
|
1167
|
+
getScrollResponder: this.getScrollResponder,
|
|
1168
|
+
getScrollableNode: this.getScrollableNode,
|
|
1169
|
+
getInnerViewNode: this.getInnerViewNode,
|
|
1170
|
+
getInnerViewRef: this.getInnerViewRef,
|
|
1171
|
+
getNativeScrollRef: this.getNativeScrollRef,
|
|
1172
|
+
scrollTo: this.scrollTo,
|
|
1173
|
+
scrollToEnd: this.scrollToEnd,
|
|
1174
|
+
flashScrollIndicators: this.flashScrollIndicators,
|
|
1175
|
+
scrollResponderZoomTo: this.scrollResponderZoomTo,
|
|
1176
|
+
scrollResponderScrollNativeHandleToKeyboard:
|
|
1177
|
+
this.scrollResponderScrollNativeHandleToKeyboard,
|
|
1178
|
+
},
|
|
1179
|
+
);
|
|
1220
1180
|
|
|
1221
|
-
|
|
1222
|
-
|
|
1181
|
+
return publicInstance;
|
|
1182
|
+
});
|
|
1223
1183
|
|
|
1224
1184
|
/**
|
|
1225
1185
|
* Warning, this may be called several times for a single keyboard opening.
|
|
@@ -1829,8 +1789,9 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1829
1789
|
}
|
|
1830
1790
|
|
|
1831
1791
|
const refreshControl = this.props.refreshControl;
|
|
1832
|
-
const scrollViewRef
|
|
1833
|
-
this.
|
|
1792
|
+
const scrollViewRef = this._scrollView.getForwardingRef(
|
|
1793
|
+
this.props.scrollViewRef,
|
|
1794
|
+
);
|
|
1834
1795
|
|
|
1835
1796
|
if (refreshControl) {
|
|
1836
1797
|
if (Platform.OS === 'ios') {
|
|
@@ -45,7 +45,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
45
45
|
diff: require('../../Utilities/differ/pointsDiffer'),
|
|
46
46
|
},
|
|
47
47
|
decelerationRate: true,
|
|
48
|
-
enableSyncOnScroll: true, // Fabric only.
|
|
49
48
|
disableIntervalMomentum: true,
|
|
50
49
|
maintainVisibleContentPosition: true,
|
|
51
50
|
pagingEnabled: true,
|
|
@@ -135,7 +134,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
135
134
|
contentInsetAdjustmentBehavior: true,
|
|
136
135
|
decelerationRate: true,
|
|
137
136
|
endDraggingSensitivityMultiplier: true,
|
|
138
|
-
enableSyncOnScroll: true, // Fabric only.
|
|
139
137
|
directionalLockEnabled: true,
|
|
140
138
|
disableIntervalMomentum: true,
|
|
141
139
|
indicatorStyle: true,
|
|
@@ -266,6 +266,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
266
266
|
*/
|
|
267
267
|
inputAccessoryViewID?: ?string,
|
|
268
268
|
|
|
269
|
+
/**
|
|
270
|
+
* An optional label that overrides the default input accessory view button label.
|
|
271
|
+
* @platform ios
|
|
272
|
+
*/
|
|
273
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
274
|
+
|
|
269
275
|
/**
|
|
270
276
|
* Determines the color of the keyboard.
|
|
271
277
|
* @platform ios
|
|
@@ -310,6 +310,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
310
310
|
*/
|
|
311
311
|
inputAccessoryViewID?: ?string,
|
|
312
312
|
|
|
313
|
+
/**
|
|
314
|
+
* An optional label that overrides the default input accessory view button label.
|
|
315
|
+
* @platform ios
|
|
316
|
+
*/
|
|
317
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
318
|
+
|
|
313
319
|
/**
|
|
314
320
|
* Determines the color of the keyboard.
|
|
315
321
|
* @platform ios
|
|
@@ -1533,7 +1539,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1533
1539
|
|
|
1534
1540
|
// TextInput handles onBlur and onFocus events
|
|
1535
1541
|
// so omitting onBlur and onFocus pressability handlers here.
|
|
1536
|
-
const {onBlur, onFocus, ...eventHandlers} = usePressability(config)
|
|
1542
|
+
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
|
1537
1543
|
|
|
1538
1544
|
let _accessibilityState;
|
|
1539
1545
|
if (
|
|
@@ -321,6 +321,12 @@ type IOSProps = $ReadOnly<{|
|
|
|
321
321
|
*/
|
|
322
322
|
inputAccessoryViewID?: ?string,
|
|
323
323
|
|
|
324
|
+
/**
|
|
325
|
+
* An optional label that overrides the default input accessory view button label.
|
|
326
|
+
* @platform ios
|
|
327
|
+
*/
|
|
328
|
+
inputAccessoryViewButtonLabel?: ?string,
|
|
329
|
+
|
|
324
330
|
/**
|
|
325
331
|
* Determines the color of the keyboard.
|
|
326
332
|
* @platform ios
|
|
@@ -1590,7 +1596,7 @@ function InternalTextInput(props: Props): React.Node {
|
|
|
1590
1596
|
|
|
1591
1597
|
// TextInput handles onBlur and onFocus events
|
|
1592
1598
|
// so omitting onBlur and onFocus pressability handlers here.
|
|
1593
|
-
const {onBlur, onFocus, ...eventHandlers} = usePressability(config)
|
|
1599
|
+
const {onBlur, onFocus, ...eventHandlers} = usePressability(config);
|
|
1594
1600
|
const eventPhase = Object.freeze({Capturing: 1, Bubbling: 3});
|
|
1595
1601
|
const _keyDown = (event: KeyEvent) => {
|
|
1596
1602
|
if (props.keyDownEvents && event.isPropagationStopped() !== true) {
|
|
@@ -195,8 +195,7 @@ module.exports = function TouchableWithoutFeedback(props: Props): React.Node {
|
|
|
195
195
|
|
|
196
196
|
// BACKWARD-COMPATIBILITY: Focus and blur events were never supported before
|
|
197
197
|
// adopting `Pressability`, so preserve that behavior.
|
|
198
|
-
const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} =
|
|
199
|
-
eventHandlers || {};
|
|
198
|
+
const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} = eventHandlers;
|
|
200
199
|
|
|
201
200
|
const elementProps: {[string]: mixed, ...} = {
|
|
202
201
|
...eventHandlersWithoutBlurAndFocus,
|
|
@@ -343,6 +343,13 @@ export interface ViewProps
|
|
|
343
343
|
* Used to reference react managed views from native code.
|
|
344
344
|
*/
|
|
345
345
|
nativeID?: string | undefined;
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Contols whether this view, and its transitive children, are laid in a way
|
|
349
|
+
* consistent with web browsers ('strict'), or consistent with existing
|
|
350
|
+
* React Native code which may rely on incorrect behavior ('classic').
|
|
351
|
+
*/
|
|
352
|
+
experimental_layoutConformance?: 'strict' | 'classic' | undefined;
|
|
346
353
|
}
|
|
347
354
|
|
|
348
355
|
// For backwards compat.... // Win32
|
|
@@ -177,10 +177,7 @@ function reactConsoleErrorHandler(...args) {
|
|
|
177
177
|
if (!console.reportErrorsAsExceptions) {
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
if (
|
|
181
|
-
inExceptionHandler ||
|
|
182
|
-
(global.RN$inExceptionHandler && global.RN$inExceptionHandler())
|
|
183
|
-
) {
|
|
180
|
+
if (inExceptionHandler || global.RN$inExceptionHandler?.()) {
|
|
184
181
|
// The fundamental trick here is that are multiple entry point to logging errors:
|
|
185
182
|
// (see D19743075 for more background)
|
|
186
183
|
//
|
|
@@ -10,24 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
ExceptionsManager
|
|
13
|
+
if (global.RN$useAlwaysAvailableJSErrorHandling !== true) {
|
|
14
|
+
/**
|
|
15
|
+
* Sets up the console and exception handling (redbox) for React Native.
|
|
16
|
+
* You can use this module directly, or just require InitializeCore.
|
|
17
|
+
*/
|
|
18
|
+
const ExceptionsManager = require('./ExceptionsManager');
|
|
19
|
+
ExceptionsManager.installConsoleErrorReporter();
|
|
19
20
|
|
|
20
|
-
// Set up error handler
|
|
21
|
-
if (!global.__fbDisableExceptionsManager) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
// Set up error handler
|
|
22
|
+
if (!global.__fbDisableExceptionsManager) {
|
|
23
|
+
const handleError = (e: mixed, isFatal: boolean) => {
|
|
24
|
+
try {
|
|
25
|
+
ExceptionsManager.handleException(e, isFatal);
|
|
26
|
+
} catch (ee) {
|
|
27
|
+
console.log('Failed to print error: ', ee.message);
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const ErrorUtils = require('../vendor/core/ErrorUtils');
|
|
33
|
+
ErrorUtils.setGlobalHandler(handleError);
|
|
34
|
+
}
|
|
33
35
|
}
|