@office-iss/react-native-win32 0.0.0-canary.270 → 0.0.0-canary.272

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 (117) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/Animated/animations/Animation.js +63 -24
  5. package/Libraries/Animated/animations/DecayAnimation.js +26 -38
  6. package/Libraries/Animated/animations/SpringAnimation.js +33 -39
  7. package/Libraries/Animated/animations/TimingAnimation.js +34 -42
  8. package/Libraries/Animated/createAnimatedComponent.js +46 -32
  9. package/Libraries/Animated/nodes/AnimatedProps.js +16 -10
  10. package/Libraries/Animated/nodes/AnimatedStyle.js +4 -0
  11. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  12. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +61 -3
  13. package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +61 -3
  14. package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +4 -4
  15. package/Libraries/Components/Button.js +9 -4
  16. package/Libraries/Components/Button.win32.js +12 -4
  17. package/Libraries/Components/Pressable/Pressable.js +4 -4
  18. package/Libraries/Components/Pressable/Pressable.win32.js +4 -4
  19. package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +9 -6
  20. package/Libraries/Components/SafeAreaView/SafeAreaView.js +4 -4
  21. package/Libraries/Components/SafeAreaView/SafeAreaView.win32.js +4 -4
  22. package/Libraries/Components/ScrollView/ScrollView.js +10 -10
  23. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +4 -4
  24. package/Libraries/Components/Switch/Switch.js +8 -6
  25. package/Libraries/Components/TextInput/TextInput.d.ts +4 -4
  26. package/Libraries/Components/TextInput/TextInput.flow.js +7 -10
  27. package/Libraries/Components/TextInput/TextInput.js +11 -11
  28. package/Libraries/Components/TextInput/TextInput.win32.js +11 -11
  29. package/Libraries/Components/TextInput/TextInputState.js +11 -13
  30. package/Libraries/Components/TextInput/TextInputState.win32.js +13 -16
  31. package/Libraries/Components/Touchable/TouchableBounce.js +4 -1
  32. package/Libraries/Components/Touchable/TouchableHighlight.js +4 -4
  33. package/Libraries/Components/Touchable/TouchableOpacity.js +4 -4
  34. package/Libraries/Components/View/ReactNativeStyleAttributes.js +1 -0
  35. package/Libraries/Components/View/View.js +4 -4
  36. package/Libraries/Components/View/View.win32.js +4 -4
  37. package/Libraries/Components/View/ViewNativeComponent.js +3 -10
  38. package/Libraries/Core/ExceptionsManager.js +3 -2
  39. package/Libraries/Core/ReactNativeVersion.js +1 -1
  40. package/Libraries/Core/setUpBatchedBridge.js +1 -10
  41. package/Libraries/Core/setUpReactDevTools.js +3 -3
  42. package/Libraries/Core/setUpSegmentFetcher.js +1 -0
  43. package/Libraries/Core/setUpTimers.js +8 -8
  44. package/Libraries/Debugging/DebuggingOverlay.js +4 -5
  45. package/Libraries/Image/ImageBackground.js +2 -5
  46. package/Libraries/Image/ImageProps.js +5 -5
  47. package/Libraries/Image/ImageTypes.flow.js +11 -9
  48. package/Libraries/Image/ImageViewNativeComponent.js +2 -2
  49. package/Libraries/Inspector/ReactDevToolsOverlay.js +0 -1
  50. package/Libraries/Inspector/getInspectorDataForViewAtPoint.js +3 -5
  51. package/Libraries/JSInspector/NetworkAgent.js +1 -1
  52. package/Libraries/Lists/FlatList.d.ts +1 -2
  53. package/Libraries/Lists/__flowtests__/FlatList-flowtest.js +2 -2
  54. package/Libraries/Lists/__flowtests__/SectionList-flowtest.js +1 -1
  55. package/Libraries/LogBox/Data/LogBoxData.js +1 -1
  56. package/Libraries/LogBox/LogBox.js +18 -5
  57. package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +1 -1
  58. package/Libraries/LogBox/UI/LogBoxMessage.js +2 -2
  59. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
  60. package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
  61. package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
  62. package/Libraries/Network/XMLHttpRequest.js +26 -1
  63. package/Libraries/Pressability/HoverState.js +2 -0
  64. package/Libraries/Pressability/HoverState.win32.js +2 -0
  65. package/Libraries/Pressability/Pressability.js +2 -3
  66. package/Libraries/Pressability/Pressability.win32.js +2 -3
  67. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -3
  68. package/Libraries/ReactNative/RendererImplementation.js +4 -3
  69. package/Libraries/Renderer/shims/ReactNativeTypes.js +13 -18
  70. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +1 -0
  71. package/Libraries/StyleSheet/StyleSheetTypes.js +13 -0
  72. package/Libraries/StyleSheet/processTransform.js +3 -34
  73. package/Libraries/Text/Text.js +248 -249
  74. package/Libraries/Text/Text.win32.js +282 -295
  75. package/Libraries/Types/CoreEventTypes.d.ts +3 -10
  76. package/Libraries/Types/CoreEventTypes.js +4 -6
  77. package/Libraries/Types/CoreEventTypes.win32.js +4 -6
  78. package/Libraries/Utilities/Platform.flow.js +2 -2
  79. package/Libraries/Utilities/Platform.flow.win32.js +3 -2
  80. package/Libraries/__flowtests__/ReactNativeTypes-flowtest.js +5 -4
  81. package/Libraries/promiseRejectionTrackingOptions.js +1 -1
  82. package/index.js +5 -2
  83. package/index.win32.js +5 -2
  84. package/jest/setup.js +30 -0
  85. package/overrides.json +21 -21
  86. package/package.json +13 -13
  87. package/src/private/animated/NativeAnimatedHelper.js +2 -4
  88. package/src/private/animated/NativeAnimatedHelper.win32.js +2 -3
  89. package/src/private/components/HScrollViewNativeComponents.js +4 -5
  90. package/src/private/components/VScrollViewNativeComponents.js +4 -5
  91. package/src/private/{fusebox → debugging}/setUpFuseboxReactDevToolsDispatcher.js +6 -0
  92. package/src/private/featureflags/ReactNativeFeatureFlags.js +13 -22
  93. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -5
  94. package/src/private/fusebox/specs/NativeReactDevToolsRuntimeSettingsModule.js +34 -0
  95. package/src/private/specs/modules/NativeAccessibilityInfo.js +3 -0
  96. package/src/private/specs/modules/NativeAccessibilityInfoWin32.js +3 -0
  97. package/src/private/specs/modules/NativeAccessibilityManager.js +4 -0
  98. package/src/private/specs/modules/NativeAppearance.js +4 -10
  99. package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -3
  100. package/src/private/webapis/performance/EventTiming.js +13 -8
  101. package/src/private/webapis/performance/Performance.js +30 -40
  102. package/src/private/webapis/performance/PerformanceEntry.js +2 -5
  103. package/src/private/webapis/performance/PerformanceObserver.js +20 -32
  104. package/src/private/webapis/performance/RawPerformanceEntry.js +1 -1
  105. package/src/private/webapis/performance/UserTiming.js +6 -2
  106. package/src/private/webapis/performance/Utilities.js +0 -7
  107. package/src/private/webapis/performance/specs/NativePerformance.js +53 -0
  108. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceMock.js +247 -0
  109. package/src-win/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts +19 -3
  110. package/types/public/ReactNativeTypes.d.ts +4 -4
  111. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +0 -69
  112. package/src/private/webapis/performance/specs/__mocks__/NativePerformance.js +0 -69
  113. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +0 -154
  114. /package/src/private/{fusebox → debugging}/FuseboxSessionObserver.js +0 -0
  115. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.android.js +0 -0
  116. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.ios.js +0 -0
  117. /package/src/private/{reactdevtools → debugging}/ReactDevToolsSettingsManager.win32.js +0 -0
@@ -8,7 +8,7 @@
8
8
  * @format
9
9
  */
10
10
 
11
- import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
11
+ import type {HostInstance} from '../Renderer/shims/ReactNativeTypes';
12
12
  import type {
13
13
  BlurEvent,
14
14
  FocusEvent,
@@ -27,7 +27,6 @@ import {isHoverEnabled} from './HoverState';
27
27
  import PressabilityPerformanceEventEmitter from './PressabilityPerformanceEventEmitter.js';
28
28
  import {type PressabilityTouchSignal as TouchSignal} from './PressabilityTypes.js';
29
29
  import invariant from 'invariant';
30
- import * as React from 'react';
31
30
 
32
31
  export type PressabilityConfig = $ReadOnly<{|
33
32
  /**
@@ -409,7 +408,7 @@ export default class Pressability {
409
408
  _longPressDelayTimeout: ?TimeoutID = null;
410
409
  _pressDelayTimeout: ?TimeoutID = null;
411
410
  _pressOutDelayTimeout: ?TimeoutID = null;
412
- _responderID: ?number | React.ElementRef<HostComponent<mixed>> = null;
411
+ _responderID: ?number | HostInstance = null;
413
412
  _responderRegion: ?$ReadOnly<{|
414
413
  bottom: number,
415
414
  left: number,
@@ -9,7 +9,7 @@
9
9
  */
10
10
 
11
11
  import type {
12
- HostComponent,
12
+ HostInstance,
13
13
  INativeMethods,
14
14
  InternalInstanceHandle,
15
15
  MeasureInWindowOnSuccessCallback,
@@ -17,7 +17,6 @@ import type {
17
17
  MeasureOnSuccessCallback,
18
18
  ViewConfig,
19
19
  } from '../../Renderer/shims/ReactNativeTypes';
20
- import type {ElementRef} from 'react';
21
20
 
22
21
  import TextInputState from '../../Components/TextInput/TextInputState';
23
22
  import {getNodeFromInternalInstanceHandle} from '../../ReactNative/RendererProxy';
@@ -85,7 +84,7 @@ export default class ReactFabricHostComponent implements INativeMethods {
85
84
  }
86
85
 
87
86
  measureLayout(
88
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
87
+ relativeToNativeNode: number | HostInstance,
89
88
  onSuccess: MeasureLayoutOnSuccessCallback,
90
89
  onFail?: () => void /* currently unused */,
91
90
  ) {
@@ -10,6 +10,7 @@
10
10
 
11
11
  import type {
12
12
  HostComponent,
13
+ HostInstance,
13
14
  InternalInstanceHandle,
14
15
  Node,
15
16
  } from '../Renderer/shims/ReactNativeTypes';
@@ -61,7 +62,7 @@ export function renderElement({
61
62
 
62
63
  export function findHostInstance_DEPRECATED<TElementType: ElementType>(
63
64
  componentOrHandle: ?(ElementRef<TElementType> | number),
64
- ): ?ElementRef<HostComponent<mixed>> {
65
+ ): ?HostInstance {
65
66
  return require('../Renderer/shims/ReactNative').findHostInstance_DEPRECATED(
66
67
  componentOrHandle,
67
68
  );
@@ -76,7 +77,7 @@ export function findNodeHandle<TElementType: ElementType>(
76
77
  }
77
78
 
78
79
  export function dispatchCommand(
79
- handle: ElementRef<HostComponent<mixed>>,
80
+ handle: HostInstance,
80
81
  command: string,
81
82
  args: Array<mixed>,
82
83
  ): void {
@@ -98,7 +99,7 @@ export function dispatchCommand(
98
99
  }
99
100
 
100
101
  export function sendAccessibilityEvent(
101
- handle: ElementRef<HostComponent<mixed>>,
102
+ handle: HostInstance,
102
103
  eventType: string,
103
104
  ): void {
104
105
  return require('../Renderer/shims/ReactNative').sendAccessibilityEvent(
@@ -7,7 +7,7 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<b803401b6dd721b9caffdac1f8b6fd1c>>
10
+ * @generated SignedSource<<9e6c8931d3b0c36d35ad5da90b721b85>>
11
11
  */
12
12
 
13
13
  import type {
@@ -113,31 +113,32 @@ export interface INativeMethods {
113
113
  measure(callback: MeasureOnSuccessCallback): void;
114
114
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void;
115
115
  measureLayout(
116
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
116
+ relativeToNativeNode: number | HostInstance,
117
117
  onSuccess: MeasureLayoutOnSuccessCallback,
118
118
  onFail?: () => void,
119
119
  ): void;
120
120
  setNativeProps(nativeProps: {...}): void;
121
121
  }
122
122
 
123
- export type NativeMethods = $ReadOnly<{|
123
+ export type NativeMethods = $ReadOnly<{
124
124
  blur(): void,
125
125
  focus(): void,
126
126
  measure(callback: MeasureOnSuccessCallback): void,
127
127
  measureInWindow(callback: MeasureInWindowOnSuccessCallback): void,
128
128
  measureLayout(
129
- relativeToNativeNode: number | ElementRef<HostComponent<mixed>>,
129
+ relativeToNativeNode: number | HostInstance,
130
130
  onSuccess: MeasureLayoutOnSuccessCallback,
131
131
  onFail?: () => void,
132
132
  ): void,
133
133
  setNativeProps(nativeProps: {...}): void,
134
- |}>;
134
+ }>;
135
135
 
136
136
  // This validates that INativeMethods and NativeMethods stay in sync using Flow!
137
137
  declare const ensureNativeMethodsAreSynced: NativeMethods;
138
138
  (ensureNativeMethodsAreSynced: INativeMethods);
139
139
 
140
- export type HostComponent<T> = AbstractComponent<T, $ReadOnly<NativeMethods>>;
140
+ export type HostInstance = NativeMethods;
141
+ export type HostComponent<Config> = AbstractComponent<Config, HostInstance>;
141
142
 
142
143
  type SecretInternalsType = {
143
144
  computeComponentStackForErrorReporting(tag: number): string,
@@ -210,7 +211,7 @@ export type RenderRootOptions = {
210
211
  export type ReactNativeType = {
211
212
  findHostInstance_DEPRECATED<TElementType: ElementType>(
212
213
  componentOrHandle: ?(ElementRef<TElementType> | number),
213
- ): ?ElementRef<HostComponent<mixed>>,
214
+ ): ?HostInstance,
214
215
  findNodeHandle<TElementType: ElementType>(
215
216
  componentOrHandle: ?(ElementRef<TElementType> | number),
216
217
  ): ?number,
@@ -219,14 +220,11 @@ export type ReactNativeType = {
219
220
  child: PublicInstance | HostComponent<mixed>,
220
221
  ): boolean,
221
222
  dispatchCommand(
222
- handle: ElementRef<HostComponent<mixed>>,
223
+ handle: HostInstance,
223
224
  command: string,
224
225
  args: Array<mixed>,
225
226
  ): void,
226
- sendAccessibilityEvent(
227
- handle: ElementRef<HostComponent<mixed>>,
228
- eventType: string,
229
- ): void,
227
+ sendAccessibilityEvent(handle: HostInstance, eventType: string): void,
230
228
  render(
231
229
  element: MixedElement,
232
230
  containerTag: number,
@@ -248,20 +246,17 @@ type PublicTextInstance = mixed;
248
246
  export type ReactFabricType = {
249
247
  findHostInstance_DEPRECATED<TElementType: ElementType>(
250
248
  componentOrHandle: ?(ElementRef<TElementType> | number),
251
- ): ?ElementRef<HostComponent<mixed>>,
249
+ ): ?HostInstance,
252
250
  findNodeHandle<TElementType: ElementType>(
253
251
  componentOrHandle: ?(ElementRef<TElementType> | number),
254
252
  ): ?number,
255
253
  dispatchCommand(
256
- handle: ElementRef<HostComponent<mixed>>,
254
+ handle: HostInstance,
257
255
  command: string,
258
256
  args: Array<mixed>,
259
257
  ): void,
260
258
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
261
- sendAccessibilityEvent(
262
- handle: ElementRef<HostComponent<mixed>>,
263
- eventType: string,
264
- ): void,
259
+ sendAccessibilityEvent(handle: HostInstance, eventType: string): void,
265
260
  render(
266
261
  element: MixedElement,
267
262
  containerTag: number,
@@ -55,6 +55,7 @@ export interface FlexStyle {
55
55
  borderTopWidth?: number | undefined;
56
56
  borderWidth?: number | undefined;
57
57
  bottom?: DimensionValue | undefined;
58
+ boxSizing?: 'border-box' | 'content-box' | undefined;
58
59
  display?: 'none' | 'flex' | undefined;
59
60
  end?: DimensionValue | undefined;
60
61
  flex?: number | undefined;
@@ -612,6 +612,19 @@ type ____LayoutStyle_Internal = $ReadOnly<{
612
612
  */
613
613
  aspectRatio?: number | string,
614
614
 
615
+ /**
616
+ * Box sizing controls whether certain size properties apply to the node's
617
+ * content box or border box. The size properties in question include `width`,
618
+ * `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, and `flexBasis`.
619
+ *
620
+ * e.g: Say a node has 10px of padding and 10px of borders on all
621
+ * sides and a defined `width` and `height` of 100px and 50px. Then the total
622
+ * size of the node (content area + padding + border) would be 100px by 50px
623
+ * under `boxSizing: border-box` and 120px by 70px under
624
+ * `boxSizing: content-box`.
625
+ */
626
+ boxSizing?: 'border-box' | 'content-box',
627
+
615
628
  /** `zIndex` controls which components display on top of others.
616
629
  * Normally, you don't use `zIndex`. Components render according to
617
630
  * their order in the document tree, so later components draw over
@@ -26,7 +26,7 @@ function processTransform(
26
26
  ): Array<Object> | Array<number> {
27
27
  if (typeof transform === 'string') {
28
28
  const regex = new RegExp(/(\w+)\(([^)]+)\)/g);
29
- let transformArray: Array<Object> = [];
29
+ const transformArray: Array<Object> = [];
30
30
  let matches;
31
31
 
32
32
  while ((matches = regex.exec(transform))) {
@@ -50,23 +50,7 @@ function processTransform(
50
50
  }
51
51
 
52
52
  const _getKeyAndValueFromCSSTransform: (
53
- key:
54
- | string
55
- | $TEMPORARY$string<'matrix'>
56
- | $TEMPORARY$string<'perspective'>
57
- | $TEMPORARY$string<'rotate'>
58
- | $TEMPORARY$string<'rotateX'>
59
- | $TEMPORARY$string<'rotateY'>
60
- | $TEMPORARY$string<'rotateZ'>
61
- | $TEMPORARY$string<'scale'>
62
- | $TEMPORARY$string<'scaleX'>
63
- | $TEMPORARY$string<'scaleY'>
64
- | $TEMPORARY$string<'skewX'>
65
- | $TEMPORARY$string<'skewY'>
66
- | $TEMPORARY$string<'translate'>
67
- | $TEMPORARY$string<'translate3d'>
68
- | $TEMPORARY$string<'translateX'>
69
- | $TEMPORARY$string<'translateY'>,
53
+ key: string,
70
54
  args: string,
71
55
  ) => {key: string, value?: Array<string | number> | number | string} = (
72
56
  key,
@@ -169,22 +153,7 @@ function _validateTransforms(transform: Array<Object>): void {
169
153
  }
170
154
 
171
155
  function _validateTransform(
172
- key:
173
- | string
174
- | $TEMPORARY$string<'matrix'>
175
- | $TEMPORARY$string<'perspective'>
176
- | $TEMPORARY$string<'rotate'>
177
- | $TEMPORARY$string<'rotateX'>
178
- | $TEMPORARY$string<'rotateY'>
179
- | $TEMPORARY$string<'rotateZ'>
180
- | $TEMPORARY$string<'scale'>
181
- | $TEMPORARY$string<'scaleX'>
182
- | $TEMPORARY$string<'scaleY'>
183
- | $TEMPORARY$string<'skewX'>
184
- | $TEMPORARY$string<'skewY'>
185
- | $TEMPORARY$string<'translate'>
186
- | $TEMPORARY$string<'translateX'>
187
- | $TEMPORARY$string<'translateY'>,
156
+ key: string,
188
157
  value: any | number | string,
189
158
  transformation: any,
190
159
  ) {