@office-iss/react-native-win32 0.66.4 → 0.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.flowconfig +1 -1
- package/CHANGELOG.json +228 -46
- package/CHANGELOG.md +102 -25
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/components/AnimatedView.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +3 -34
- package/Libraries/Components/Button/ButtonWin32.js +2 -2
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/EnterString.win32.js +3 -3
- package/Libraries/Components/EnterString.win32.js.map +1 -1
- package/Libraries/Components/Keyboard/Keyboard.js +2 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.js +17 -16
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Components/Text/Tests/TextWin32Test.d.ts +0 -1
- package/Libraries/Components/Text/TextWin32.Props.d.ts +2 -2
- package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
- package/Libraries/Components/Text/TextWin32.js +1 -1
- package/Libraries/Components/Text/TextWin32.js.map +1 -1
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +0 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -6
- package/Libraries/Components/TextInput/TextInput.win32.js.map +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +0 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/View/Tests/ViewWin32Test.d.ts +0 -1
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +1 -1
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +3 -6
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Components/View/ViewWin32.js +5 -5
- package/Libraries/Components/View/ViewWin32.js.map +1 -1
- package/Libraries/Core/ExceptionsManager.js +45 -80
- package/Libraries/Core/ExtendedError.js +0 -1
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -4
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/Image/Image.win32.js +6 -0
- package/Libraries/Image/ImageBackground.js +10 -8
- package/Libraries/Image/ImageProps.js +28 -0
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +0 -1
- package/Libraries/LogBox/Data/LogBoxData.js +18 -19
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
- package/Libraries/PersonaCoin/PersonaCoin.js +3 -2
- package/Libraries/PersonaCoin/PersonaCoin.js.map +1 -1
- package/Libraries/Pressability/Pressability.js +13 -13
- package/Libraries/Pressability/Pressability.win32.js +13 -13
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +4 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/index.win32.js +15 -10
- package/jest/mockModal.js +31 -0
- package/jest/preprocessor.js +7 -75
- package/jest/setup.js +5 -3
- package/overrides.json +8 -14
- package/package.json +19 -17
- package/rntypes/BatchedBridge.d.ts +23 -0
- package/rntypes/Devtools.d.ts +20 -0
- package/rntypes/LaunchScreen.d.ts +9 -0
- package/rntypes/globals.d.ts +496 -0
- package/rntypes/index.d.ts +9966 -0
- package/rntypes/legacy-properties.d.ts +266 -0
- package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -2
- package/src/Libraries/Components/View/ViewWin32.Props.ts +6 -12
- package/src/rntypes/BatchedBridge.d.ts +23 -0
- package/src/rntypes/Devtools.d.ts +20 -0
- package/src/rntypes/LaunchScreen.d.ts +9 -0
- package/src/rntypes/globals.d.ts +496 -0
- package/src/rntypes/index.d.ts +9966 -0
- package/src/rntypes/legacy-properties.d.ts +266 -0
- package/src/typings-index.ts +11 -4
- package/typings-index.d.ts +3 -1
- package/typings-index.js +7 -5
- package/typings-index.js.map +1 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.win32.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
- package/Libraries/Interaction/InteractionMixin.js +0 -54
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
|
@@ -24,7 +24,7 @@ import invariant from 'invariant';
|
|
|
24
24
|
|
|
25
25
|
// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%.
|
|
26
26
|
const NativeAnimatedModule =
|
|
27
|
-
Platform.OS === 'ios' && global.RN$Bridgeless
|
|
27
|
+
Platform.OS === 'ios' && global.RN$Bridgeless === true
|
|
28
28
|
? NativeAnimatedTurboModule
|
|
29
29
|
: NativeAnimatedNonTurboModule;
|
|
30
30
|
|
|
@@ -355,7 +355,7 @@ function shouldUseNativeDriver(
|
|
|
355
355
|
'animated module is missing. Falling back to JS-based animation. To ' +
|
|
356
356
|
'resolve this, add `RCTAnimation` module to this app, or remove ' +
|
|
357
357
|
'`useNativeDriver`. ' +
|
|
358
|
-
'Make sure to run `pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md',
|
|
358
|
+
'Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md',
|
|
359
359
|
);
|
|
360
360
|
_warnedMissingNativeAnimated = true;
|
|
361
361
|
}
|
|
@@ -15,9 +15,9 @@ const createAnimatedComponent = require('../createAnimatedComponent');
|
|
|
15
15
|
|
|
16
16
|
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
|
17
17
|
|
|
18
|
-
module.exports = (createAnimatedComponent(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
module.exports = (createAnimatedComponent(
|
|
19
|
+
(Image: $FlowFixMe),
|
|
20
|
+
): AnimatedComponentType<
|
|
21
21
|
React.ElementConfig<typeof Image>,
|
|
22
22
|
React.ElementRef<typeof Image>,
|
|
23
23
|
>);
|
|
@@ -22,9 +22,9 @@ const ScrollViewWithEventThrottle = React.forwardRef((props, ref) => (
|
|
|
22
22
|
<ScrollView scrollEventThrottle={0.0001} {...props} ref={ref} />
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
-
module.exports = (createAnimatedComponent(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
module.exports = (createAnimatedComponent(
|
|
26
|
+
ScrollViewWithEventThrottle,
|
|
27
|
+
): AnimatedComponentType<
|
|
28
28
|
React.ElementConfig<typeof ScrollView>,
|
|
29
29
|
React.ElementRef<typeof ScrollView>,
|
|
30
30
|
>);
|
|
@@ -15,9 +15,9 @@ const createAnimatedComponent = require('../createAnimatedComponent');
|
|
|
15
15
|
|
|
16
16
|
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
|
17
17
|
|
|
18
|
-
module.exports = (createAnimatedComponent(
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
module.exports = (createAnimatedComponent(
|
|
19
|
+
(Text: $FlowFixMe),
|
|
20
|
+
): AnimatedComponentType<
|
|
21
21
|
React.ElementConfig<typeof Text>,
|
|
22
22
|
React.ElementRef<typeof Text>,
|
|
23
23
|
>);
|
|
@@ -15,9 +15,7 @@ const createAnimatedComponent = require('../createAnimatedComponent');
|
|
|
15
15
|
|
|
16
16
|
import type {AnimatedComponentType} from '../createAnimatedComponent';
|
|
17
17
|
|
|
18
|
-
module.exports = (createAnimatedComponent(View
|
|
19
|
-
collapsable: true,
|
|
20
|
-
}): AnimatedComponentType<
|
|
18
|
+
module.exports = (createAnimatedComponent(View): AnimatedComponentType<
|
|
21
19
|
React.ElementConfig<typeof View>,
|
|
22
20
|
React.ElementRef<typeof View>,
|
|
23
21
|
>);
|
|
@@ -39,13 +39,8 @@ export type AnimatedComponentType<
|
|
|
39
39
|
Instance,
|
|
40
40
|
>;
|
|
41
41
|
|
|
42
|
-
type AnimatedComponentOptions = {
|
|
43
|
-
collapsable?: boolean,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
42
|
function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
|
|
47
43
|
Component: React.AbstractComponent<Props, Instance>,
|
|
48
|
-
options?: AnimatedComponentOptions,
|
|
49
44
|
): AnimatedComponentType<Props, Instance> {
|
|
50
45
|
invariant(
|
|
51
46
|
typeof Component !== 'function' ||
|
|
@@ -210,39 +205,13 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
|
|
|
210
205
|
this.props.passthroughAnimatedPropExplicitValues || {};
|
|
211
206
|
const mergedStyle = {...style, ...passthruStyle};
|
|
212
207
|
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
// Because we do not get a host component ref immediately and thus cannot
|
|
216
|
-
// do a proper Fabric vs non-Fabric detection immediately, we default to assuming
|
|
217
|
-
// that Fabric *is* enabled until we know otherwise.
|
|
218
|
-
// Thus, in Fabric, this view will never be flattened. In non-Fabric, the view will
|
|
219
|
-
// not be flattened during the initial render but may be flattened in the second render
|
|
220
|
-
// and onwards.
|
|
221
|
-
const forceNativeIdFabric =
|
|
222
|
-
(this._component == null &&
|
|
223
|
-
(options?.collapsable === false || props.collapsable !== true)) ||
|
|
224
|
-
this._isFabric();
|
|
225
|
-
|
|
226
|
-
const forceNativeId =
|
|
227
|
-
props.collapsable ??
|
|
228
|
-
(this._propsAnimated.__isNative ||
|
|
229
|
-
forceNativeIdFabric ||
|
|
230
|
-
options?.collapsable === false);
|
|
231
|
-
// The native driver updates views directly through the UI thread so we
|
|
232
|
-
// have to make sure the view doesn't get optimized away because it cannot
|
|
233
|
-
// go through the NativeViewHierarchyManager since it operates on the shadow
|
|
234
|
-
// thread. TODO: T68258846
|
|
235
|
-
const collapsableProps = forceNativeId
|
|
236
|
-
? {
|
|
237
|
-
nativeID: props.nativeID ?? 'animatedComponent',
|
|
238
|
-
collapsable: false,
|
|
239
|
-
}
|
|
240
|
-
: {};
|
|
208
|
+
// Force `collapsable` to be false so that native view is not flattened.
|
|
209
|
+
// Flattened views cannot be accurately referenced by a native driver.
|
|
241
210
|
return (
|
|
242
211
|
<Component
|
|
243
212
|
{...props}
|
|
244
213
|
{...passthruProps}
|
|
245
|
-
{
|
|
214
|
+
collapsable={false}
|
|
246
215
|
style={mergedStyle}
|
|
247
216
|
ref={this._setComponentRef}
|
|
248
217
|
/>
|
|
@@ -76,8 +76,8 @@ class ButtonWin32 extends react_1.default.Component {
|
|
|
76
76
|
if (this.props.color) {
|
|
77
77
|
textProps.style = { color: this.props.color };
|
|
78
78
|
}
|
|
79
|
-
return (react_1.default.createElement(ViewWin32_1.ViewWin32,
|
|
80
|
-
react_1.default.createElement(TextWin32_1.TextWin32,
|
|
79
|
+
return (react_1.default.createElement(ViewWin32_1.ViewWin32, { ...viewProps },
|
|
80
|
+
react_1.default.createElement(TextWin32_1.TextWin32, { ...textProps }, this.props.title)));
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
exports.ButtonWin32 = ButtonWin32;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonWin32.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Button/ButtonWin32.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,iDAA8C;AAE9C,iDAA8C;AAI9C,IAAW,WAGV;AAHD,WAAW,WAAW;IACpB,2DAAW,CAAA;IACX,qDAAQ,CAAA;AACV,CAAC,EAHU,WAAW,KAAX,WAAW,QAGrB;AAMD;;GAEG;A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 } from '../View/ViewWin32';\nimport { IViewWin32Props } from '../View/ViewWin32.Props';\nimport { TextWin32 } from '../Text/TextWin32';\nimport { ITextWin32Props } from '../Text/TextWin32.Props';\nimport { IButtonWin32Props } from './ButtonWin32.Props';\n\nconst enum SelectState {\n NotSelected,\n Selected\n}\n\ninterface IButtonWin32State {\n accessibilityState: RN.AccessibilityState;\n}\n\n/**\n * React-native <Button> control with additional Win32-specific functionality.\n */\nexport class ButtonWin32 extends React.Component<IButtonWin32Props, IButtonWin32State> {\n constructor(props: IButtonWin32Props) {\n super(props);\n this.state = this._makeState(SelectState.NotSelected);\n }\n\n public render() {\n const viewProps: IViewWin32Props = {\n accessible: true,\n accessibilityLabel: this.props.accessibilityLabel || this.props.title,\n accessibilityRole: 'button',\n accessibilityState: this.state.accessibilityState,\n focusable: true,\n onFocus: this._onFocus,\n onBlur: this._onBlur,\n onMouseEnter: this.props.onMouseEnter,\n onMouseLeave: this.props.onMouseLeave,\n onTouchStart: this.props.onTouchStart,\n onTouchEnd: this._onTouchEnd,\n testID: this.props.testID,\n style: this.props.style as RN.StyleProp<RN.ViewStyle>,\n };\n\n const textProps: ITextWin32Props = {\n textStyle: 'None',\n };\n if (this.props.color) {\n textProps.style = { color: this.props.color };\n }\n\n return (\n <ViewWin32 {...viewProps}>\n <TextWin32 {...textProps}>{this.props.title}</TextWin32>\n </ViewWin32>\n );\n }\n\n private readonly _makeState = (select: SelectState): IButtonWin32State => {\n return {\n accessibilityState: {\n disabled: this.props.disabled,\n selected: select === SelectState.Selected,\n },\n };\n };\n\n private readonly _setState = (select: SelectState): void => {\n const state = this._makeState(select);\n this.setState(state);\n };\n\n private readonly _onFocus = (): void => {\n this._setState(SelectState.Selected);\n if (this.props.onFocus) {\n this.props.onFocus();\n }\n };\n\n private readonly _onBlur = (): void => {\n this._setState(SelectState.NotSelected);\n if (this.props.onBlur) {\n this.props.onBlur();\n }\n };\n\n private readonly _onTouchEnd = (event: RN.GestureResponderEvent): void => {\n if (!this.props.disabled) {\n if (this.props.onPress) {\n this.props.onPress(event);\n }\n }\n if (this.props.onTouchEnd) {\n this.props.onTouchEnd(event);\n }\n };\n}\n"]}
|
|
@@ -145,6 +145,7 @@ type ButtonProps = $ReadOnly<{|
|
|
|
145
145
|
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
|
146
146
|
onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
|
|
147
147
|
accessibilityState?: ?AccessibilityState,
|
|
148
|
+
accessibilityHint?: ?string,
|
|
148
149
|
|}>;
|
|
149
150
|
|
|
150
151
|
/**
|
|
@@ -275,6 +276,7 @@ class Button extends React.Component<ButtonProps> {
|
|
|
275
276
|
testID,
|
|
276
277
|
accessible,
|
|
277
278
|
accessibilityActions,
|
|
279
|
+
accessibilityHint,
|
|
278
280
|
onAccessibilityAction,
|
|
279
281
|
} = this.props;
|
|
280
282
|
const buttonStyles = [styles.button];
|
|
@@ -317,6 +319,7 @@ class Button extends React.Component<ButtonProps> {
|
|
|
317
319
|
accessibilityActions={accessibilityActions}
|
|
318
320
|
onAccessibilityAction={onAccessibilityAction}
|
|
319
321
|
accessibilityLabel={accessibilityLabel}
|
|
322
|
+
accessibilityHint={accessibilityHint}
|
|
320
323
|
accessibilityRole="button"
|
|
321
324
|
accessibilityState={accessibilityState}
|
|
322
325
|
hasTVPreferredFocus={hasTVPreferredFocus}
|
|
@@ -117,10 +117,6 @@ type Props = $ReadOnly<{|
|
|
|
117
117
|
* source of truth.
|
|
118
118
|
*/
|
|
119
119
|
class DatePickerIOS extends React.Component<Props> {
|
|
120
|
-
static DefaultProps: {|mode: $TEMPORARY$string<'datetime'>|} = {
|
|
121
|
-
mode: 'datetime',
|
|
122
|
-
};
|
|
123
|
-
|
|
124
120
|
_picker: ?React.ElementRef<typeof RCTDatePickerNativeComponent> = null;
|
|
125
121
|
|
|
126
122
|
componentDidUpdate() {
|
|
@@ -142,6 +138,7 @@ class DatePickerIOS extends React.Component<Props> {
|
|
|
142
138
|
|
|
143
139
|
render(): React.Node {
|
|
144
140
|
const props = this.props;
|
|
141
|
+
const mode = props.mode ?? 'datetime';
|
|
145
142
|
invariant(
|
|
146
143
|
props.date || props.initialDate,
|
|
147
144
|
'A selected date or initial date should be specified.',
|
|
@@ -153,7 +150,7 @@ class DatePickerIOS extends React.Component<Props> {
|
|
|
153
150
|
ref={picker => {
|
|
154
151
|
this._picker = picker;
|
|
155
152
|
}}
|
|
156
|
-
style={getHeight(props.pickerStyle,
|
|
153
|
+
style={getHeight(props.pickerStyle, mode)}
|
|
157
154
|
date={
|
|
158
155
|
props.date
|
|
159
156
|
? props.date.getTime()
|
|
@@ -172,7 +169,7 @@ class DatePickerIOS extends React.Component<Props> {
|
|
|
172
169
|
minimumDate={
|
|
173
170
|
props.minimumDate ? props.minimumDate.getTime() : undefined
|
|
174
171
|
}
|
|
175
|
-
mode={
|
|
172
|
+
mode={mode}
|
|
176
173
|
minuteInterval={props.minuteInterval}
|
|
177
174
|
timeZoneOffsetInMinutes={props.timeZoneOffsetInMinutes}
|
|
178
175
|
onChange={this._onChange}
|
|
@@ -56,7 +56,7 @@ type Props = $ReadOnly<{|
|
|
|
56
56
|
* );
|
|
57
57
|
* ```
|
|
58
58
|
*/
|
|
59
|
-
drawerBackgroundColor
|
|
59
|
+
drawerBackgroundColor?: ?ColorValue,
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Specifies the side of the screen from which the drawer will slide in.
|
|
@@ -161,11 +161,6 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
161
161
|
|
|
162
162
|
return {Left: 'left', Right: 'right'};
|
|
163
163
|
}
|
|
164
|
-
static defaultProps: {|
|
|
165
|
-
drawerBackgroundColor: 'white',
|
|
166
|
-
|} = {
|
|
167
|
-
drawerBackgroundColor: 'white',
|
|
168
|
-
};
|
|
169
164
|
|
|
170
165
|
_nativeRef = React.createRef<
|
|
171
166
|
React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
|
|
@@ -175,6 +170,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
175
170
|
|
|
176
171
|
render(): React.Node {
|
|
177
172
|
const {
|
|
173
|
+
drawerBackgroundColor = 'white',
|
|
178
174
|
onDrawerStateChanged,
|
|
179
175
|
renderNavigationView,
|
|
180
176
|
onDrawerOpen,
|
|
@@ -189,7 +185,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
189
185
|
styles.drawerSubview,
|
|
190
186
|
{
|
|
191
187
|
width: this.props.drawerWidth,
|
|
192
|
-
backgroundColor:
|
|
188
|
+
backgroundColor: drawerBackgroundColor,
|
|
193
189
|
},
|
|
194
190
|
]}
|
|
195
191
|
collapsable={false}>
|
|
@@ -220,6 +216,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
|
|
|
220
216
|
<AndroidDrawerLayoutNativeComponent
|
|
221
217
|
{...props}
|
|
222
218
|
ref={this._nativeRef}
|
|
219
|
+
drawerBackgroundColor={drawerBackgroundColor}
|
|
223
220
|
drawerWidth={this.props.drawerWidth}
|
|
224
221
|
drawerPosition={this.props.drawerPosition}
|
|
225
222
|
drawerLockMode={this.props.drawerLockMode}
|
|
@@ -11,7 +11,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
11
11
|
const PropTypes = require("prop-types");
|
|
12
12
|
class EnterStringNative extends react_1.default.Component {
|
|
13
13
|
render() {
|
|
14
|
-
return react_1.default.createElement(RCTEnterString,
|
|
14
|
+
return react_1.default.createElement(RCTEnterString, { ...this.props });
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
// mixins: [NativeMethodsMixin],
|
|
@@ -57,14 +57,14 @@ EnterStringNative.DefaultProps = {
|
|
|
57
57
|
label: '',
|
|
58
58
|
onChanged: null,
|
|
59
59
|
};
|
|
60
|
-
const RCTEnterString = react_native_1.requireNativeComponent('RCTEnterString');
|
|
60
|
+
const RCTEnterString = (0, react_native_1.requireNativeComponent)('RCTEnterString');
|
|
61
61
|
class EnterString extends react_1.default.Component {
|
|
62
62
|
render() {
|
|
63
63
|
const args = { ...this.props };
|
|
64
64
|
if (args.onChanged) {
|
|
65
65
|
args.onChanged = this._onChangedNative.bind(this);
|
|
66
66
|
} // TODO how should this work without the cast
|
|
67
|
-
return react_1.default.createElement(EnterStringNative,
|
|
67
|
+
return react_1.default.createElement(EnterStringNative, { ...args });
|
|
68
68
|
}
|
|
69
69
|
_onChangedNative(event) {
|
|
70
70
|
if (this.props.onChanged) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterString.win32.js","sourceRoot":"","sources":["../../src/Libraries/Components/EnterString.win32.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,CAAC;;;;;AAEb,+CAA4E;AAC5E,kDAAyB;AACzB,wCAAyC;AAuBzC,MAAM,iBAAkB,SAAQ,eAAK,CAAC,SAAsC;IAmDnE,MAAM;QACX,OAAO,8BAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"EnterString.win32.js","sourceRoot":"","sources":["../../src/Libraries/Components/EnterString.win32.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,YAAY,CAAC;;;;;AAEb,+CAA4E;AAC5E,kDAAyB;AACzB,wCAAyC;AAuBzC,MAAM,iBAAkB,SAAQ,eAAK,CAAC,SAAsC;IAmDnE,MAAM;QACX,OAAO,8BAAC,cAAc,OAAK,IAAI,CAAC,KAAK,GAAI,CAAC;IAC5C,CAAC;;AApDD,gCAAgC;AAEhC;;;GAGG;AACH;;;;;;;;;;EAUE;AAEH,8CAA8C;AAC/B,2BAAS,GAAQ;IAC7B,mDAAmD;IACnD,qBAAqB;IACrB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC,MAAM;IAEvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC,IAAI;IAExB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC,MAAM;IAEvB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC,IAAI;CAC1B,CAAC;AAEY,8BAAY,GAA4B;IACpD,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,IAAI;CAChB,CAAC;AAOJ,MAAM,cAAc,GAAG,IAAA,qCAAsB,EAAC,gBAAgB,CAAC,CAAC;AAEhE,MAAqB,WAAY,SAAQ,eAAK,CAAC,SAAgC;IAQtE,MAAM;QACX,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACnD,CAAC,6CAA6C;QAE/C,OAAO,8BAAC,iBAAiB,OAAM,IAAuC,GAAI,CAAC;IAAE,CAAC;IAExE,gBAAgB,CAAC,KAAsD;QAC7E,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACxB,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SAC9C;IACH,CAAC;;AApBH,8BAqBC;AApBe,wBAAY,GAAsB;IAC9C,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,IAAI;CAChB,CAAC","sourcesContent":["/**\n * @providesModule EnterString\n */\n'use strict';\n\nimport { requireNativeComponent, NativeSyntheticEvent } from 'react-native';\nimport React from 'react'\nimport PropTypes = require('prop-types');\n\nexport interface IEnterStringProps /*extends React.ClassAttributes<React.View>*/ {\n // ViewProperties {\n disabled?: boolean;\n value?: string;\n label?: string;\n onChanged?: (newValue: string) => void;\n}\n\ninterface INativeOnChangedEventArgs {\n text: string;\n}\n\n// Same as EnterStringProps, but the event args are objects\ninterface IEnterStringNativeProps /*extends React.ClassAttributes<React.View>*/ {\n // ViewProperties {\n disabled?: boolean;\n value?: string;\n label?: string;\n onChanged?: (event: NativeSyntheticEvent<INativeOnChangedEventArgs>) => void;\n}\n\nclass EnterStringNative extends React.Component<IEnterStringNativeProps, {}> {\n // mixins: [NativeMethodsMixin],\n\n /**\n * `NativeMethodsMixin` will look for this when invoking `setNativeProps`. We\n * make `this` look like an actual native component class.\n */\n /*\n viewConfig: {\n uiViewClassName: 'RCTEnterString',\n validAttributes: {\n ...ReactNativeViewAttributes.RCTView,\n text: true,\n disabled: true,\n label: true,\n },\n },\n */\n\n // TODO figure out how to get a real type here\n public static propTypes: any = {\n // React.ValidationMap<IEnterStringNativeProps> = {\n // ...View.propTypes,\n /**\n * Text to display inside the EnterString\n */\n value: PropTypes.string,\n\n /**\n * If true, disable all interactions for this component.\n */\n disabled: PropTypes.bool,\n\n /**\n * Label\n */\n label: PropTypes.string,\n\n /**\n * Callback when text is changed\n */\n onChanged: PropTypes.func,\n };\n\n public static DefaultProps: IEnterStringNativeProps = {\n disabled: false,\n value: '',\n label: '',\n onChanged: null,\n };\n\n public render() {\n return <RCTEnterString {...this.props} />;\n }\n}\n\nconst RCTEnterString = requireNativeComponent('RCTEnterString');\n\nexport default class EnterString extends React.Component<IEnterStringProps, {}> {\n public static DefaultProps: IEnterStringProps = {\n disabled: false,\n value: '',\n label: '',\n onChanged: null,\n };\n\n public render() {\n const args = { ...this.props };\n if (args.onChanged) {\n args.onChanged = this._onChangedNative.bind(this);\n } // TODO how should this work without the cast\n\n return <EnterStringNative {...(args as any) as IEnterStringNativeProps} />; }\n\n private _onChangedNative(event: NativeSyntheticEvent<INativeOnChangedEventArgs>) {\n if (this.props.onChanged) {\n this.props.onChanged(event.nativeEvent.text);\n }\n }\n}\n"]}
|
|
@@ -141,9 +141,9 @@ class Keyboard {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* @deprecated Use `remove` on the EventSubscription from `
|
|
144
|
+
* @deprecated Use `remove` on the EventSubscription from `addListener`.
|
|
145
145
|
*/
|
|
146
|
-
|
|
146
|
+
removeListener<K: $Keys<KeyboardEventDefinitions>>(
|
|
147
147
|
eventType: K,
|
|
148
148
|
listener: (...$ElementType<KeyboardEventDefinitions, K>) => mixed,
|
|
149
149
|
): void {
|
|
@@ -31,6 +31,7 @@ const AndroidHorizontalScrollViewNativeComponent: HostComponent<Props> = NativeC
|
|
|
31
31
|
scrollPerfTag: true,
|
|
32
32
|
sendMomentumEvents: true,
|
|
33
33
|
showsHorizontalScrollIndicator: true,
|
|
34
|
+
snapToAlignment: true,
|
|
34
35
|
snapToEnd: true,
|
|
35
36
|
snapToInterval: true,
|
|
36
37
|
snapToStart: true,
|
|
@@ -346,17 +346,6 @@ type IOSProps = $ReadOnly<{|
|
|
|
346
346
|
* The default value is true.
|
|
347
347
|
*/
|
|
348
348
|
showsHorizontalScrollIndicator?: ?boolean,
|
|
349
|
-
/**
|
|
350
|
-
* When `snapToInterval` is set, `snapToAlignment` will define the relationship
|
|
351
|
-
* of the snapping to the scroll view.
|
|
352
|
-
*
|
|
353
|
-
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
|
|
354
|
-
* - `'center'` will align the snap in the center
|
|
355
|
-
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
|
|
356
|
-
*
|
|
357
|
-
* @platform ios
|
|
358
|
-
*/
|
|
359
|
-
snapToAlignment?: ?('start' | 'center' | 'end'),
|
|
360
349
|
/**
|
|
361
350
|
* The current scale of the scroll view content. The default value is 1.0.
|
|
362
351
|
* @platform ios
|
|
@@ -597,6 +586,15 @@ export type Props = $ReadOnly<{|
|
|
|
597
586
|
* for example when you want your list to have an animated hidable header.
|
|
598
587
|
*/
|
|
599
588
|
StickyHeaderComponent?: StickyHeaderComponentType,
|
|
589
|
+
/**
|
|
590
|
+
* When `snapToInterval` is set, `snapToAlignment` will define the relationship
|
|
591
|
+
* of the snapping to the scroll view.
|
|
592
|
+
*
|
|
593
|
+
* - `'start'` (the default) will align the snap at the left (horizontal) or top (vertical)
|
|
594
|
+
* - `'center'` will align the snap in the center
|
|
595
|
+
* - `'end'` will align the snap at the right (horizontal) or bottom (vertical)
|
|
596
|
+
*/
|
|
597
|
+
snapToAlignment?: ?('start' | 'center' | 'end'),
|
|
600
598
|
/**
|
|
601
599
|
* When set, causes the scroll view to stop at multiples of the value of
|
|
602
600
|
* `snapToInterval`. This can be used for paginating through children
|
|
@@ -1178,11 +1176,6 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1178
1176
|
);
|
|
1179
1177
|
}
|
|
1180
1178
|
}
|
|
1181
|
-
if (Platform.OS === 'android') {
|
|
1182
|
-
if (this.props.keyboardDismissMode === 'on-drag' && this._isTouching) {
|
|
1183
|
-
dismissKeyboard();
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
1179
|
this._observedScrollSinceBecomingResponder = true;
|
|
1187
1180
|
this.props.onScroll && this.props.onScroll(e);
|
|
1188
1181
|
};
|
|
@@ -1299,6 +1292,14 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1299
1292
|
*/
|
|
1300
1293
|
_handleScrollBeginDrag: (e: ScrollEvent) => void = (e: ScrollEvent) => {
|
|
1301
1294
|
FrameRateLogger.beginScroll(); // TODO: track all scrolls after implementing onScrollEndAnimation
|
|
1295
|
+
|
|
1296
|
+
if (
|
|
1297
|
+
Platform.OS === 'android' &&
|
|
1298
|
+
this.props.keyboardDismissMode === 'on-drag'
|
|
1299
|
+
) {
|
|
1300
|
+
dismissKeyboard();
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1302
1303
|
this.props.onScrollBeginDrag && this.props.onScrollBeginDrag(e);
|
|
1303
1304
|
};
|
|
1304
1305
|
|