@office-iss/react-native-win32 0.68.0 → 0.69.0-preview.1

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 (180) hide show
  1. package/.flowconfig +1 -3
  2. package/CHANGELOG.json +356 -32
  3. package/CHANGELOG.md +150 -19
  4. package/IntegrationTests/BUCK +4 -1
  5. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +7 -0
  6. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +1 -0
  7. package/Libraries/Alert/Alert.win32.js +1 -1
  8. package/Libraries/Animated/AnimatedImplementation.js +1 -1
  9. package/Libraries/Animated/NativeAnimatedHelper.js +55 -9
  10. package/Libraries/Animated/NativeAnimatedModule.js +1 -0
  11. package/Libraries/Animated/NativeAnimatedTurboModule.js +1 -0
  12. package/Libraries/Animated/animations/TimingAnimation.js +6 -11
  13. package/Libraries/Animated/createAnimatedComponent.js +2 -2
  14. package/Libraries/Animated/nodes/AnimatedColor.js +95 -29
  15. package/Libraries/Animated/nodes/AnimatedInterpolation.js +19 -22
  16. package/Libraries/Animated/nodes/AnimatedNode.js +2 -2
  17. package/Libraries/Animated/nodes/AnimatedValue.js +1 -1
  18. package/Libraries/AppState/AppState.js +1 -1
  19. package/Libraries/Blob/URL.js +7 -1
  20. package/Libraries/Components/Button.js +3 -0
  21. package/Libraries/Components/DatePickerAndroid/NativeDatePickerAndroid.js +5 -0
  22. package/Libraries/Components/Pressable/Pressable.js +3 -3
  23. package/Libraries/Components/Pressable/Pressable.win32.js +3 -3
  24. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +47 -38
  25. package/Libraries/Components/ScrollView/ScrollContentViewNativeComponent.js +15 -7
  26. package/Libraries/Components/ScrollView/ScrollView.js +1 -1
  27. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +16 -3
  28. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +3 -1
  29. package/Libraries/Components/Slider/Slider.js +0 -2
  30. package/Libraries/Components/Slider/SliderNativeComponent.js +0 -1
  31. package/Libraries/Components/StatusBar/StatusBar.js +6 -1
  32. package/Libraries/Components/Switch/Switch.js +11 -1
  33. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +114 -109
  34. package/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js +17 -9
  35. package/Libraries/Components/TextInput/RCTSingelineTextInputNativeComponent.js +13 -5
  36. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
  37. package/Libraries/Components/TextInput/TextInput.js +1 -8
  38. package/Libraries/Components/TextInput/TextInputState.js +10 -2
  39. package/Libraries/Components/TextInput/TextInputState.win32.js +10 -2
  40. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  41. package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
  42. package/Libraries/Components/Touchable/TouchableHighlight.js +1 -0
  43. package/Libraries/Components/Touchable/TouchableNativeFeedback.js +1 -0
  44. package/Libraries/Components/Touchable/TouchableOpacity.js +7 -1
  45. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +3 -1
  46. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  47. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -0
  48. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  49. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
  50. package/Libraries/Components/View/View.win32.js +33 -1
  51. package/Libraries/Components/View/ViewNativeComponent.js +68 -8
  52. package/Libraries/Components/View/ViewPropTypes.js +36 -4
  53. package/Libraries/Components/View/ViewPropTypes.win32.js +36 -4
  54. package/Libraries/Components/View/ViewWin32.Props.d.ts +1 -1
  55. package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
  56. package/Libraries/Core/Devtools/parseHermesStack.js +1 -1
  57. package/Libraries/Core/ExceptionsManager.js +1 -1
  58. package/Libraries/Core/RawEventEmitter.js +38 -0
  59. package/Libraries/Core/ReactNativeVersion.js +2 -2
  60. package/Libraries/Core/polyfillPromise.js +32 -0
  61. package/Libraries/Core/setUpReactDevTools.js +3 -2
  62. package/Libraries/EventEmitter/NativeEventEmitter.js +3 -3
  63. package/Libraries/EventEmitter/RCTDeviceEventEmitter.js +2 -1
  64. package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +3 -3
  65. package/Libraries/Events/CustomEvent.js +32 -0
  66. package/Libraries/Events/EventPolyfill.js +239 -0
  67. package/Libraries/Image/Image.android.js +0 -6
  68. package/Libraries/Image/Image.ios.js +0 -6
  69. package/Libraries/Image/Image.win32.js +2 -8
  70. package/Libraries/Image/ImageViewNativeComponent.js +18 -3
  71. package/Libraries/Image/TextInlineImageNativeComponent.js +23 -15
  72. package/Libraries/Image/resolveAssetSource.win32.js +1 -1
  73. package/Libraries/Inspector/Inspector.js +2 -4
  74. package/Libraries/Inspector/Inspector.win32.js +7 -9
  75. package/Libraries/Interaction/BridgeSpyStallHandler.js +4 -3
  76. package/Libraries/Interaction/InteractionManager.js +1 -12
  77. package/Libraries/Interaction/TaskQueue.js +5 -4
  78. package/Libraries/LayoutAnimation/LayoutAnimation.js +13 -0
  79. package/Libraries/Linking/Linking.js +1 -1
  80. package/Libraries/Lists/FlatList.js +27 -6
  81. package/Libraries/Lists/VirtualizedList.js +71 -55
  82. package/Libraries/Lists/VirtualizedListContext.js +7 -3
  83. package/Libraries/Lists/VirtualizedSectionList.js +2 -2
  84. package/Libraries/Lists/__tests__/{FillRateHelper-test.windows.js → FillRateHelper-test.js} +2 -2
  85. package/Libraries/Lists/__tests__/{FlatList-test.windows.js → FlatList-test.js} +2 -2
  86. package/Libraries/Lists/__tests__/{SectionList-test.windows.js → SectionList-test.js} +14 -14
  87. package/Libraries/Lists/__tests__/{VirtualizeUtils-test.windows.js → VirtualizeUtils-test.js} +3 -3
  88. package/Libraries/Lists/__tests__/{VirtualizedList-test.windows.js → VirtualizedList-test.js} +92 -43
  89. package/Libraries/Lists/__tests__/{VirtualizedSectionList-test.windows.js → VirtualizedSectionList-test.js} +16 -14
  90. package/Libraries/LogBox/Data/LogBoxData.js +2 -2
  91. package/Libraries/LogBox/Data/LogBoxLog.js +1 -1
  92. package/Libraries/LogBox/Data/LogBoxSymbolication.js +1 -1
  93. package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
  94. package/Libraries/LogBox/LogBox.js +2 -21
  95. package/Libraries/LogBox/UI/LogBoxInspectorFooter.js +1 -0
  96. package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +2 -1
  97. package/Libraries/NativeComponent/BaseViewConfig.android.js +295 -0
  98. package/Libraries/NativeComponent/BaseViewConfig.ios.js +333 -0
  99. package/Libraries/NativeComponent/BaseViewConfig.win32.js +334 -0
  100. package/Libraries/NativeComponent/NativeComponentRegistry.js +0 -2
  101. package/Libraries/NativeComponent/PlatformBaseViewConfig.js +24 -0
  102. package/Libraries/NativeComponent/StaticViewConfigValidator.js +7 -42
  103. package/Libraries/NativeComponent/ViewConfig.js +4 -4
  104. package/Libraries/NativeComponent/ViewConfigIgnore.js +54 -0
  105. package/Libraries/Network/FormData.js +7 -1
  106. package/Libraries/Network/RCTNetworking.win32.js +1 -1
  107. package/Libraries/Pressability/Pressability.js +115 -46
  108. package/Libraries/Pressability/Pressability.win32.js +174 -69
  109. package/Libraries/Pressability/PressabilityDebug.js +5 -9
  110. package/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js +1 -0
  111. package/Libraries/ReactNative/AppContainer.js +1 -1
  112. package/Libraries/ReactNative/{DummyUIManager.js → BridgelessUIManager.js} +62 -40
  113. package/Libraries/ReactNative/PaperUIManager.win32.js +5 -5
  114. package/Libraries/ReactNative/ReactNativeFeatureFlags.js +39 -0
  115. package/Libraries/ReactNative/UIManager.js +2 -3
  116. package/Libraries/ReactNative/renderApplication.js +4 -0
  117. package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +8 -0
  118. package/Libraries/Renderer/implementations/ReactFabric-dev.js +5908 -4906
  119. package/Libraries/Renderer/implementations/ReactFabric-prod.js +2100 -1918
  120. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +2567 -2352
  121. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +5610 -4844
  122. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +1710 -1556
  123. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +1830 -1639
  124. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -1
  125. package/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js +2 -1
  126. package/Libraries/StyleSheet/EdgeInsetsPropType.js +4 -1
  127. package/Libraries/StyleSheet/StyleSheetTypes.js +59 -66
  128. package/Libraries/StyleSheet/normalizeColor.js +1 -1
  129. package/Libraries/StyleSheet/private/_StyleSheetTypesOverrides.js +15 -0
  130. package/Libraries/StyleSheet/private/_TransformStyle.js +53 -0
  131. package/Libraries/Text/Text.js +13 -7
  132. package/Libraries/Text/TextNativeComponent.js +2 -0
  133. package/Libraries/Text/TextNativeComponent.win32.js +2 -0
  134. package/Libraries/Text/TextProps.js +10 -0
  135. package/Libraries/Types/CoreEventTypes.js +13 -1
  136. package/Libraries/Types/CoreEventTypes.win32.js +26 -1
  137. package/Libraries/Utilities/Appearance.js +0 -8
  138. package/Libraries/Utilities/HMRClient.js +1 -1
  139. package/Libraries/Utilities/ReactNativeTestTools.js +1 -0
  140. package/Libraries/Utilities/codegenNativeComponent.js +17 -6
  141. package/Libraries/Utilities/stringifySafe.js +4 -1
  142. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +3 -3
  143. package/Libraries/WebSocket/WebSocket.js +1 -1
  144. package/Libraries/vendor/emitter/_EmitterSubscription.js +1 -1
  145. package/Libraries/vendor/emitter/_EventEmitter.js +1 -1
  146. package/Libraries/vendor/emitter/_EventSubscription.js +1 -1
  147. package/index.js +30 -25
  148. package/index.win32.js +30 -25
  149. package/jest/preprocessor.js +24 -107
  150. package/jest/preprocessor_DO_NOT_USE.js +122 -0
  151. package/metro.config.js +3 -47
  152. package/overrides.json +39 -46
  153. package/package.json +30 -29
  154. package/rntypes/index.d.ts +19 -7
  155. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +1 -1
  156. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +3 -1
  157. package/src/Libraries/Components/View/ViewWin32.Props.ts +1 -0
  158. package/src/Libraries/Lists/__tests__/__snapshots__/FlatList-test.js.snap +427 -0
  159. package/src/Libraries/Lists/__tests__/__snapshots__/SectionList-test.js.snap +391 -0
  160. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizeUtils-test.js.snap +3 -0
  161. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedList-test.js.snap +4565 -0
  162. package/src/Libraries/Lists/__tests__/__snapshots__/VirtualizedSectionList-test.js.snap +1153 -0
  163. package/src/rntypes/index.d.ts +19 -7
  164. package/typings-index.js +5 -1
  165. package/typings-index.js.map +1 -1
  166. package/Libraries/Components/SegmentedControlIOS/RCTSegmentedControlNativeComponent.js +0 -44
  167. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js +0 -45
  168. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +0 -123
  169. package/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.js +0 -45
  170. package/Libraries/Components/View/ReactNativeViewViewConfig.js +0 -360
  171. package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +0 -401
  172. package/Libraries/Components/View/ReactNativeViewViewConfigAndroid.js +0 -83
  173. package/Libraries/ReactNative/UIManagerInjection.js +0 -15
  174. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +0 -24527
  175. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +0 -8309
  176. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +0 -8961
  177. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +0 -24948
  178. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +0 -8400
  179. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +0 -9049
  180. package/flow/Promise.js +0 -47
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @flow strict
9
- * @generated SignedSource<<ec11b46a06877b4f7f3f0b6c1f5d46c3>>
9
+ * @generated SignedSource<<fb8a7e52d219403fad0cf916954e5185>>
10
10
  *
11
11
  * This file was sync'd from the facebook/react repository.
12
12
  */
@@ -76,6 +76,7 @@ export type ViewConfig = $ReadOnly<{
76
76
  phasedRegistrationNames: $ReadOnly<{
77
77
  captured: string,
78
78
  bubbled: string,
79
+ skipBubbling?: ?boolean,
79
80
  }>,
80
81
  }>,
81
82
  ...,
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @noformat
8
8
  * @flow strict-local
9
- * @generated SignedSource<<a81ed33269e71024fedad145e843fab0>>
9
+ * @generated SignedSource<<a5b40ebf1f5b17d6dc83479c1c597566>>
10
10
  *
11
11
  * This file was sync'd from the facebook/react repository.
12
12
  */
@@ -22,6 +22,7 @@ const customBubblingEventTypes: {
22
22
  phasedRegistrationNames: $ReadOnly<{|
23
23
  captured: string,
24
24
  bubbled: string,
25
+ skipBubbling?: ?boolean,
25
26
  |}>,
26
27
  |}>,
27
28
  ...,
@@ -10,6 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- import type {Rect} from './Rect';
13
+ import type {Rect, RectOrSize} from './Rect';
14
14
 
15
+ // TODO: allow all EdgeInsets-like property to be set using a single number
16
+ // and unify EdgeInsetsProp with EdgeInsetsOrSizeProp
15
17
  export type EdgeInsetsProp = Rect;
18
+ export type EdgeInsetsOrSizeProp = RectOrSize;
@@ -14,21 +14,31 @@ const AnimatedNode = require('../Animated/nodes/AnimatedNode');
14
14
 
15
15
  import type {NativeColorValue} from './PlatformColorValueTypes';
16
16
 
17
- export type ____ColorValue_Internal = null | string | NativeColorValue;
17
+ export type ____ColorValue_Internal = null | string | number | NativeColorValue;
18
18
 
19
19
  export type ColorArrayValue = null | $ReadOnlyArray<____ColorValue_Internal>;
20
- export type PointValue = {|
20
+ export type PointValue = {
21
21
  x: number,
22
22
  y: number,
23
- |};
24
- export type EdgeInsetsValue = {|
23
+ };
24
+ export type EdgeInsetsValue = {
25
25
  top: number,
26
26
  left: number,
27
27
  right: number,
28
28
  bottom: number,
29
- |};
29
+ };
30
30
  export type DimensionValue = null | number | string | AnimatedNode;
31
31
 
32
+ import type {
33
+ ____DangerouslyImpreciseStyle_InternalOverrides,
34
+ ____ImageStyle_InternalOverrides,
35
+ ____ShadowStyle_InternalOverrides,
36
+ ____TextStyle_InternalOverrides,
37
+ ____ViewStyle_InternalOverrides,
38
+ } from './private/_StyleSheetTypesOverrides';
39
+
40
+ import type {____TransformStyle_Internal} from './private/_TransformStyle';
41
+
32
42
  /**
33
43
  * React Native's layout system is based on Flexbox and is powered both
34
44
  * on iOS and Android by an open source project called `Yoga`:
@@ -42,7 +52,7 @@ export type DimensionValue = null | number | string | AnimatedNode;
42
52
  * These properties are a subset of our styles that are consumed by the layout
43
53
  * algorithm and affect the positioning and sizing of views.
44
54
  */
45
- type ____LayoutStyle_Internal = $ReadOnly<{|
55
+ type ____LayoutStyle_Internal = $ReadOnly<{
46
56
  /** `display` sets the display type of this component.
47
57
  *
48
58
  * It works similarly to `display` in CSS, but only support 'flex' and 'none'.
@@ -472,49 +482,7 @@ type ____LayoutStyle_Internal = $ReadOnly<{|
472
482
  * @platform ios
473
483
  */
474
484
  direction?: 'inherit' | 'ltr' | 'rtl',
475
- |}>;
476
-
477
- type ____TransformStyle_Internal = $ReadOnly<{|
478
- /**
479
- * `transform` accepts an array of transformation objects. Each object specifies
480
- * the property that will be transformed as the key, and the value to use in the
481
- * transformation. Objects should not be combined. Use a single key/value pair
482
- * per object.
483
- *
484
- * The rotate transformations require a string so that the transform may be
485
- * expressed in degrees (deg) or radians (rad). For example:
486
- *
487
- * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
488
- *
489
- * The skew transformations require a string so that the transform may be
490
- * expressed in degrees (deg). For example:
491
- *
492
- * `transform([{ skewX: '45deg' }])`
493
- */
494
- transform?: $ReadOnlyArray<
495
- | {|+perspective: number | AnimatedNode|}
496
- | {|+rotate: string | AnimatedNode|}
497
- | {|+rotateX: string | AnimatedNode|}
498
- | {|+rotateY: string | AnimatedNode|}
499
- | {|+rotateZ: string | AnimatedNode|}
500
- | {|+scale: number | AnimatedNode|}
501
- | {|+scaleX: number | AnimatedNode|}
502
- | {|+scaleY: number | AnimatedNode|}
503
- | {|+translateX: number | AnimatedNode|}
504
- | {|+translateY: number | AnimatedNode|}
505
- | {|
506
- +translate:
507
- | [number | AnimatedNode, number | AnimatedNode]
508
- | AnimatedNode,
509
- |}
510
- | {|+skewX: string|}
511
- | {|+skewY: string|}
512
- // TODO: what is the actual type it expects?
513
- | {|
514
- +matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
515
- |},
516
- >,
517
- |}>;
485
+ }>;
518
486
 
519
487
  /**
520
488
  * These props can be used to dynamically generate shadows on views, images, text, etc.
@@ -526,7 +494,7 @@ type ____TransformStyle_Internal = $ReadOnly<{|
526
494
  * To add a drop shadow to a view use the [`elevation` property](docs/viewstyleproptypes.html#elevation) (Android 5.0+).
527
495
  * To customize the color use the [`shadowColor` property](docs/shadow-props.html#shadowColor) (Android 9.0+).
528
496
  */
529
- export type ____ShadowStyle_Internal = $ReadOnly<{|
497
+ export type ____ShadowStyle_InternalCore = $ReadOnly<{
530
498
  /**
531
499
  * Sets the drop shadow color
532
500
  * @platform ios
@@ -536,10 +504,10 @@ export type ____ShadowStyle_Internal = $ReadOnly<{|
536
504
  * Sets the drop shadow offset
537
505
  * @platform ios
538
506
  */
539
- shadowOffset?: $ReadOnly<{|
507
+ shadowOffset?: $ReadOnly<{
540
508
  width?: number,
541
509
  height?: number,
542
- |}>,
510
+ }>,
543
511
  /**
544
512
  * Sets the drop shadow opacity (multiplied by the color's alpha component)
545
513
  * @platform ios
@@ -550,9 +518,14 @@ export type ____ShadowStyle_Internal = $ReadOnly<{|
550
518
  * @platform ios
551
519
  */
552
520
  shadowRadius?: number,
553
- |}>;
521
+ }>;
522
+
523
+ export type ____ShadowStyle_Internal = $ReadOnly<{
524
+ ...____ShadowStyle_InternalCore,
525
+ ...____ShadowStyle_InternalOverrides,
526
+ }>;
554
527
 
555
- export type ____ViewStyle_Internal = $ReadOnly<{|
528
+ export type ____ViewStyle_InternalCore = $ReadOnly<{
556
529
  ...$Exact<____LayoutStyle_Internal>,
557
530
  ...$Exact<____ShadowStyle_Internal>,
558
531
  ...$Exact<____TransformStyle_Internal>,
@@ -584,7 +557,12 @@ export type ____ViewStyle_Internal = $ReadOnly<{|
584
557
  borderTopWidth?: number | AnimatedNode,
585
558
  opacity?: number | AnimatedNode,
586
559
  elevation?: number,
587
- |}>;
560
+ }>;
561
+
562
+ export type ____ViewStyle_Internal = $ReadOnly<{
563
+ ...____ViewStyle_InternalCore,
564
+ ...____ViewStyle_InternalOverrides,
565
+ }>;
588
566
 
589
567
  export type ____FontWeight_Internal =
590
568
  | 'normal'
@@ -599,7 +577,7 @@ export type ____FontWeight_Internal =
599
577
  | '800'
600
578
  | '900';
601
579
 
602
- export type ____TextStyle_Internal = $ReadOnly<{|
580
+ export type ____TextStyle_InternalCore = $ReadOnly<{
603
581
  ...$Exact<____ViewStyle_Internal>,
604
582
  color?: ____ColorValue_Internal,
605
583
  fontFamily?: string,
@@ -613,10 +591,10 @@ export type ____TextStyle_Internal = $ReadOnly<{|
613
591
  | 'tabular-nums'
614
592
  | 'proportional-nums',
615
593
  >,
616
- textShadowOffset?: $ReadOnly<{|
594
+ textShadowOffset?: $ReadOnly<{
617
595
  width: number,
618
596
  height: number,
619
- |}>,
597
+ }>,
620
598
  textShadowRadius?: number,
621
599
  textShadowColor?: ____ColorValue_Internal,
622
600
  letterSpacing?: number,
@@ -633,22 +611,37 @@ export type ____TextStyle_Internal = $ReadOnly<{|
633
611
  textDecorationColor?: ____ColorValue_Internal,
634
612
  textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase',
635
613
  writingDirection?: 'auto' | 'ltr' | 'rtl',
636
- |}>;
614
+ }>;
637
615
 
638
- export type ____ImageStyle_Internal = $ReadOnly<{|
616
+ export type ____TextStyle_Internal = $ReadOnly<{
617
+ ...____TextStyle_InternalCore,
618
+ ...____TextStyle_InternalOverrides,
619
+ }>;
620
+
621
+ export type ____ImageStyle_InternalCore = $ReadOnly<{
639
622
  ...$Exact<____ViewStyle_Internal>,
640
623
  resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
641
624
  tintColor?: ____ColorValue_Internal,
642
625
  overlayColor?: string,
643
- |}>;
626
+ }>;
627
+
628
+ export type ____ImageStyle_Internal = $ReadOnly<{
629
+ ...____ImageStyle_InternalCore,
630
+ ...____ImageStyle_InternalOverrides,
631
+ }>;
644
632
 
645
- export type ____DangerouslyImpreciseStyle_Internal = {
633
+ export type ____DangerouslyImpreciseStyle_InternalCore = $ReadOnly<{
646
634
  ...$Exact<____TextStyle_Internal>,
647
- +resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
648
- +tintColor?: ____ColorValue_Internal,
649
- +overlayColor?: string,
635
+ resizeMode?: 'contain' | 'cover' | 'stretch' | 'center' | 'repeat',
636
+ tintColor?: ____ColorValue_Internal,
637
+ overlayColor?: string,
638
+ }>;
639
+
640
+ export type ____DangerouslyImpreciseStyle_Internal = $ReadOnly<{
641
+ ...____DangerouslyImpreciseStyle_InternalCore,
642
+ ...____DangerouslyImpreciseStyle_InternalOverrides,
650
643
  ...
651
- };
644
+ }>;
652
645
 
653
646
  type GenericStyleProp<+T> =
654
647
  | null
@@ -22,7 +22,7 @@ function normalizeColor(
22
22
  const {normalizeColorObject} = require('./PlatformColorValueTypes');
23
23
  const normalizedColor = normalizeColorObject(color);
24
24
  if (normalizedColor != null) {
25
- return color;
25
+ return normalizedColor;
26
26
  }
27
27
  }
28
28
 
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict
8
+ * @format
9
+ */
10
+
11
+ export type ____DangerouslyImpreciseStyle_InternalOverrides = $ReadOnly<{}>;
12
+ export type ____ImageStyle_InternalOverrides = $ReadOnly<{}>;
13
+ export type ____ShadowStyle_InternalOverrides = $ReadOnly<{}>;
14
+ export type ____TextStyle_InternalOverrides = $ReadOnly<{}>;
15
+ export type ____ViewStyle_InternalOverrides = $ReadOnly<{}>;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ const AnimatedNode = require('../../Animated/nodes/AnimatedNode');
12
+
13
+ export type ____TransformStyle_Internal = $ReadOnly<{|
14
+ /**
15
+ * `transform` accepts an array of transformation objects. Each object specifies
16
+ * the property that will be transformed as the key, and the value to use in the
17
+ * transformation. Objects should not be combined. Use a single key/value pair
18
+ * per object.
19
+ *
20
+ * The rotate transformations require a string so that the transform may be
21
+ * expressed in degrees (deg) or radians (rad). For example:
22
+ *
23
+ * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
24
+ *
25
+ * The skew transformations require a string so that the transform may be
26
+ * expressed in degrees (deg). For example:
27
+ *
28
+ * `transform([{ skewX: '45deg' }])`
29
+ */
30
+ transform?: $ReadOnlyArray<
31
+ | {|+perspective: number | AnimatedNode|}
32
+ | {|+rotate: string | AnimatedNode|}
33
+ | {|+rotateX: string | AnimatedNode|}
34
+ | {|+rotateY: string | AnimatedNode|}
35
+ | {|+rotateZ: string | AnimatedNode|}
36
+ | {|+scale: number | AnimatedNode|}
37
+ | {|+scaleX: number | AnimatedNode|}
38
+ | {|+scaleY: number | AnimatedNode|}
39
+ | {|+translateX: number | AnimatedNode|}
40
+ | {|+translateY: number | AnimatedNode|}
41
+ | {|
42
+ +translate:
43
+ | [number | AnimatedNode, number | AnimatedNode]
44
+ | AnimatedNode,
45
+ |}
46
+ | {|+skewX: string|}
47
+ | {|+skewY: string|}
48
+ // TODO: what is the actual type it expects?
49
+ | {|
50
+ +matrix: $ReadOnlyArray<number | AnimatedNode> | AnimatedNode,
51
+ |},
52
+ >,
53
+ |}>;
@@ -48,11 +48,20 @@ const Text: React.AbstractComponent<
48
48
 
49
49
  const [isHighlighted, setHighlighted] = useState(false);
50
50
 
51
+ const _disabled =
52
+ restProps.disabled != null
53
+ ? restProps.disabled
54
+ : props.accessibilityState?.disabled;
55
+ const _accessibilityState =
56
+ _disabled !== props.accessibilityState?.disabled
57
+ ? {...props.accessibilityState, disabled: _disabled}
58
+ : props.accessibilityState;
59
+
51
60
  const isPressable =
52
61
  (onPress != null ||
53
62
  onLongPress != null ||
54
63
  onStartShouldSetResponder != null) &&
55
- restProps.disabled !== true;
64
+ _disabled !== true;
56
65
 
57
66
  const initialized = useLazyInitialization(isPressable);
58
67
  const config = useMemo(
@@ -120,6 +129,7 @@ const Text: React.AbstractComponent<
120
129
  onResponderTerminate(event);
121
130
  }
122
131
  },
132
+ onClick: eventHandlers.onClick,
123
133
  onResponderTerminationRequest:
124
134
  eventHandlers.onResponderTerminationRequest,
125
135
  onStartShouldSetResponder: eventHandlers.onStartShouldSetResponder,
@@ -174,7 +184,9 @@ const Text: React.AbstractComponent<
174
184
  <NativeText
175
185
  {...restProps}
176
186
  {...eventHandlersForText}
187
+ disabled={_disabled}
177
188
  accessible={accessible !== false}
189
+ accessibilityState={_accessibilityState}
178
190
  allowFontScaling={allowFontScaling !== false}
179
191
  ellipsizeMode={ellipsizeMode ?? 'tail'}
180
192
  isHighlighted={isHighlighted}
@@ -189,12 +201,6 @@ const Text: React.AbstractComponent<
189
201
 
190
202
  Text.displayName = 'Text';
191
203
 
192
- /**
193
- * Switch to `deprecated-react-native-prop-types` for compatibility with future
194
- * releases. This is deprecated and will be removed in the future.
195
- */
196
- Text.propTypes = require('deprecated-react-native-prop-types').TextPropTypes;
197
-
198
204
  /**
199
205
  * Returns false until the first time `newValue` is true, after which this will
200
206
  * always return true. This is necessary to lazily initialize `Pressability` so
@@ -14,11 +14,13 @@ import {type HostComponent} from '../Renderer/shims/ReactNativeTypes';
14
14
  import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
15
15
  import {type ProcessedColorValue} from '../StyleSheet/processColor';
16
16
  import {type TextProps} from './TextProps';
17
+ import {type PressEvent} from '../Types/CoreEventTypes';
17
18
 
18
19
  type NativeTextProps = $ReadOnly<{
19
20
  ...TextProps,
20
21
  isHighlighted?: ?boolean,
21
22
  selectionColor?: ?ProcessedColorValue,
23
+ onClick?: ?(event: PressEvent) => mixed,
22
24
  // This is only needed for platforms that optimize text hit testing, e.g.,
23
25
  // react-native-windows. It can be used to only hit test virtual text spans
24
26
  // that have pressable events attached to them.
@@ -4,11 +4,13 @@ import {type HostComponent} from '../Renderer/shims/ReactNativeTypes';
4
4
  import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass';
5
5
  import {type ProcessedColorValue} from '../StyleSheet/processColor';
6
6
  import {type TextProps} from './TextProps';
7
+ import {type PressEvent} from '../Types/CoreEventTypes';
7
8
 
8
9
  type NativeTextProps = $ReadOnly<{
9
10
  ...TextProps,
10
11
  isHighlighted?: ?boolean,
11
12
  selectionColor?: ?ProcessedColorValue,
13
+ onClick?: ?(event: PressEvent) => mixed,
12
14
  // This is only needed for platforms that optimize text hit testing, e.g.,
13
15
  // react-native-windows. It can be used to only hit test virtual text spans
14
16
  // that have pressable events attached to them.
@@ -12,6 +12,7 @@
12
12
 
13
13
  import type {
14
14
  LayoutEvent,
15
+ PointerEvent,
15
16
  PressEvent,
16
17
  TextLayoutEvent,
17
18
  } from '../Types/CoreEventTypes';
@@ -31,10 +32,18 @@ export type PressRetentionOffset = $ReadOnly<{|
31
32
  right: number,
32
33
  |}>;
33
34
 
35
+ type PointerEventProps = $ReadOnly<{|
36
+ onPointerEnter?: (event: PointerEvent) => void,
37
+ onPointerLeave?: (event: PointerEvent) => void,
38
+ onPointerMove?: (event: PointerEvent) => void,
39
+ |}>;
40
+
34
41
  /**
35
42
  * @see https://reactnative.dev/docs/text#reference
36
43
  */
37
44
  export type TextProps = $ReadOnly<{|
45
+ ...PointerEventProps,
46
+
38
47
  /**
39
48
  * Indicates whether the view is an accessibility element.
40
49
  *
@@ -44,6 +53,7 @@ export type TextProps = $ReadOnly<{|
44
53
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
45
54
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
46
55
  accessibilityHint?: ?Stringish,
56
+ accessibilityLanguage?: ?Stringish,
47
57
  accessibilityLabel?: ?Stringish,
48
58
  accessibilityRole?: ?AccessibilityRole,
49
59
  accessibilityState?: ?AccessibilityState,
@@ -11,7 +11,7 @@
11
11
  import * as React from 'react';
12
12
  import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
13
13
 
14
- export type SyntheticEvent<T> = $ReadOnly<{|
14
+ export type SyntheticEvent<+T> = $ReadOnly<{|
15
15
  bubbles: ?boolean,
16
16
  cancelable: ?boolean,
17
17
  currentTarget: number | React.ElementRef<HostComponent<mixed>>,
@@ -83,6 +83,18 @@ export type TextLayoutEvent = SyntheticEvent<
83
83
  |}>,
84
84
  >;
85
85
 
86
+ export type PointerEvent = ResponderSyntheticEvent<
87
+ $ReadOnly<{|
88
+ pointerId: number,
89
+ pressure: number,
90
+ pointerType: string,
91
+ clientX: number,
92
+ clientY: number,
93
+ target: ?number,
94
+ timestamp: number,
95
+ |}>,
96
+ >;
97
+
86
98
  export type PressEvent = ResponderSyntheticEvent<
87
99
  $ReadOnly<{|
88
100
  changedTouches: $ReadOnlyArray<$PropertyType<PressEvent, 'nativeEvent'>>,
@@ -11,7 +11,7 @@
11
11
  import * as React from 'react';
12
12
  import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
13
13
 
14
- export type SyntheticEvent<T> = $ReadOnly<{|
14
+ export type SyntheticEvent<+T> = $ReadOnly<{|
15
15
  bubbles: ?boolean,
16
16
  cancelable: ?boolean,
17
17
  currentTarget: number | React.ElementRef<HostComponent<mixed>>,
@@ -83,6 +83,29 @@ export type TextLayoutEvent = SyntheticEvent<
83
83
  |}>,
84
84
  >;
85
85
 
86
+ export type PointerEvent = ResponderSyntheticEvent<
87
+ $ReadOnly<{|
88
+ pointerId: number,
89
+ pressure: number,
90
+ pointerType: string,
91
+ clientX: number,
92
+ clientY: number,
93
+ target: ?number,
94
+ timestamp: number,
95
+ // [Windows
96
+ isLeftButton: boolean,
97
+ isRightButton: boolean,
98
+ isMiddleButton: boolean,
99
+ isBarrelButtonPressed: boolean,
100
+ isHorizontalScrollWheel: boolean,
101
+ isEraser: boolean,
102
+ shiftKey: boolean,
103
+ ctrlKey: boolean,
104
+ altKey: boolean,
105
+ // Windows]
106
+ |}>,
107
+ >;
108
+
86
109
  export type PressEvent = ResponderSyntheticEvent<
87
110
  $ReadOnly<{|
88
111
  altKey: ?boolean, // TODO(macOS)
@@ -156,6 +179,8 @@ export type MouseEvent = SyntheticEvent<
156
179
  $ReadOnly<{|
157
180
  target: number,
158
181
  identifier: number,
182
+ clientX: number,
183
+ clientY: number,
159
184
  pageX: number,
160
185
  pageY: number,
161
186
  locationX: number,
@@ -91,12 +91,4 @@ module.exports = {
91
91
  addChangeListener(listener: AppearanceListener): EventSubscription {
92
92
  return eventEmitter.addListener('change', listener);
93
93
  },
94
-
95
- /**
96
- * @deprecated Use `remove` on the EventSubscription from `addEventListener`.
97
- */
98
- removeChangeListener(listener: AppearanceListener): void {
99
- // NOTE: This will report a deprecation notice via `console.error`.
100
- eventEmitter.removeListener('change', listener);
101
- },
102
94
  };
@@ -292,7 +292,7 @@ function registerBundleEntryPoints(client) {
292
292
 
293
293
  function flushEarlyLogs(client) {
294
294
  try {
295
- pendingLogs.forEach(([level: LogLevel, data: Array<mixed>]) => {
295
+ pendingLogs.forEach(([level, data]) => {
296
296
  HMRClient.log(level, data);
297
297
  });
298
298
  } finally {
@@ -17,6 +17,7 @@ const ShallowRenderer = require('react-shallow-renderer');
17
17
  /* $FlowFixMe[not-a-function] (>=0.125.1 site=react_native_fb) This comment
18
18
  * suppresses an error found when Flow v0.125.1 was deployed. To see the error,
19
19
  * delete this comment and run Flow. */
20
+ // $FlowFixMe[invalid-constructor]
20
21
  const shallowRenderer = new ShallowRenderer();
21
22
 
22
23
  import type {ReactTestRenderer as ReactTestRendererType} from 'react-test-renderer';
@@ -24,21 +24,36 @@ type Options = $ReadOnly<{|
24
24
 
25
25
  export type NativeComponentType<T> = HostComponent<T>;
26
26
 
27
+ // If this function runs then that means the view configs were not
28
+ // generated at build time using `GenerateViewConfigJs.js`. Thus
29
+ // we need to `requireNativeComponent` to get the view configs from view managers.
30
+ // `requireNativeComponent` is not available in Bridgeless mode.
31
+ // e.g. This function runs at runtime if `codegenNativeComponent` was not called
32
+ // from a file suffixed with NativeComponent.js.
27
33
  function codegenNativeComponent<Props>(
28
34
  componentName: string,
29
35
  options?: Options,
30
36
  ): NativeComponentType<Props> {
37
+ const errorMessage =
38
+ "Native Component '" +
39
+ componentName +
40
+ "' that calls codegenNativeComponent was not code generated at build time. Please check its definition.";
41
+ if (global.RN$Bridgeless === true) {
42
+ console.error(errorMessage);
43
+ } else {
44
+ console.warn(errorMessage);
45
+ }
31
46
  let componentNameInUse =
32
47
  options && options.paperComponentName != null
33
48
  ? options.paperComponentName
34
49
  : componentName;
35
50
 
36
51
  if (options != null && options.paperComponentNameDeprecated != null) {
37
- if (UIManager.getViewManagerConfig(componentName)) {
52
+ if (UIManager.hasViewManagerConfig(componentName)) {
38
53
  componentNameInUse = componentName;
39
54
  } else if (
40
55
  options.paperComponentNameDeprecated != null &&
41
- UIManager.getViewManagerConfig(options.paperComponentNameDeprecated)
56
+ UIManager.hasViewManagerConfig(options.paperComponentNameDeprecated)
42
57
  ) {
43
58
  componentNameInUse = options.paperComponentNameDeprecated;
44
59
  } else {
@@ -50,10 +65,6 @@ function codegenNativeComponent<Props>(
50
65
  }
51
66
  }
52
67
 
53
- // If this function is run at runtime then that means the view configs were not
54
- // generated with the view config babel plugin, so we need to require the native component.
55
- //
56
- // This will be useful during migration, but eventually this will error.
57
68
  return (requireNativeComponent<Props>(
58
69
  componentNameInUse,
59
70
  ): HostComponent<Props>);
@@ -43,7 +43,10 @@ export function createStringifySafeWithLimits(limits: {|
43
43
  return value;
44
44
  }
45
45
 
46
- let retval = value;
46
+ let retval:
47
+ | string
48
+ | {+[string]: mixed}
49
+ | $TEMPORARY$object<{'...(truncated keys)...': number}> = value;
47
50
  if (Array.isArray(value)) {
48
51
  if (stack.length >= maxDepth) {
49
52
  retval = `[ ... array with ${value.length} values ... ]`;
@@ -8,7 +8,7 @@
8
8
  * @flow
9
9
  */
10
10
 
11
- import ReactNativeViewViewConfig from '../Components/View/ReactNativeViewViewConfig';
11
+ import PlatformBaseViewConfig from '../NativeComponent/PlatformBaseViewConfig';
12
12
  import {type ViewConfig} from '../Renderer/shims/ReactNativeTypes';
13
13
 
14
14
  const IGNORED_KEYS = ['transform', 'hitSlop'];
@@ -62,7 +62,7 @@ export default function verifyComponentAttributeEquivalence(
62
62
 
63
63
  // Return the different key-value pairs of the right object, by iterating through the keys in the left object
64
64
  // Note it won't return a difference where a key is missing in the left but exists the right.
65
- export function lefthandObjectDiff(leftObj: Object, rightObj: Object): Object {
65
+ function lefthandObjectDiff(leftObj: Object, rightObj: Object): Object {
66
66
  const differentKeys = {};
67
67
 
68
68
  function compare(leftItem: any, rightItem: any, key: string) {
@@ -109,7 +109,7 @@ export function getConfigWithoutViewProps(
109
109
  }
110
110
 
111
111
  return Object.keys(viewConfig[propName])
112
- .filter(prop => !ReactNativeViewViewConfig[propName][prop])
112
+ .filter(prop => !PlatformBaseViewConfig[propName][prop])
113
113
  .reduce((obj, prop) => {
114
114
  obj[prop] = viewConfig[propName][prop];
115
115
  return obj;
@@ -230,7 +230,7 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
230
230
  if (ev.id !== this._socketId) {
231
231
  return;
232
232
  }
233
- let data = ev.data;
233
+ let data: Blob | BlobData | ArrayBuffer | string = ev.data;
234
234
  switch (ev.type) {
235
235
  case 'binary':
236
236
  data = base64.toByteArray(ev.data).buffer;