@office-iss/react-native-win32 0.77.0-preview.3 → 0.78.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 (103) hide show
  1. package/.flowconfig +1 -1
  2. package/CHANGELOG.json +109 -16
  3. package/CHANGELOG.md +42 -10
  4. package/Libraries/Animated/animations/Animation.js +22 -1
  5. package/Libraries/Animated/animations/DecayAnimation.js +1 -0
  6. package/Libraries/Animated/animations/SpringAnimation.js +1 -0
  7. package/Libraries/Animated/animations/TimingAnimation.js +1 -0
  8. package/Libraries/Animated/nodes/AnimatedAddition.js +9 -2
  9. package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
  10. package/Libraries/Animated/nodes/AnimatedDiffClamp.js +10 -2
  11. package/Libraries/Animated/nodes/AnimatedDivision.js +9 -2
  12. package/Libraries/Animated/nodes/AnimatedInterpolation.js +5 -1
  13. package/Libraries/Animated/nodes/AnimatedModulo.js +5 -2
  14. package/Libraries/Animated/nodes/AnimatedMultiplication.js +9 -2
  15. package/Libraries/Animated/nodes/AnimatedNode.js +25 -46
  16. package/Libraries/Animated/nodes/AnimatedObject.js +9 -2
  17. package/Libraries/Animated/nodes/AnimatedProps.js +5 -1
  18. package/Libraries/Animated/nodes/AnimatedStyle.js +5 -1
  19. package/Libraries/Animated/nodes/AnimatedSubtraction.js +9 -2
  20. package/Libraries/Animated/nodes/AnimatedTracking.js +5 -1
  21. package/Libraries/Animated/nodes/AnimatedTransform.js +5 -1
  22. package/Libraries/Animated/nodes/AnimatedValue.js +49 -4
  23. package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
  24. package/Libraries/Animated/useAnimatedProps.js +0 -43
  25. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.d.ts +1 -1
  26. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.js +4 -1
  27. package/Libraries/Components/LayoutConformance/LayoutConformance.d.ts +21 -0
  28. package/Libraries/Components/LayoutConformance/LayoutConformance.js +59 -0
  29. package/Libraries/Components/LayoutConformance/LayoutConformanceNativeComponent.js +29 -0
  30. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +1 -0
  31. package/Libraries/Components/TextInput/TextInput.d.ts +5 -0
  32. package/Libraries/Components/TextInput/TextInput.flow.js +6 -0
  33. package/Libraries/Components/TextInput/TextInput.js +6 -0
  34. package/Libraries/Components/TextInput/TextInput.win32.js +6 -0
  35. package/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
  36. package/Libraries/Components/View/ViewPropTypes.js +0 -9
  37. package/Libraries/Components/View/ViewPropTypes.win32.js +0 -9
  38. package/Libraries/Core/ReactNativeVersion.js +2 -2
  39. package/Libraries/Core/setUpBatchedBridge.js +1 -16
  40. package/Libraries/EventEmitter/RCTEventEmitter.js +2 -6
  41. package/Libraries/Image/AssetSourceResolver.js +11 -0
  42. package/Libraries/Inspector/BorderBox.js +26 -14
  43. package/Libraries/Inspector/BoxInspector.js +60 -42
  44. package/Libraries/Inspector/ElementBox.js +55 -48
  45. package/Libraries/Inspector/StyleInspector.js +36 -30
  46. package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
  47. package/Libraries/Lists/FlatList.d.ts +1 -1
  48. package/Libraries/Modal/Modal.js +2 -0
  49. package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -2
  50. package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -2
  51. package/Libraries/NativeComponent/BaseViewConfig.win32.js +0 -2
  52. package/Libraries/Network/RCTNetworking.android.js +24 -16
  53. package/Libraries/Network/RCTNetworking.ios.js +1 -46
  54. package/Libraries/Network/RCTNetworking.win32.js +1 -46
  55. package/Libraries/Network/RCTNetworkingEventDefinitions.flow.js +57 -0
  56. package/Libraries/PersonaCoin/PersonaCoin.js +1 -0
  57. package/Libraries/PersonaCoin/PersonaCoin.js.map +1 -1
  58. package/Libraries/ReactNative/UIManagerProperties.js +3 -1
  59. package/Libraries/Renderer/implementations/ReactFabric-dev.js +15828 -26461
  60. package/Libraries/Renderer/implementations/ReactFabric-prod.js +3907 -2560
  61. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +4399 -2878
  62. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +16102 -26908
  63. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +4034 -2695
  64. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +4535 -3045
  65. package/Libraries/Renderer/shims/ReactNativeTypes.js +5 -6
  66. package/Libraries/StyleSheet/processTransform.js +6 -0
  67. package/Libraries/Text/Text.d.ts +6 -1
  68. package/Libraries/Text/TextProps.js +2 -2
  69. package/Libraries/Text/TextProps.win32.js +2 -2
  70. package/Libraries/Utilities/BackHandler.android.js +5 -4
  71. package/Libraries/Utilities/BackHandler.ios.js +4 -5
  72. package/Libraries/Utilities/BackHandler.win32.js +5 -4
  73. package/index.js +5 -0
  74. package/index.win32.js +5 -0
  75. package/overrides.json +14 -14
  76. package/package.json +20 -21
  77. package/src/private/animated/NativeAnimatedValidation.js +1 -1
  78. package/src/private/featureflags/ReactNativeFeatureFlags.js +32 -26
  79. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -5
  80. package/src/private/renderer/errorhandling/ErrorHandlers.js +12 -55
  81. package/src/private/specs/modules/{NativeJSCSamplingProfiler.js → NativeCPUTime.js} +7 -2
  82. package/src/private/specs/modules/NativeFantom.js +37 -0
  83. package/src/private/utilities/ensureInstance.js +21 -0
  84. package/src/private/webapis/dom/nodes/ReactNativeElement.js +49 -6
  85. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +17 -9
  86. package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
  87. package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
  88. package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
  89. package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
  90. package/src/private/webapis/performance/Performance.js +0 -12
  91. package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
  92. package/src-win/Libraries/Components/View/ViewPropTypes.d.ts +0 -7
  93. package/src-win/Libraries/PersonaCoin/PersonaCoin.tsx +1 -0
  94. package/src-win/Libraries/Text/Text.d.ts +6 -1
  95. package/types/index.d.ts +1 -0
  96. package/Libraries/HeapCapture/HeapCapture.js +0 -29
  97. package/Libraries/HeapCapture/NativeJSCHeapCapture.js +0 -13
  98. package/Libraries/Performance/NativeJSCSamplingProfiler.js +0 -13
  99. package/Libraries/Performance/SamplingProfiler.js +0 -39
  100. package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
  101. package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
  102. package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
  103. package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
@@ -162,6 +162,7 @@ const RCTTextInputViewConfig = {
162
162
  onChangeSync: true,
163
163
  onKeyPressSync: true,
164
164
  }),
165
+ disableKeyboardShortcuts: true,
165
166
  },
166
167
  };
167
168
 
@@ -136,6 +136,11 @@ export interface DocumentSelectionState extends EventEmitter {
136
136
  * @see https://reactnative.dev/docs/textinput#props
137
137
  */
138
138
  export interface TextInputIOSProps {
139
+ /**
140
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
141
+ */
142
+ disableKeyboardShortcuts?: boolean | undefined;
143
+
139
144
  /**
140
145
  * enum('never', 'while-editing', 'unless-editing', 'always')
141
146
  * When the clear button should appear on the right side of the text view
@@ -216,6 +216,12 @@ export type enterKeyHintType =
216
216
  type PasswordRules = string;
217
217
 
218
218
  type IOSProps = $ReadOnly<{|
219
+ /**
220
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
221
+ * @platform ios
222
+ */
223
+ disableKeyboardShortcuts?: ?boolean,
224
+
219
225
  /**
220
226
  * When the clear button should appear on the right side of the text view.
221
227
  * This property is supported only for single-line TextInput component.
@@ -260,6 +260,12 @@ export type enterKeyHintType =
260
260
  type PasswordRules = string;
261
261
 
262
262
  type IOSProps = $ReadOnly<{|
263
+ /**
264
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
265
+ * @platform ios
266
+ */
267
+ disableKeyboardShortcuts?: ?boolean,
268
+
263
269
  /**
264
270
  * When the clear button should appear on the right side of the text view.
265
271
  * This property is supported only for single-line TextInput component.
@@ -271,6 +271,12 @@ export type enterKeyHintType =
271
271
  type PasswordRules = string;
272
272
 
273
273
  type IOSProps = $ReadOnly<{|
274
+ /**
275
+ * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
276
+ * @platform ios
277
+ */
278
+ disableKeyboardShortcuts?: ?boolean,
279
+
274
280
  /**
275
281
  * When the clear button should appear on the right side of the text view.
276
282
  * This property is supported only for single-line TextInput component.
@@ -343,13 +343,6 @@ export interface ViewProps
343
343
  * Used to reference react managed views from native code.
344
344
  */
345
345
  nativeID?: string | undefined;
346
-
347
- /**
348
- * Contols whether this view, and its transitive children, are laid in a way
349
- * consistent with web browsers ('strict'), or consistent with existing
350
- * React Native code which may rely on incorrect behavior ('classic').
351
- */
352
- experimental_layoutConformance?: 'strict' | 'classic' | undefined;
353
346
  }
354
347
 
355
348
  // For backwards compat.... // Win32
@@ -578,15 +578,6 @@ export type ViewProps = $ReadOnly<{|
578
578
  */
579
579
  collapsableChildren?: ?boolean,
580
580
 
581
- /**
582
- * Contols whether this view, and its transitive children, are laid in a way
583
- * consistent with web browsers ('strict'), or consistent with existing
584
- * React Native code which may rely on incorrect behavior ('classic').
585
- *
586
- * This prop only works when using Fabric.
587
- */
588
- experimental_layoutConformance?: ?('strict' | 'classic'),
589
-
590
581
  /**
591
582
  * Used to locate this view from native classes. Has precedence over `nativeID` prop.
592
583
  *
@@ -639,15 +639,6 @@ export type ViewProps = $ReadOnly<{|
639
639
  */
640
640
  collapsableChildren?: ?boolean,
641
641
 
642
- /**
643
- * Contols whether this view, and its transitive children, are laid in a way
644
- * consistent with web browsers ('strict'), or consistent with existing
645
- * React Native code which may rely on incorrect behavior ('classic').
646
- *
647
- * This prop only works when using Fabric.
648
- */
649
- experimental_layoutConformance?: ?('strict' | 'classic'),
650
-
651
642
  /**
652
643
  * Used to locate this view from native classes. Has precedence over `nativeID` prop.
653
644
  *
@@ -15,9 +15,9 @@ const version: $ReadOnly<{
15
15
  prerelease: string | null,
16
16
  }> = {
17
17
  major: 0,
18
- minor: 77,
18
+ minor: 78,
19
19
  patch: 0,
20
- prerelease: 'rc.6',
20
+ prerelease: 'rc.0',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -10,27 +10,12 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- let registerModule;
14
- if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
15
- registerModule = global.RN$registerCallableModule;
16
- } else {
17
- const BatchedBridge = require('../BatchedBridge/BatchedBridge');
18
- registerModule = (
19
- moduleName: string,
20
- /* $FlowFixMe[missing-local-annot] The type annotation(s) required by
21
- * Flow's LTI update could not be added via codemod */
22
- factory,
23
- ) => BatchedBridge.registerLazyCallableModule(moduleName, factory);
24
- }
13
+ import registerModule from './registerCallableModule';
25
14
 
26
15
  registerModule('Systrace', () => require('../Performance/Systrace'));
27
16
  if (!(global.RN$Bridgeless === true)) {
28
17
  registerModule('JSTimers', () => require('./Timers/JSTimers'));
29
18
  }
30
- registerModule('HeapCapture', () => require('../HeapCapture/HeapCapture'));
31
- registerModule('SamplingProfiler', () =>
32
- require('../Performance/SamplingProfiler'),
33
- );
34
19
  registerModule('RCTLog', () => require('../Utilities/RCTLog'));
35
20
  registerModule(
36
21
  'RCTDeviceEventEmitter',
@@ -10,15 +10,11 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- const BatchedBridge = require('../BatchedBridge/BatchedBridge');
13
+ import registerCallableModule from '../Core/registerCallableModule';
14
14
 
15
15
  const RCTEventEmitter = {
16
16
  register(eventEmitter: any) {
17
- if (global.RN$Bridgeless) {
18
- global.RN$registerCallableModule('RCTEventEmitter', () => eventEmitter);
19
- } else {
20
- BatchedBridge.registerCallableModule('RCTEventEmitter', eventEmitter);
21
- }
17
+ registerCallableModule('RCTEventEmitter', eventEmitter);
22
18
  },
23
19
  };
24
20
 
@@ -55,6 +55,17 @@ function getAssetPathInDrawableFolder(asset: PackagerAsset): string {
55
55
 
56
56
  /**
57
57
  * Returns true if the asset can be loaded over the network.
58
+ *
59
+ * This prevents an issue loading XML assets on Android. XML asset types like
60
+ * vector drawables can only be loaded from precompiled source. Android does
61
+ * not support loading these over the network, and AAPT precompiles data by
62
+ * breaking path data and resource information apart into multiple files,
63
+ * stuffing it all into the resource table. As a result, we should only attempt
64
+ * to load resources as we would in release builds: by the resource name.
65
+ *
66
+ * For more information, see:
67
+ * https://issuetracker.google.com/issues/62435069
68
+ * https://issuetracker.google.com/issues/68293189
58
69
  */
59
70
  function assetSupportsNetworkLoads(asset: PackagerAsset): boolean {
60
71
  return !(asset.type === 'xml' && Platform.OS === 'android');
@@ -10,23 +10,35 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+
15
+ import React from 'react';
16
+
13
17
  const View = require('../Components/View/View');
14
- const React = require('react');
15
18
 
16
- class BorderBox extends React.Component<$FlowFixMeProps> {
17
- render(): $FlowFixMe | React.Node {
18
- const box = this.props.box;
19
- if (!box) {
20
- return this.props.children;
21
- }
22
- const style = {
23
- borderTopWidth: box.top,
24
- borderBottomWidth: box.bottom,
25
- borderLeftWidth: box.left,
26
- borderRightWidth: box.right,
27
- };
28
- return <View style={[style, this.props.style]}>{this.props.children}</View>;
19
+ type Props = $ReadOnly<{
20
+ children: React.Node,
21
+ box?: ?$ReadOnly<{
22
+ top: number,
23
+ right: number,
24
+ bottom: number,
25
+ left: number,
26
+ ...
27
+ }>,
28
+ style?: ViewStyleProp,
29
+ }>;
30
+
31
+ function BorderBox({children, box, style}: Props): React.Node {
32
+ if (!box) {
33
+ return children;
29
34
  }
35
+ const borderStyle = {
36
+ borderTopWidth: box.top,
37
+ borderBottomWidth: box.bottom,
38
+ borderLeftWidth: box.left,
39
+ borderRightWidth: box.right,
40
+ };
41
+ return <View style={[borderStyle, style]}>{children}</View>;
30
42
  }
31
43
 
32
44
  module.exports = BorderBox;
@@ -10,11 +10,15 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {TextStyleProp, ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {InspectedElementFrame} from './Inspector';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const StyleSheet = require('../StyleSheet/StyleSheet');
15
20
  const Text = require('../Text/Text');
16
21
  const resolveBoxStyle = require('./resolveBoxStyle');
17
- const React = require('react');
18
22
 
19
23
  const blank = {
20
24
  top: 0,
@@ -23,51 +27,65 @@ const blank = {
23
27
  bottom: 0,
24
28
  };
25
29
 
26
- class BoxInspector extends React.Component<$FlowFixMeProps> {
27
- render(): React.Node {
28
- const frame = this.props.frame;
29
- const style = this.props.style;
30
- const margin = (style && resolveBoxStyle('margin', style)) || blank;
31
- const padding = (style && resolveBoxStyle('padding', style)) || blank;
32
- return (
33
- <BoxContainer title="margin" titleStyle={styles.marginLabel} box={margin}>
34
- <BoxContainer title="padding" box={padding}>
35
- <View>
36
- <Text style={styles.innerText}>
37
- ({(frame.left || 0).toFixed(1)}, {(frame.top || 0).toFixed(1)})
38
- </Text>
39
- <Text style={styles.innerText}>
40
- {(frame.width || 0).toFixed(1)} &times;{' '}
41
- {(frame.height || 0).toFixed(1)}
42
- </Text>
43
- </View>
44
- </BoxContainer>
45
- </BoxContainer>
46
- );
47
- }
48
- }
30
+ type BoxInspectorProps = $ReadOnly<{
31
+ style: ViewStyleProp,
32
+ frame: ?InspectedElementFrame,
33
+ }>;
34
+
35
+ function BoxInspector({style, frame}: BoxInspectorProps): React.Node {
36
+ const margin = (style && resolveBoxStyle('margin', style)) || blank;
37
+ const padding = (style && resolveBoxStyle('padding', style)) || blank;
49
38
 
50
- class BoxContainer extends React.Component<$FlowFixMeProps> {
51
- render(): React.Node {
52
- const box = this.props.box;
53
- return (
54
- <View style={styles.box}>
55
- <View style={styles.row}>
56
- {}
57
- <Text style={[this.props.titleStyle, styles.label]}>
58
- {this.props.title}
39
+ return (
40
+ <BoxContainer title="margin" titleStyle={styles.marginLabel} box={margin}>
41
+ <BoxContainer title="padding" box={padding}>
42
+ <View>
43
+ <Text style={styles.innerText}>
44
+ ({(frame?.left || 0).toFixed(1)}, {(frame?.top || 0).toFixed(1)})
45
+ </Text>
46
+ <Text style={styles.innerText}>
47
+ {(frame?.width || 0).toFixed(1)} &times;{' '}
48
+ {(frame?.height || 0).toFixed(1)}
59
49
  </Text>
60
- <Text style={styles.boxText}>{box.top}</Text>
61
- </View>
62
- <View style={styles.row}>
63
- <Text style={styles.boxText}>{box.left}</Text>
64
- {this.props.children}
65
- <Text style={styles.boxText}>{box.right}</Text>
66
50
  </View>
67
- <Text style={styles.boxText}>{box.bottom}</Text>
51
+ </BoxContainer>
52
+ </BoxContainer>
53
+ );
54
+ }
55
+
56
+ type BoxContainerProps = $ReadOnly<{
57
+ title: string,
58
+ titleStyle?: TextStyleProp,
59
+ box: $ReadOnly<{
60
+ top: number,
61
+ left: number,
62
+ right: number,
63
+ bottom: number,
64
+ }>,
65
+ children: React.Node,
66
+ }>;
67
+
68
+ function BoxContainer({
69
+ title,
70
+ titleStyle,
71
+ box,
72
+ children,
73
+ }: BoxContainerProps): React.Node {
74
+ return (
75
+ <View style={styles.box}>
76
+ <View style={styles.row}>
77
+ {}
78
+ <Text style={[titleStyle, styles.label]}>{title}</Text>
79
+ <Text style={styles.boxText}>{box.top}</Text>
80
+ </View>
81
+ <View style={styles.row}>
82
+ <Text style={styles.boxText}>{box.left}</Text>
83
+ {children}
84
+ <Text style={styles.boxText}>{box.right}</Text>
68
85
  </View>
69
- );
70
- }
86
+ <Text style={styles.boxText}>{box.bottom}</Text>
87
+ </View>
88
+ );
71
89
  }
72
90
 
73
91
  const styles = StyleSheet.create({
@@ -10,65 +10,72 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {InspectedElementFrame} from './Inspector';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const flattenStyle = require('../StyleSheet/flattenStyle');
15
20
  const StyleSheet = require('../StyleSheet/StyleSheet');
16
21
  const Dimensions = require('../Utilities/Dimensions').default;
17
22
  const BorderBox = require('./BorderBox');
18
23
  const resolveBoxStyle = require('./resolveBoxStyle');
19
- const React = require('react');
20
-
21
- class ElementBox extends React.Component<$FlowFixMeProps> {
22
- render(): React.Node {
23
- const style = flattenStyle(this.props.style) || {};
24
- let margin: ?$ReadOnly<Style> = resolveBoxStyle('margin', style);
25
- let padding: ?$ReadOnly<Style> = resolveBoxStyle('padding', style);
26
-
27
- const frameStyle = {...this.props.frame};
28
- const contentStyle: {width: number, height: number} = {
29
- width: this.props.frame.width,
30
- height: this.props.frame.height,
31
- };
32
-
33
- if (margin != null) {
34
- margin = resolveRelativeSizes(margin);
35
-
36
- frameStyle.top -= margin.top;
37
- frameStyle.left -= margin.left;
38
- frameStyle.height += margin.top + margin.bottom;
39
- frameStyle.width += margin.left + margin.right;
40
-
41
- if (margin.top < 0) {
42
- contentStyle.height += margin.top;
43
- }
44
- if (margin.bottom < 0) {
45
- contentStyle.height += margin.bottom;
46
- }
47
- if (margin.left < 0) {
48
- contentStyle.width += margin.left;
49
- }
50
- if (margin.right < 0) {
51
- contentStyle.width += margin.right;
52
- }
53
- }
54
24
 
55
- if (padding != null) {
56
- padding = resolveRelativeSizes(padding);
25
+ type Props = $ReadOnly<{
26
+ frame: InspectedElementFrame,
27
+ style?: ?ViewStyleProp,
28
+ }>;
29
+
30
+ function ElementBox({frame, style}: Props): React.Node {
31
+ const flattenedStyle = flattenStyle(style) || {};
32
+ let margin: ?$ReadOnly<Style> = resolveBoxStyle('margin', flattenedStyle);
33
+ let padding: ?$ReadOnly<Style> = resolveBoxStyle('padding', flattenedStyle);
57
34
 
58
- contentStyle.width -= padding.left + padding.right;
59
- contentStyle.height -= padding.top + padding.bottom;
35
+ const frameStyle = {...frame};
36
+ const contentStyle: {width: number, height: number} = {
37
+ width: frame.width,
38
+ height: frame.height,
39
+ };
40
+
41
+ if (margin != null) {
42
+ margin = resolveRelativeSizes(margin);
43
+
44
+ frameStyle.top -= margin.top;
45
+ frameStyle.left -= margin.left;
46
+ frameStyle.height += margin.top + margin.bottom;
47
+ frameStyle.width += margin.left + margin.right;
48
+
49
+ if (margin.top < 0) {
50
+ contentStyle.height += margin.top;
51
+ }
52
+ if (margin.bottom < 0) {
53
+ contentStyle.height += margin.bottom;
60
54
  }
55
+ if (margin.left < 0) {
56
+ contentStyle.width += margin.left;
57
+ }
58
+ if (margin.right < 0) {
59
+ contentStyle.width += margin.right;
60
+ }
61
+ }
61
62
 
62
- return (
63
- <View style={[styles.frame, frameStyle]} pointerEvents="none">
64
- <BorderBox box={margin} style={styles.margin}>
65
- <BorderBox box={padding} style={styles.padding}>
66
- <View style={[styles.content, contentStyle]} />
67
- </BorderBox>
68
- </BorderBox>
69
- </View>
70
- );
63
+ if (padding != null) {
64
+ padding = resolveRelativeSizes(padding);
65
+
66
+ contentStyle.width -= padding.left + padding.right;
67
+ contentStyle.height -= padding.top + padding.bottom;
71
68
  }
69
+
70
+ return (
71
+ <View style={[styles.frame, frameStyle]} pointerEvents="none">
72
+ <BorderBox box={margin} style={styles.margin}>
73
+ <BorderBox box={padding} style={styles.padding}>
74
+ <View style={[styles.content, contentStyle]} />
75
+ </BorderBox>
76
+ </BorderBox>
77
+ </View>
78
+ );
72
79
  }
73
80
 
74
81
  const styles = StyleSheet.create({
@@ -10,42 +10,48 @@
10
10
 
11
11
  'use strict';
12
12
 
13
+ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
14
+ import type {____FlattenStyleProp_Internal} from '../StyleSheet/StyleSheetTypes';
15
+
16
+ import React from 'react';
17
+
13
18
  const View = require('../Components/View/View');
14
19
  const StyleSheet = require('../StyleSheet/StyleSheet');
15
20
  const Text = require('../Text/Text');
16
- const React = require('react');
17
21
 
18
- class StyleInspector extends React.Component<$FlowFixMeProps> {
19
- render(): React.Node {
20
- if (!this.props.style) {
21
- return <Text style={styles.noStyle}>No style</Text>;
22
- }
23
- const names = Object.keys(this.props.style);
24
- return (
25
- <View style={styles.container}>
26
- <View>
27
- {names.map(name => (
28
- <Text key={name} style={styles.attr}>
29
- {name}:
30
- </Text>
31
- ))}
32
- </View>
22
+ type Props = $ReadOnly<{
23
+ style?: ?____FlattenStyleProp_Internal<ViewStyleProp>,
24
+ }>;
33
25
 
34
- <View>
35
- {names.map(name => {
36
- const value = this.props.style[name];
37
- return (
38
- <Text key={name} style={styles.value}>
39
- {typeof value !== 'string' && typeof value !== 'number'
40
- ? JSON.stringify(value)
41
- : value}
42
- </Text>
43
- );
44
- })}
45
- </View>
46
- </View>
47
- );
26
+ function StyleInspector({style}: Props): React.Node {
27
+ if (!style) {
28
+ return <Text style={styles.noStyle}>No style</Text>;
48
29
  }
30
+ const names = Object.keys(style);
31
+ return (
32
+ <View style={styles.container}>
33
+ <View>
34
+ {names.map(name => (
35
+ <Text key={name} style={styles.attr}>
36
+ {name}:
37
+ </Text>
38
+ ))}
39
+ </View>
40
+
41
+ <View>
42
+ {names.map(name => {
43
+ const value = style?.[name];
44
+ return (
45
+ <Text key={name} style={styles.value}>
46
+ {typeof value !== 'string' && typeof value !== 'number'
47
+ ? JSON.stringify(value)
48
+ : value}
49
+ </Text>
50
+ );
51
+ })}
52
+ </View>
53
+ </View>
54
+ );
49
55
  }
50
56
 
51
57
  const styles = StyleSheet.create({
@@ -121,7 +121,7 @@ const Presets = {
121
121
  'opacity',
122
122
  ): LayoutAnimationConfig),
123
123
  linear: (create(500, 'linear', 'opacity'): LayoutAnimationConfig),
124
- spring: {
124
+ spring: ({
125
125
  duration: 700,
126
126
  create: {
127
127
  type: 'linear',
@@ -135,7 +135,7 @@ const Presets = {
135
135
  type: 'linear',
136
136
  property: 'opacity',
137
137
  },
138
- },
138
+ }: LayoutAnimationConfig),
139
139
  };
140
140
 
141
141
  /**
@@ -222,7 +222,7 @@ export abstract class FlatListComponent<
222
222
  /**
223
223
  * Provides a handle to the underlying scroll responder.
224
224
  */
225
- getScrollResponder: () => JSX.Element | null | undefined;
225
+ getScrollResponder: () => React.JSX.Element | null | undefined;
226
226
 
227
227
  /**
228
228
  * Provides a reference to the underlying host component
@@ -328,6 +328,7 @@ class Modal extends React.Component<Props, State> {
328
328
  <VirtualizedListContextResetter>
329
329
  <ScrollView.Context.Provider value={null}>
330
330
  <View
331
+ // $FlowFixMe[incompatible-type]
331
332
  style={[styles.container, containerStyles]}
332
333
  collapsable={false}>
333
334
  {innerChildren}
@@ -353,6 +354,7 @@ const styles = StyleSheet.create({
353
354
  /* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb) This
354
355
  * comment suppresses an error found when Flow v0.111 was deployed. To see
355
356
  * the error, delete this comment and run Flow. */
357
+ // $FlowFixMe[incompatible-call]
356
358
  [side]: 0,
357
359
  top: 0,
358
360
  flex: 1,
@@ -293,8 +293,6 @@ const validAttributesForNonEventProps = {
293
293
 
294
294
  style: ReactNativeStyleAttributes,
295
295
 
296
- experimental_layoutConformance: true,
297
-
298
296
  // ReactClippingViewManager @ReactProps
299
297
  removeClippedSubviews: true,
300
298
 
@@ -357,8 +357,6 @@ const validAttributesForNonEventProps = {
357
357
  direction: true,
358
358
 
359
359
  style: ReactNativeStyleAttributes,
360
-
361
- experimental_layoutConformance: true,
362
360
  };
363
361
 
364
362
  // Props for bubbling and direct events
@@ -348,8 +348,6 @@ const validAttributesForNonEventProps = {
348
348
  direction: true,
349
349
 
350
350
  style: ReactNativeStyleAttributes,
351
-
352
- experimental_layoutConformance: true,
353
351
  };
354
352
 
355
353
  // Props for bubbling and direct events