react-native-windows 0.0.0-canary.474 → 0.0.0-canary.477

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.
Files changed (104) hide show
  1. package/.flowconfig +1 -2
  2. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
  3. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  4. package/Libraries/Blob/URL.js +7 -1
  5. package/Libraries/Components/Button.js +3 -0
  6. package/Libraries/Components/Button.windows.js +3 -0
  7. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
  8. package/Libraries/Components/Pressable/Pressable.js +1 -0
  9. package/Libraries/Components/Pressable/Pressable.windows.js +1 -0
  10. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
  11. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
  12. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +7 -3
  13. package/Libraries/Components/StatusBar/StatusBar.js +6 -1
  14. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
  15. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
  16. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
  17. package/Libraries/Components/TextInput/TextInputState.js +10 -2
  18. package/Libraries/Components/TextInput/TextInputState.windows.js +10 -3
  19. package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -1
  20. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  21. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
  22. package/Libraries/Components/Touchable/TouchableHighlight.windows.js +1 -0
  23. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  24. package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
  25. package/Libraries/Components/Touchable/TouchableOpacity.windows.js +1 -0
  26. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
  27. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -0
  28. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  29. package/Libraries/Components/View/ReactNativeViewAttributes.windows.js +1 -0
  30. package/Libraries/Components/View/ViewNativeComponent.js +6 -3
  31. package/Libraries/Components/View/ViewPropTypes.js +9 -0
  32. package/Libraries/Components/View/ViewPropTypes.windows.js +9 -0
  33. package/Libraries/Core/ExceptionsManager.js +1 -1
  34. package/Libraries/Core/ReactNativeVersion.js +1 -1
  35. package/Libraries/Events/CustomEvent.js +32 -0
  36. package/Libraries/Events/EventPolyfill.js +239 -0
  37. package/Libraries/Image/ImageViewNativeComponent.js +9 -3
  38. package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
  39. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  40. package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
  41. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  42. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  43. package/Libraries/LogBox/LogBox.js +2 -21
  44. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
  45. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +2 -0
  46. package/Libraries/ReactNative/renderApplication.js +4 -0
  47. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +4 -0
  48. package/Libraries/Renderer/implementations/ReactFabric-dev.js +3 -3
  49. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +3 -3
  50. package/Libraries/Text/TextProps.js +1 -0
  51. package/Libraries/Utilities/codegenNativeComponent.js +17 -6
  52. package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.cpp +13 -0
  53. package/Microsoft.ReactNative/Fabric/ComponentViewRegistry.h +1 -0
  54. package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +11 -14
  55. package/Microsoft.ReactNative/Fabric/ScrollViewComponentView.cpp +2 -0
  56. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentDescriptor.h +197 -0
  57. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.cpp +308 -0
  58. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputComponentView.h +52 -0
  59. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.cpp +31 -0
  60. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputEventEmitter.h +33 -0
  61. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.cpp +81 -0
  62. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputProps.h +132 -0
  63. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.cpp +193 -0
  64. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputShadowNode.h +85 -0
  65. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.cpp +76 -0
  66. package/Microsoft.ReactNative/Fabric/TextInput/WindowsTextInputState.h +99 -0
  67. package/Microsoft.ReactNative/Fabric/ViewComponentView.cpp +31 -3
  68. package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/slider/SliderMeasurementsManager.cpp +26 -15
  69. package/Microsoft.ReactNative/Fabric/platform/react/renderer/graphics/platform/cxx/react/renderer/graphics/Color.h +1 -1
  70. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.cpp +60 -49
  71. package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/TextLayoutManager.h +11 -3
  72. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +5 -0
  73. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +14 -1
  74. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +37 -3
  75. package/Microsoft.ReactNative/Views/TextInputViewManager.cpp +1 -1
  76. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems +5 -1
  77. package/Microsoft.ReactNative.Cxx/Microsoft.ReactNative.Cxx.vcxitems.filters +2 -3
  78. package/Microsoft.ReactNative.Managed/packages.lock.json +1 -1
  79. package/PropertySheets/Generated/PackageVersion.g.props +1 -1
  80. package/PropertySheets/React.Cpp.props +1 -0
  81. package/ReactCommon/ReactCommon.vcxproj +2 -1
  82. package/ReactCommon/ReactCommon.vcxproj.filters +4 -1
  83. package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/jsi.h +10 -0
  84. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/CallbackWrapper.h +103 -0
  85. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/debug/react_native_assert.h +64 -0
  86. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModule.h +87 -0
  87. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/core/ReactCommon/TurboModuleUtils.h +61 -0
  88. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/mounting/StubViewTree.cpp +310 -0
  89. package/Scripts/OfficeReact.Win32.nuspec +0 -2
  90. package/Scripts/Tfs/Layout-MSRN-Headers.ps1 +2 -1
  91. package/Shared/DevSupportManager.cpp +7 -2
  92. package/Shared/OInstance.cpp +1 -1
  93. package/codegen/NativeActionSheetManagerSpec.g.h +6 -0
  94. package/jest/preprocessor.js +24 -106
  95. package/jest/preprocessor_DO_NOT_USE.js +122 -0
  96. package/package.json +9 -9
  97. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24738
  98. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8354
  99. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -9011
  100. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -25132
  101. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8440
  102. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9094
  103. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/core/RawPropsParser.cpp +0 -162
  104. package/include/Shared/ViewManager.h +0 -34
package/.flowconfig CHANGED
@@ -107,7 +107,6 @@ nonstrict-import=warn
107
107
  deprecated-type=error
108
108
  unsafe-getters-setters=warn
109
109
  unnecessary-invariant=warn
110
- signature-verification-failure=warn
111
110
 
112
111
  [strict]
113
112
  deprecated-type
@@ -119,4 +118,4 @@ untyped-import
119
118
  untyped-type-import
120
119
 
121
120
  [version]
122
- ^0.171.0
121
+ ^0.173.0
@@ -143,6 +143,13 @@ const ActionSheetIOS = {
143
143
  successCallback,
144
144
  );
145
145
  },
146
+
147
+ dismissActionSheet: () => {
148
+ invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist");
149
+ if (typeof RCTActionSheetManager.dismissActionSheet === 'function') {
150
+ RCTActionSheetManager.dismissActionSheet();
151
+ }
152
+ },
146
153
  };
147
154
 
148
155
  module.exports = ActionSheetIOS;
@@ -47,6 +47,7 @@ export interface Spec extends TurboModule {
47
47
  |}) => void,
48
48
  successCallback: (completed: boolean, activityType: ?string) => void,
49
49
  ) => void;
50
+ +dismissActionSheet?: () => void;
50
51
  }
51
52
 
52
53
  export default (TurboModuleRegistry.get<Spec>('ActionSheetManager'): ?Spec);
@@ -101,7 +101,13 @@ export class URLSearchParams {
101
101
  }
102
102
  const last = this._searchParams.length - 1;
103
103
  return this._searchParams.reduce((acc, curr, index) => {
104
- return acc + curr.join('=') + (index === last ? '' : '&');
104
+ return (
105
+ acc +
106
+ encodeURIComponent(curr[0]) +
107
+ '=' +
108
+ encodeURIComponent(curr[1]) +
109
+ (index === last ? '' : '&')
110
+ );
105
111
  }, '');
106
112
  }
107
113
  }
@@ -146,6 +146,7 @@ type ButtonProps = $ReadOnly<{|
146
146
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
147
147
  accessibilityState?: ?AccessibilityState,
148
148
  accessibilityHint?: ?string,
149
+ accessibilityLanguage?: ?Stringish,
149
150
  |}>;
150
151
 
151
152
  /**
@@ -277,6 +278,7 @@ class Button extends React.Component<ButtonProps> {
277
278
  accessible,
278
279
  accessibilityActions,
279
280
  accessibilityHint,
281
+ accessibilityLanguage,
280
282
  onAccessibilityAction,
281
283
  } = this.props;
282
284
  const buttonStyles = [styles.button];
@@ -320,6 +322,7 @@ class Button extends React.Component<ButtonProps> {
320
322
  onAccessibilityAction={onAccessibilityAction}
321
323
  accessibilityLabel={accessibilityLabel}
322
324
  accessibilityHint={accessibilityHint}
325
+ accessibilityLanguage={accessibilityLanguage}
323
326
  accessibilityRole="button"
324
327
  accessibilityState={accessibilityState}
325
328
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -148,6 +148,7 @@ type ButtonProps = $ReadOnly<{|
148
148
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
149
149
  accessibilityState?: ?AccessibilityState,
150
150
  accessibilityHint?: ?string,
151
+ accessibilityLanguage?: ?Stringish,
151
152
 
152
153
  // [Windows
153
154
  /**
@@ -298,6 +299,7 @@ class Button extends React.Component<
298
299
  accessible,
299
300
  accessibilityActions,
300
301
  accessibilityHint,
302
+ accessibilityLanguage,
301
303
  onAccessibilityAction,
302
304
  tabIndex,
303
305
  } = this.props;
@@ -342,6 +344,7 @@ class Button extends React.Component<
342
344
  <Touchable
343
345
  accessibilityLabel={accessibilityLabel}
344
346
  accessibilityHint={accessibilityHint}
347
+ accessibilityLanguage={accessibilityLanguage}
345
348
  accessibilityRole="button"
346
349
  accessibilityState={accessibilityState}
347
350
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -11,6 +11,11 @@
11
11
  import type {TurboModule} from '../../TurboModule/RCTExport';
12
12
  import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry';
13
13
 
14
+ /**
15
+ * This file backs native modules that are used internally at Meta
16
+ * and this JS spec was intentionally left here. In the meanwhile this
17
+ * file should not be deleted.
18
+ */
14
19
  export interface Spec extends TurboModule {
15
20
  +open: (options: Object) => Promise<Object>;
16
21
  }
@@ -43,6 +43,7 @@ type Props = $ReadOnly<{|
43
43
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
44
44
  accessibilityElementsHidden?: ?boolean,
45
45
  accessibilityHint?: ?Stringish,
46
+ accessibilityLanguage?: ?Stringish,
46
47
  accessibilityIgnoresInvertColors?: ?boolean,
47
48
  accessibilityLabel?: ?Stringish,
48
49
  accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
@@ -49,6 +49,7 @@ type Props = $ReadOnly<{|
49
49
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
50
50
  accessibilityElementsHidden?: ?boolean,
51
51
  accessibilityHint?: ?Stringish,
52
+ accessibilityLanguage?: ?Stringish,
52
53
  accessibilityIgnoresInvertColors?: ?boolean,
53
54
  accessibilityLabel?: ?Stringish,
54
55
  accessibilityLiveRegion?: ?('none' | 'polite' | 'assertive'),
@@ -9,46 +9,55 @@
9
9
  */
10
10
 
11
11
  import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
12
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {
13
+ HostComponent,
14
+ PartialViewConfig,
15
+ } from '../../Renderer/shims/ReactNativeTypes';
13
16
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
14
17
 
18
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
19
+ uiViewClassName: 'AndroidHorizontalScrollView',
20
+ bubblingEventTypes: {},
21
+ directEventTypes: {},
22
+ validAttributes: {
23
+ decelerationRate: true,
24
+ disableIntervalMomentum: true,
25
+ endFillColor: {process: require('../../StyleSheet/processColor')},
26
+ fadingEdgeLength: true,
27
+ nestedScrollEnabled: true,
28
+ overScrollMode: true,
29
+ pagingEnabled: true,
30
+ persistentScrollbar: true,
31
+ scrollEnabled: true,
32
+ scrollPerfTag: true,
33
+ sendMomentumEvents: true,
34
+ showsHorizontalScrollIndicator: true,
35
+ snapToAlignment: true,
36
+ snapToEnd: true,
37
+ snapToInterval: true,
38
+ snapToStart: true,
39
+ snapToOffsets: true,
40
+ contentOffset: true,
41
+ borderBottomLeftRadius: true,
42
+ borderBottomRightRadius: true,
43
+ borderRadius: true,
44
+ borderStyle: true,
45
+ borderRightColor: {process: require('../../StyleSheet/processColor')},
46
+ borderColor: {process: require('../../StyleSheet/processColor')},
47
+ borderBottomColor: {process: require('../../StyleSheet/processColor')},
48
+ borderTopLeftRadius: true,
49
+ borderTopColor: {process: require('../../StyleSheet/processColor')},
50
+ removeClippedSubviews: true,
51
+ borderTopRightRadius: true,
52
+ borderLeftColor: {process: require('../../StyleSheet/processColor')},
53
+ pointerEvents: true,
54
+ },
55
+ };
56
+
15
57
  const AndroidHorizontalScrollViewNativeComponent: HostComponent<Props> =
16
- NativeComponentRegistry.get<Props>('AndroidHorizontalScrollView', () => ({
17
- uiViewClassName: 'AndroidHorizontalScrollView',
18
- bubblingEventTypes: {},
19
- directEventTypes: {},
20
- validAttributes: {
21
- decelerationRate: true,
22
- disableIntervalMomentum: true,
23
- endFillColor: {process: require('../../StyleSheet/processColor')},
24
- fadingEdgeLength: true,
25
- nestedScrollEnabled: true,
26
- overScrollMode: true,
27
- pagingEnabled: true,
28
- persistentScrollbar: true,
29
- scrollEnabled: true,
30
- scrollPerfTag: true,
31
- sendMomentumEvents: true,
32
- showsHorizontalScrollIndicator: true,
33
- snapToAlignment: true,
34
- snapToEnd: true,
35
- snapToInterval: true,
36
- snapToStart: true,
37
- snapToOffsets: true,
38
- contentOffset: true,
39
- borderBottomLeftRadius: true,
40
- borderBottomRightRadius: true,
41
- borderRadius: true,
42
- borderStyle: true,
43
- borderRightColor: {process: require('../../StyleSheet/processColor')},
44
- borderColor: {process: require('../../StyleSheet/processColor')},
45
- borderBottomColor: {process: require('../../StyleSheet/processColor')},
46
- borderTopLeftRadius: true,
47
- borderTopColor: {process: require('../../StyleSheet/processColor')},
48
- removeClippedSubviews: true,
49
- borderTopRightRadius: true,
50
- borderLeftColor: {process: require('../../StyleSheet/processColor')},
51
- },
52
- }));
58
+ NativeComponentRegistry.get<Props>(
59
+ 'AndroidHorizontalScrollView',
60
+ () => __INTERNAL_VIEW_CONFIG,
61
+ );
53
62
 
54
63
  export default AndroidHorizontalScrollViewNativeComponent;
@@ -8,16 +8,24 @@
8
8
  * @flow
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {
12
+ HostComponent,
13
+ PartialViewConfig,
14
+ } from '../../Renderer/shims/ReactNativeTypes';
12
15
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
13
16
  import type {ViewProps as Props} from '../View/ViewPropTypes';
14
17
 
18
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
19
+ uiViewClassName: 'RCTScrollContentView',
20
+ bubblingEventTypes: {},
21
+ directEventTypes: {},
22
+ validAttributes: {},
23
+ };
24
+
15
25
  const ScrollContentViewNativeComponent: HostComponent<Props> =
16
- NativeComponentRegistry.get<Props>('RCTScrollContentView', () => ({
17
- uiViewClassName: 'RCTScrollContentView',
18
- bubblingEventTypes: {},
19
- directEventTypes: {},
20
- validAttributes: {},
21
- }));
26
+ NativeComponentRegistry.get<Props>(
27
+ 'RCTScrollContentView',
28
+ () => __INTERNAL_VIEW_CONFIG,
29
+ );
22
30
 
23
31
  export default ScrollContentViewNativeComponent;
@@ -9,12 +9,15 @@
9
9
  */
10
10
 
11
11
  import type {ScrollViewNativeProps as Props} from './ScrollViewNativeComponentType';
12
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
12
+ import type {
13
+ HostComponent,
14
+ PartialViewConfig,
15
+ } from '../../Renderer/shims/ReactNativeTypes';
13
16
  import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
14
17
  import {ConditionallyIgnoredEventHandlers} from '../../NativeComponent/ViewConfigIgnore';
15
18
  import Platform from '../../Utilities/Platform';
16
19
 
17
- const RCTScrollViewViewConfig =
20
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
18
21
  Platform.OS === 'android'
19
22
  ? {
20
23
  uiViewClassName: 'RCTScrollView',
@@ -71,6 +74,7 @@ const RCTScrollViewViewConfig =
71
74
  removeClippedSubviews: true,
72
75
  borderTopRightRadius: true,
73
76
  borderLeftColor: {process: require('../../StyleSheet/processColor')},
77
+ pointerEvents: true,
74
78
  },
75
79
  }
76
80
  : {
@@ -153,7 +157,7 @@ const RCTScrollViewViewConfig =
153
157
  const ScrollViewNativeComponent: HostComponent<Props> =
154
158
  NativeComponentRegistry.get<Props>(
155
159
  'RCTScrollView',
156
- () => RCTScrollViewViewConfig,
160
+ () => __INTERNAL_VIEW_CONFIG,
157
161
  );
158
162
 
159
163
  export default ScrollViewNativeComponent;
@@ -471,7 +471,12 @@ class StatusBar extends React.Component<Props> {
471
471
  if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
472
472
  NativeStatusBarManagerAndroid.setHidden(mergedProps.hidden.value);
473
473
  }
474
- if (!oldProps || oldProps.translucent !== mergedProps.translucent) {
474
+ // Activities are not translucent by default, so always set if true.
475
+ if (
476
+ !oldProps ||
477
+ oldProps.translucent !== mergedProps.translucent ||
478
+ mergedProps.translucent
479
+ ) {
475
480
  NativeStatusBarManagerAndroid.setTranslucent(mergedProps.translucent);
476
481
  }
477
482
  }
@@ -17,7 +17,10 @@ import type {
17
17
  Int32,
18
18
  WithDefault,
19
19
  } from '../../Types/CodegenTypes';
20
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
20
+ import type {
21
+ HostComponent,
22
+ PartialViewConfig,
23
+ } from '../../Renderer/shims/ReactNativeTypes';
21
24
  import type {
22
25
  TextStyleProp,
23
26
  ViewStyleProp,
@@ -593,123 +596,125 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
593
596
  supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
594
597
  });
595
598
 
596
- let AndroidTextInputNativeComponent = NativeComponentRegistry.get<NativeProps>(
597
- 'AndroidTextInput',
598
- () => ({
599
- uiViewClassName: 'AndroidTextInput',
600
- bubblingEventTypes: {
601
- topBlur: {
602
- phasedRegistrationNames: {
603
- bubbled: 'onBlur',
604
- captured: 'onBlurCapture',
605
- },
606
- },
607
- topEndEditing: {
608
- phasedRegistrationNames: {
609
- bubbled: 'onEndEditing',
610
- captured: 'onEndEditingCapture',
611
- },
599
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
600
+ uiViewClassName: 'AndroidTextInput',
601
+ bubblingEventTypes: {
602
+ topBlur: {
603
+ phasedRegistrationNames: {
604
+ bubbled: 'onBlur',
605
+ captured: 'onBlurCapture',
612
606
  },
613
- topFocus: {
614
- phasedRegistrationNames: {
615
- bubbled: 'onFocus',
616
- captured: 'onFocusCapture',
617
- },
618
- },
619
- topKeyPress: {
620
- phasedRegistrationNames: {
621
- bubbled: 'onKeyPress',
622
- captured: 'onKeyPressCapture',
623
- },
607
+ },
608
+ topEndEditing: {
609
+ phasedRegistrationNames: {
610
+ bubbled: 'onEndEditing',
611
+ captured: 'onEndEditingCapture',
624
612
  },
625
- topSubmitEditing: {
626
- phasedRegistrationNames: {
627
- bubbled: 'onSubmitEditing',
628
- captured: 'onSubmitEditingCapture',
629
- },
613
+ },
614
+ topFocus: {
615
+ phasedRegistrationNames: {
616
+ bubbled: 'onFocus',
617
+ captured: 'onFocusCapture',
630
618
  },
631
- topTextInput: {
632
- phasedRegistrationNames: {
633
- bubbled: 'onTextInput',
634
- captured: 'onTextInputCapture',
635
- },
619
+ },
620
+ topKeyPress: {
621
+ phasedRegistrationNames: {
622
+ bubbled: 'onKeyPress',
623
+ captured: 'onKeyPressCapture',
636
624
  },
637
625
  },
638
- directEventTypes: {
639
- topScroll: {
640
- registrationName: 'onScroll',
626
+ topSubmitEditing: {
627
+ phasedRegistrationNames: {
628
+ bubbled: 'onSubmitEditing',
629
+ captured: 'onSubmitEditingCapture',
641
630
  },
642
631
  },
643
- validAttributes: {
644
- maxFontSizeMultiplier: true,
645
- adjustsFontSizeToFit: true,
646
- minimumFontScale: true,
647
- autoFocus: true,
648
- placeholder: true,
649
- inlineImagePadding: true,
650
- contextMenuHidden: true,
651
- textShadowColor: {process: require('../../StyleSheet/processColor')},
652
- maxLength: true,
653
- selectTextOnFocus: true,
654
- textShadowRadius: true,
655
- underlineColorAndroid: {
656
- process: require('../../StyleSheet/processColor'),
632
+ topTextInput: {
633
+ phasedRegistrationNames: {
634
+ bubbled: 'onTextInput',
635
+ captured: 'onTextInputCapture',
657
636
  },
658
- textDecorationLine: true,
659
- blurOnSubmit: true,
660
- textAlignVertical: true,
661
- fontStyle: true,
662
- textShadowOffset: true,
663
- selectionColor: {process: require('../../StyleSheet/processColor')},
664
- selection: true,
665
- placeholderTextColor: {process: require('../../StyleSheet/processColor')},
666
- importantForAutofill: true,
667
- lineHeight: true,
668
- textTransform: true,
669
- returnKeyType: true,
670
- keyboardType: true,
671
- multiline: true,
672
- color: {process: require('../../StyleSheet/processColor')},
673
- autoComplete: true,
674
- numberOfLines: true,
675
- letterSpacing: true,
676
- returnKeyLabel: true,
677
- fontSize: true,
678
- onKeyPress: true,
679
- cursorColor: {process: require('../../StyleSheet/processColor')},
680
- text: true,
681
- showSoftInputOnFocus: true,
682
- textAlign: true,
683
- autoCapitalize: true,
684
- autoCorrect: true,
685
- caretHidden: true,
686
- secureTextEntry: true,
687
- textBreakStrategy: true,
688
- onScroll: true,
689
- onContentSizeChange: true,
690
- disableFullscreenUI: true,
691
- includeFontPadding: true,
692
- fontWeight: true,
693
- fontFamily: true,
694
- allowFontScaling: true,
695
- onSelectionChange: true,
696
- mostRecentEventCount: true,
697
- inlineImageLeft: true,
698
- editable: true,
699
- fontVariant: true,
700
- borderBottomRightRadius: true,
701
- borderBottomColor: {process: require('../../StyleSheet/processColor')},
702
- borderRadius: true,
703
- borderRightColor: {process: require('../../StyleSheet/processColor')},
704
- borderColor: {process: require('../../StyleSheet/processColor')},
705
- borderTopRightRadius: true,
706
- borderStyle: true,
707
- borderBottomLeftRadius: true,
708
- borderLeftColor: {process: require('../../StyleSheet/processColor')},
709
- borderTopLeftRadius: true,
710
- borderTopColor: {process: require('../../StyleSheet/processColor')},
711
637
  },
712
- }),
638
+ },
639
+ directEventTypes: {
640
+ topScroll: {
641
+ registrationName: 'onScroll',
642
+ },
643
+ },
644
+ validAttributes: {
645
+ maxFontSizeMultiplier: true,
646
+ adjustsFontSizeToFit: true,
647
+ minimumFontScale: true,
648
+ autoFocus: true,
649
+ placeholder: true,
650
+ inlineImagePadding: true,
651
+ contextMenuHidden: true,
652
+ textShadowColor: {process: require('../../StyleSheet/processColor')},
653
+ maxLength: true,
654
+ selectTextOnFocus: true,
655
+ textShadowRadius: true,
656
+ underlineColorAndroid: {
657
+ process: require('../../StyleSheet/processColor'),
658
+ },
659
+ textDecorationLine: true,
660
+ blurOnSubmit: true,
661
+ textAlignVertical: true,
662
+ fontStyle: true,
663
+ textShadowOffset: true,
664
+ selectionColor: {process: require('../../StyleSheet/processColor')},
665
+ selection: true,
666
+ placeholderTextColor: {process: require('../../StyleSheet/processColor')},
667
+ importantForAutofill: true,
668
+ lineHeight: true,
669
+ textTransform: true,
670
+ returnKeyType: true,
671
+ keyboardType: true,
672
+ multiline: true,
673
+ color: {process: require('../../StyleSheet/processColor')},
674
+ autoComplete: true,
675
+ numberOfLines: true,
676
+ letterSpacing: true,
677
+ returnKeyLabel: true,
678
+ fontSize: true,
679
+ onKeyPress: true,
680
+ cursorColor: {process: require('../../StyleSheet/processColor')},
681
+ text: true,
682
+ showSoftInputOnFocus: true,
683
+ textAlign: true,
684
+ autoCapitalize: true,
685
+ autoCorrect: true,
686
+ caretHidden: true,
687
+ secureTextEntry: true,
688
+ textBreakStrategy: true,
689
+ onScroll: true,
690
+ onContentSizeChange: true,
691
+ disableFullscreenUI: true,
692
+ includeFontPadding: true,
693
+ fontWeight: true,
694
+ fontFamily: true,
695
+ allowFontScaling: true,
696
+ onSelectionChange: true,
697
+ mostRecentEventCount: true,
698
+ inlineImageLeft: true,
699
+ editable: true,
700
+ fontVariant: true,
701
+ borderBottomRightRadius: true,
702
+ borderBottomColor: {process: require('../../StyleSheet/processColor')},
703
+ borderRadius: true,
704
+ borderRightColor: {process: require('../../StyleSheet/processColor')},
705
+ borderColor: {process: require('../../StyleSheet/processColor')},
706
+ borderTopRightRadius: true,
707
+ borderStyle: true,
708
+ borderBottomLeftRadius: true,
709
+ borderLeftColor: {process: require('../../StyleSheet/processColor')},
710
+ borderTopLeftRadius: true,
711
+ borderTopColor: {process: require('../../StyleSheet/processColor')},
712
+ },
713
+ };
714
+
715
+ let AndroidTextInputNativeComponent = NativeComponentRegistry.get<NativeProps>(
716
+ 'AndroidTextInput',
717
+ () => __INTERNAL_VIEW_CONFIG,
713
718
  );
714
719
 
715
720
  // flowlint-next-line unclear-type:off
@@ -8,7 +8,10 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {
12
+ HostComponent,
13
+ PartialViewConfig,
14
+ } from '../../Renderer/shims/ReactNativeTypes';
12
15
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
13
16
  import type {TextInputNativeCommands} from './TextInputNativeCommands';
14
17
  import RCTTextInputViewConfig from './RCTTextInputViewConfig';
@@ -22,15 +25,20 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
22
25
  supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
23
26
  });
24
27
 
28
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
29
+ uiViewClassName: 'RCTMultilineTextInputView',
30
+ ...RCTTextInputViewConfig,
31
+ validAttributes: {
32
+ ...RCTTextInputViewConfig.validAttributes,
33
+ dataDetectorTypes: true,
34
+ },
35
+ };
36
+
25
37
  const MultilineTextInputNativeComponent: HostComponent<mixed> =
26
- NativeComponentRegistry.get<mixed>('RCTMultilineTextInputView', () => ({
27
- uiViewClassName: 'RCTMultilineTextInputView',
28
- ...RCTTextInputViewConfig,
29
- validAttributes: {
30
- ...RCTTextInputViewConfig.validAttributes,
31
- dataDetectorTypes: true,
32
- },
33
- }));
38
+ NativeComponentRegistry.get<mixed>(
39
+ 'RCTMultilineTextInputView',
40
+ () => __INTERNAL_VIEW_CONFIG,
41
+ );
34
42
 
35
43
  // flowlint-next-line unclear-type:off
36
44
  export default ((MultilineTextInputNativeComponent: any): HostComponent<mixed>);
@@ -8,7 +8,10 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
11
+ import type {
12
+ HostComponent,
13
+ PartialViewConfig,
14
+ } from '../../Renderer/shims/ReactNativeTypes';
12
15
  import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
13
16
  import type {TextInputNativeCommands} from './TextInputNativeCommands';
14
17
  import RCTTextInputViewConfig from './RCTTextInputViewConfig';
@@ -22,11 +25,16 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
22
25
  supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
23
26
  });
24
27
 
28
+ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
29
+ uiViewClassName: 'RCTSinglelineTextInputView',
30
+ ...RCTTextInputViewConfig,
31
+ };
32
+
25
33
  const SinglelineTextInputNativeComponent: HostComponent<mixed> =
26
- NativeComponentRegistry.get<mixed>('RCTSinglelineTextInputView', () => ({
27
- uiViewClassName: 'RCTSinglelineTextInputView',
28
- ...RCTTextInputViewConfig,
29
- }));
34
+ NativeComponentRegistry.get<mixed>(
35
+ 'RCTSinglelineTextInputView',
36
+ () => __INTERNAL_VIEW_CONFIG,
37
+ );
30
38
 
31
39
  // flowlint-next-line unclear-type:off
32
40
  export default ((SinglelineTextInputNativeComponent: any): HostComponent<mixed>);
@@ -73,7 +73,7 @@ function blurField(textFieldID: ?number) {
73
73
  /**
74
74
  * @param {number} TextInputID id of the text field to focus
75
75
  * Focuses the specified text field
76
- * noop if the text field was already focused
76
+ * noop if the text field was already focused or if the field is not editable
77
77
  */
78
78
  function focusTextInput(textField: ?ComponentRef) {
79
79
  if (typeof textField === 'number') {
@@ -86,7 +86,15 @@ function focusTextInput(textField: ?ComponentRef) {
86
86
  return;
87
87
  }
88
88
 
89
- if (currentlyFocusedInputRef !== textField && textField != null) {
89
+ if (textField != null) {
90
+ const fieldCanBeFocused =
91
+ currentlyFocusedInputRef !== textField &&
92
+ // $FlowFixMe - `currentProps` is missing in `NativeMethods`
93
+ textField.currentProps?.editable !== false;
94
+
95
+ if (!fieldCanBeFocused) {
96
+ return;
97
+ }
90
98
  focusInput(textField);
91
99
  if (Platform.OS === 'ios') {
92
100
  // This isn't necessarily a single line text input