react-native-macos 0.0.0-793ebb8ba → 0.0.0-7ae1439d0

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 (76) hide show
  1. package/Libraries/AddressSanitizerCrash/RCTAddressSanitizerCrash.js +25 -0
  2. package/Libraries/Animated/nodes/AnimatedValue.js +0 -1
  3. package/Libraries/Components/Button.js +1 -1
  4. package/Libraries/Components/CheckBox/CheckBox.macos.js +8 -4
  5. package/Libraries/Components/Keyboard/Keyboard.js +2 -2
  6. package/Libraries/Components/Pressable/Pressable.js +57 -0
  7. package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
  8. package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
  9. package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
  10. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
  11. package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
  12. package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
  13. package/Libraries/Components/View/View.js +8 -10
  14. package/Libraries/Components/View/ViewAccessibility.js +0 -1
  15. package/Libraries/Components/View/ViewPropTypes.js +1 -7
  16. package/Libraries/Core/ReactNativeVersion.js +5 -1
  17. package/Libraries/Image/RCTImageView.mm +2 -8
  18. package/Libraries/LogBox/Data/LogBoxData.js +18 -18
  19. package/Libraries/Pressability/Pressability.js +18 -16
  20. package/Libraries/StyleSheet/PlatformColorValueTypes.macos.js +16 -1
  21. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.js +2 -0
  22. package/Libraries/StyleSheet/PlatformColorValueTypesMacOS.macos.js +8 -1
  23. package/Libraries/Text/Text/RCTTextView.m +7 -1
  24. package/Libraries/Text/TextInput/RCTBackedTextInputDelegate.h +2 -0
  25. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +15 -3
  26. package/Libraries/Text/TextInput/RCTBaseTextInputView.m +9 -0
  27. package/Libraries/Text/TextNativeComponent.js +1 -0
  28. package/Libraries/Types/RootTagTypes.js~merged +23 -0
  29. package/README.md +19 -43
  30. package/React/Base/RCTBridgeModule.h +1 -1
  31. package/React/Base/RCTConvert.m +22 -5
  32. package/React/Base/RCTVersion.m +5 -1
  33. package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +1 -1
  34. package/React/Base/macOS/RCTPlatformDisplayLink.m +4 -1
  35. package/React/CoreModules/RCTAddressSanitizerCrashManager.h +12 -0
  36. package/React/CoreModules/RCTAddressSanitizerCrashManager.mm +18 -0
  37. package/React/CoreModules/RCTAlertController.m +8 -4
  38. package/React/CoreModules/RCTAppearance.mm +22 -23
  39. package/React/CoreModules/RCTDevLoadingView.mm +14 -9
  40. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec-generated.mm +2126 -0
  41. package/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h +2682 -0
  42. package/React/Modules/RCTEventEmitter.h +2 -2
  43. package/React/Views/RCTSwitch.h +1 -1
  44. package/React/Views/RCTSwitch.m +0 -15
  45. package/React/Views/RCTView.h +5 -2
  46. package/React/Views/RCTView.m +18 -15
  47. package/React/Views/RCTViewManager.m +9 -15
  48. package/React-Core.podspec +0 -11
  49. package/ReactAndroid/gradle.properties +1 -1
  50. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +7 -0
  51. package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +7 -0
  52. package/ReactAndroid/src/main/java/com/facebook/react/devsupport/interfaces/BundleLoadCallback.java +3 -1
  53. package/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +10 -1
  54. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
  55. package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java +0 -8
  56. package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +8 -8
  57. package/ReactAndroid/src/main/jni/third-party/libevent/event-config.h +339 -339
  58. package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
  59. package/jest/preprocessor.js +7 -75
  60. package/local-cli/cli.js +0 -0
  61. package/local-cli/generator-macos/templates/macos/Podfile +2 -7
  62. package/package.json +10 -15
  63. package/scripts/react-native-xcode.sh +1 -1
  64. package/scripts/react_native_pods.rb +1 -1
  65. package/template/package.json +3 -1
  66. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  67. package/CHANGELOG.json +0 -500
  68. package/CHANGELOG.md +0 -240
  69. package/Libraries/.npmignore +0 -1
  70. package/React/Base/macOS/RCTDynamicColor.h +0 -28
  71. package/React/Base/macOS/RCTDynamicColor.m +0 -219
  72. package/ReactAndroid/.npmignore +0 -5
  73. package/ReactAndroid/src/main/jni/first-party/fbjni/.gitignore +0 -2
  74. package/ReactCommon/hermes/inspector/tools/msggen/.gitignore +0 -3
  75. package/scripts/fixmacscripts.sh +0 -9
  76. package/scripts/postInstall.js +0 -6
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its 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
+ * @format
8
+ * @flow
9
+ */
10
+
11
+ 'use strict';
12
+ import type {HostComponent} from '../Renderer/shims/ReactNativeTypes';
13
+ import type {ViewProps} from '../Components/View/ViewPropTypes';
14
+
15
+ const {requireNativeComponent} = require('react-native');
16
+
17
+ type NativeProps = $ReadOnly<{|
18
+ ...ViewProps,
19
+ |}>;
20
+
21
+ const RCTAddressSanitizerCrash: HostComponent<NativeProps> = requireNativeComponent<NativeProps>(
22
+ 'RCTAddressSanitizerCrash',
23
+ );
24
+
25
+ module.exports = RCTAddressSanitizerCrash;
@@ -196,7 +196,6 @@ class AnimatedValue extends AnimatedWithChildren {
196
196
  resetAnimation(callback?: ?(value: number) => void): void {
197
197
  this.stopAnimation(callback);
198
198
  this._value = this._startingValue;
199
- // TODO(macOS GH#774): A bug fix that hasn't been merged to upstream yet.
200
199
  if (this.__isNative) {
201
200
  NativeAnimatedAPI.setAnimatedNodeValue(
202
201
  this.__getNativeTag(),
@@ -23,10 +23,10 @@ import type {KeyEvent} from '../Types/CoreEventTypes'; // TODO(OSS Candidate ISS
23
23
  import type {FocusEvent, BlurEvent} from './TextInput/TextInput'; // TODO(OSS Candidate ISS#2710739)
24
24
 
25
25
  import type {
26
+ AccessibilityState,
26
27
  AccessibilityActionEvent,
27
28
  AccessibilityActionInfo,
28
29
  AccessibilityRole,
29
- AccessibilityState,
30
30
  } from './View/ViewAccessibility';
31
31
  import type {PressEvent} from '../Types/CoreEventTypes';
32
32
 
@@ -4,12 +4,16 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
- * @flow strict-local
7
+ * @flow strict
8
8
  * @format
9
9
  */
10
10
 
11
- // TODO(macOS GH#774)
12
-
13
11
  'use strict';
14
12
 
15
- module.exports = require('../UnimplementedViews/UnimplementedView');
13
+ function capitalize(string: string): string {
14
+ return string.charAt(0).toUpperCase() + string.slice(1);
15
+ }
16
+
17
+ module.exports = {
18
+ capitalize,
19
+ };
@@ -143,9 +143,9 @@ class Keyboard {
143
143
  }
144
144
 
145
145
  /**
146
- * @deprecated Use `remove` on the EventSubscription from `addEventListener`.
146
+ * @deprecated Use `remove` on the EventSubscription from `addListener`.
147
147
  */
148
- removeEventListener<K: $Keys<KeyboardEventDefinitions>>(
148
+ removeListener<K: $Keys<KeyboardEventDefinitions>>(
149
149
  eventType: K,
150
150
  listener: (...$ElementType<KeyboardEventDefinitions, K>) => mixed,
151
151
  ): void {
@@ -27,6 +27,11 @@ import type {
27
27
  LayoutEvent,
28
28
  MouseEvent,
29
29
  PressEvent,
30
+ // [TODO(macOS GH#774)
31
+ FocusEvent,
32
+ BlurEvent,
33
+ KeyEvent,
34
+ // ]TODO(macOS GH#774)
30
35
  } from '../../Types/CoreEventTypes';
31
36
  import type {DraggedTypesType} from '../View/DraggedType'; // TODO(macOS GH#774)
32
37
  import View from '../View/View';
@@ -134,6 +139,40 @@ type Props = $ReadOnly<{|
134
139
  */
135
140
  onPressOut?: ?(event: PressEvent) => mixed,
136
141
 
142
+ // [TODO(macOS GH#774)
143
+ /**
144
+ * Called after the element is focused.
145
+ */
146
+ onFocus?: ?(event: FocusEvent) => mixed,
147
+
148
+ /**
149
+ * Called after the element loses focus.
150
+ */
151
+ onBlur?: ?(event: BlurEvent) => mixed,
152
+
153
+ /**
154
+ * Called after a key down event is detected.
155
+ */
156
+ onKeyDown?: ?(event: KeyEvent) => mixed,
157
+
158
+ /**
159
+ * Called after a key up event is detected.
160
+ */
161
+ onKeyUp?: ?(event: KeyEvent) => mixed,
162
+
163
+ /**
164
+ * Array of keys to receive key down events for
165
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
166
+ */
167
+ validKeysDown?: ?Array<string>,
168
+
169
+ /**
170
+ * Array of keys to receive key up events for
171
+ * For arrow keys, add "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown",
172
+ */
173
+ validKeysUp?: ?Array<string>,
174
+ // ]TODO(macOS GH#774)
175
+
137
176
  /**
138
177
  * Either view styles or a function that receives a boolean reflecting whether
139
178
  * the component is currently pressed and returns view styles.
@@ -200,6 +239,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
200
239
  onPress,
201
240
  onPressIn,
202
241
  onPressOut,
242
+ // [TODO(macOS GH#774)
243
+ onFocus,
244
+ onBlur,
245
+ onKeyDown,
246
+ onKeyUp,
247
+ // ]TODO(macOS GH#774)
203
248
  pressRetentionOffset,
204
249
  style,
205
250
  testOnly_pressed,
@@ -266,6 +311,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
266
311
  onPressOut(event);
267
312
  }
268
313
  },
314
+ // [TODO(macOS GH#774)
315
+ onFocus,
316
+ onBlur,
317
+ onKeyDown,
318
+ onKeyUp,
319
+ // ]TODO(macOS GH#774)
269
320
  }),
270
321
  [
271
322
  android_disableSound,
@@ -282,6 +333,12 @@ function Pressable(props: Props, forwardedRef): React.Node {
282
333
  onPress,
283
334
  onPressIn,
284
335
  onPressOut,
336
+ // [TODO(macOS GH#774)
337
+ onFocus,
338
+ onBlur,
339
+ onKeyDown,
340
+ onKeyUp,
341
+ // ]TODO(macOS GH#774)
285
342
  pressRetentionOffset,
286
343
  setPressed,
287
344
  unstable_pressDelay,
@@ -151,40 +151,29 @@ class TouchableBounce extends React.Component<Props, State> {
151
151
  accessibilityLiveRegion={this.props.accessibilityLiveRegion}
152
152
  accessibilityViewIsModal={this.props.accessibilityViewIsModal}
153
153
  accessibilityElementsHidden={this.props.accessibilityElementsHidden}
154
+ nativeID={this.props.nativeID}
155
+ testID={this.props.testID}
156
+ hitSlop={this.props.hitSlop}
157
+ // [TODO(macOS GH#774)
154
158
  acceptsFirstMouse={
155
159
  this.props.acceptsFirstMouse !== false && !this.props.disabled
156
- } // TODO(macOS GH#774)
160
+ }
157
161
  enableFocusRing={
158
162
  (this.props.enableFocusRing === undefined ||
159
163
  this.props.enableFocusRing === true) &&
160
164
  !this.props.disabled
161
- } // TODO(macOS/win GH#774)
162
- nativeID={this.props.nativeID}
163
- testID={this.props.testID}
164
- hitSlop={this.props.hitSlop}
165
- // [macOS #656 We need to reconcile between focusable and acceptsKeyboardFocus
166
- // (e.g. if one is explicitly disabled, we shouldn't implicitly enable the
167
- // other on the underlying view). Prefer passing acceptsKeyboardFocus if
168
- // passed explicitly to preserve original behavior, and trigger view warnings.
169
- {...(this.props.acceptsKeyboardFocus !== undefined
170
- ? {
171
- acceptsKeyboardFocus:
172
- this.props.acceptsKeyboardFocus === true &&
173
- !this.props.disabled,
174
- }
175
- : {
176
- focusable: this.props.focusable !== false && !this.props.disabled,
177
- })}
178
- // macOS]
179
- tooltip={this.props.tooltip} // TODO(macOS/win GH#774)
180
- onMouseEnter={this.props.onMouseEnter} // [TODO(macOS GH#774)
165
+ }
166
+ focusable={this.props.focusable !== false && !this.props.disabled}
167
+ tooltip={this.props.tooltip}
168
+ onMouseEnter={this.props.onMouseEnter}
181
169
  onMouseLeave={this.props.onMouseLeave}
182
170
  onDragEnter={this.props.onDragEnter}
183
171
  onDragLeave={this.props.onDragLeave}
184
172
  onDrop={this.props.onDrop}
185
173
  onFocus={this.props.onFocus}
186
174
  onBlur={this.props.onBlur}
187
- draggedTypes={this.props.draggedTypes} // ]TODO(macOS GH#774)
175
+ draggedTypes={this.props.draggedTypes}
176
+ // ]TODO(macOS GH#774)
188
177
  ref={this.props.hostRef}
189
178
  {...eventHandlersWithoutBlurAndFocus}>
190
179
  {this.props.children}
@@ -283,8 +283,8 @@ class TouchableHighlight extends React.Component<Props, State> {
283
283
  const {
284
284
  onBlur,
285
285
  onFocus,
286
- onMouseEnter, // [TODO(macOS/win GH#774)
287
- onMouseLeave, // ]TODO(macOS/win GH#774)
286
+ onMouseEnter, // [TODO(macOS GH#774)
287
+ onMouseLeave, // ]TODO(macOS GH#774)
288
288
  ...eventHandlersWithoutBlurAndFocus
289
289
  } = this.state.pressability.getEventHandlers();
290
290
 
@@ -300,7 +300,7 @@ class TouchableHighlight extends React.Component<Props, State> {
300
300
  <View
301
301
  accessible={this.props.accessible !== false}
302
302
  accessibilityLabel={this.props.accessibilityLabel}
303
- accessibilityHint={this.props.accessibilityHint} // TODO(OSS Candidate ISS#2710739)
303
+ accessibilityHint={this.props.accessibilityHint}
304
304
  accessibilityRole={this.props.accessibilityRole}
305
305
  accessibilityState={accessibilityState}
306
306
  accessibilityValue={this.props.accessibilityValue}
@@ -310,14 +310,6 @@ class TouchableHighlight extends React.Component<Props, State> {
310
310
  accessibilityLiveRegion={this.props.accessibilityLiveRegion}
311
311
  accessibilityViewIsModal={this.props.accessibilityViewIsModal}
312
312
  accessibilityElementsHidden={this.props.accessibilityElementsHidden}
313
- acceptsFirstMouse={
314
- this.props.acceptsFirstMouse !== false && !this.props.disabled
315
- } // TODO(macOS GH#774)
316
- enableFocusRing={
317
- (this.props.enableFocusRing === undefined ||
318
- this.props.enableFocusRing === true) &&
319
- !this.props.disabled
320
- } // TODO(macOS/win GH#774)
321
313
  style={StyleSheet.compose(
322
314
  this.props.style,
323
315
  this.state.extraStyles?.underlay,
@@ -330,31 +322,28 @@ class TouchableHighlight extends React.Component<Props, State> {
330
322
  nextFocusLeft={this.props.nextFocusLeft}
331
323
  nextFocusRight={this.props.nextFocusRight}
332
324
  nextFocusUp={this.props.nextFocusUp}
333
- // [macOS #656 We need to reconcile between focusable and acceptsKeyboardFocus
334
- // (e.g. if one is explicitly disabled, we shouldn't implicitly enable the
335
- // other on the underlying view). Prefer passing acceptsKeyboardFocus if
336
- // passed explicitly to preserve original behavior, and trigger view warnings.
337
- {...(this.props.acceptsKeyboardFocus !== undefined
338
- ? {
339
- acceptsKeyboardFocus:
340
- this.props.acceptsKeyboardFocus === true &&
341
- !this.props.disabled,
342
- }
343
- : {
344
- focusable: this.props.focusable !== false && !this.props.disabled,
345
- })}
346
- // macOS]
347
- tooltip={this.props.tooltip} // TODO(macOS/win GH#774)
348
- onMouseEnter={this.props.onMouseEnter} // [TODO(macOS/win GH#774)
325
+ nativeID={this.props.nativeID}
326
+ testID={this.props.testID}
327
+ // [TODO(macOS GH#774)
328
+ acceptsFirstMouse={
329
+ this.props.acceptsFirstMouse !== false && !this.props.disabled
330
+ }
331
+ enableFocusRing={
332
+ (this.props.enableFocusRing === undefined ||
333
+ this.props.enableFocusRing === true) &&
334
+ !this.props.disabled
335
+ }
336
+ focusable={this.props.focusable !== false && !this.props.disabled}
337
+ tooltip={this.props.tooltip}
338
+ onMouseEnter={this.props.onMouseEnter}
349
339
  onMouseLeave={this.props.onMouseLeave}
350
340
  onDragEnter={this.props.onDragEnter}
351
341
  onDragLeave={this.props.onDragLeave}
352
342
  onDrop={this.props.onDrop}
353
343
  onFocus={this.props.onFocus}
354
344
  onBlur={this.props.onBlur}
355
- draggedTypes={this.props.draggedTypes} // ]TODO(macOS/win GH#774)
356
- nativeID={this.props.nativeID}
357
- testID={this.props.testID}
345
+ draggedTypes={this.props.draggedTypes}
346
+ // ]TODO(macOS/win GH#774)
358
347
  ref={this.props.hostRef}
359
348
  {...eventHandlersWithoutBlurAndFocus}>
360
349
  {React.cloneElement(child, {
@@ -266,14 +266,6 @@ class TouchableOpacity extends React.Component<Props, State> {
266
266
  accessibilityLiveRegion={this.props.accessibilityLiveRegion}
267
267
  accessibilityViewIsModal={this.props.accessibilityViewIsModal}
268
268
  accessibilityElementsHidden={this.props.accessibilityElementsHidden}
269
- acceptsFirstMouse={
270
- this.props.acceptsFirstMouse !== false && !this.props.disabled
271
- } // TODO(macOS GH#774)
272
- enableFocusRing={
273
- (this.props.enableFocusRing === undefined ||
274
- this.props.enableFocusRing === true) &&
275
- !this.props.disabled
276
- } // TODO(macOS GH#774)
277
269
  style={[this.props.style, {opacity: this.state.anim}]}
278
270
  nativeID={this.props.nativeID}
279
271
  testID={this.props.testID}
@@ -285,33 +277,26 @@ class TouchableOpacity extends React.Component<Props, State> {
285
277
  nextFocusUp={this.props.nextFocusUp}
286
278
  hasTVPreferredFocus={this.props.hasTVPreferredFocus}
287
279
  hitSlop={this.props.hitSlop}
288
- // [macOS #656 We need to reconcile between focusable and acceptsKeyboardFocus
289
- // (e.g. if one is explicitly disabled, we shouldn't implicitly enable the
290
- // other on the underlying view). Prefer passing acceptsKeyboardFocus if
291
- // passed explicitly to preserve original behavior, and trigger view warnings.
292
- {...(this.props.acceptsKeyboardFocus !== undefined
293
- ? {
294
- acceptsKeyboardFocus:
295
- this.props.acceptsKeyboardFocus === true &&
296
- !this.props.disabled,
297
- }
298
- : {
299
- focusable: this.props.focusable !== false && !this.props.disabled,
300
- })}
301
- // macOS]
302
- tooltip={this.props.tooltip} // TODO(macOS/win GH#774)
303
- onMouseEnter={this.props.onMouseEnter} // [TODO(macOS GH#774)
280
+ // [TODO(macOS GH#774)
281
+ acceptsFirstMouse={
282
+ this.props.acceptsFirstMouse !== false && !this.props.disabled
283
+ }
284
+ enableFocusRing={
285
+ (this.props.enableFocusRing === undefined ||
286
+ this.props.enableFocusRing === true) &&
287
+ !this.props.disabled
288
+ }
289
+ focusable={this.props.focusable !== false && !this.props.disabled}
290
+ tooltip={this.props.tooltip}
291
+ onMouseEnter={this.props.onMouseEnter}
304
292
  onMouseLeave={this.props.onMouseLeave}
305
293
  onDragEnter={this.props.onDragEnter}
306
294
  onDragLeave={this.props.onDragLeave}
307
295
  onDrop={this.props.onDrop}
308
296
  onFocus={this.props.onFocus}
309
297
  onBlur={this.props.onBlur}
310
- onKeyDown={this.props.onKeyDown}
311
- onKeyUp={this.props.onKeyUp}
312
- validKeysDown={this.props.validKeysDown}
313
- validKeysUp={this.props.validKeysUp}
314
- draggedTypes={this.props.draggedTypes} // ]TODO(macOS GH#774)
298
+ draggedTypes={this.props.draggedTypes}
299
+ // ]TODO(macOS/win GH#774)
315
300
  ref={this.props.hostRef}
316
301
  {...eventHandlersWithoutBlurAndFocus}>
317
302
  {this.props.children}
@@ -68,8 +68,8 @@ type Props = $ReadOnly<{|
68
68
  onPress?: ?(event: PressEvent) => mixed,
69
69
  onPressIn?: ?(event: PressEvent) => mixed,
70
70
  onPressOut?: ?(event: PressEvent) => mixed,
71
- acceptsFirstMouse?: ?boolean, // [TODO(macOS GH#774)
72
- acceptsKeyboardFocus?: ?boolean,
71
+ // [TODO(macOS GH#774)
72
+ acceptsFirstMouse?: ?boolean,
73
73
  enableFocusRing?: ?boolean,
74
74
  tooltip?: ?string,
75
75
  onMouseEnter?: (event: MouseEvent) => void,
@@ -77,7 +77,8 @@ type Props = $ReadOnly<{|
77
77
  onDragEnter?: (event: MouseEvent) => void,
78
78
  onDragLeave?: (event: MouseEvent) => void,
79
79
  onDrop?: (event: MouseEvent) => void,
80
- draggedTypes?: ?DraggedTypesType, // ]TODO(macOS GH#774)
80
+ draggedTypes?: ?DraggedTypesType,
81
+ // ]TODO(macOS GH#774)
81
82
  pressRetentionOffset?: ?EdgeInsetsProp,
82
83
  rejectResponderTermination?: ?boolean,
83
84
  testID?: ?string,
@@ -157,23 +158,12 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
157
158
  : this.props.accessibilityState,
158
159
  focusable:
159
160
  this.props.focusable !== false && this.props.onPress !== undefined,
161
+ // [TODO(macOS GH#774)
160
162
  acceptsFirstMouse:
161
- this.props.acceptsFirstMouse !== false && !this.props.disabled, // [TODO(macOS GH#774)
162
- // [macOS #656 We need to reconcile between focusable and acceptsKeyboardFocus
163
- // (e.g. if one is explicitly disabled, we shouldn't implicitly enable the
164
- // other on the underlying view). Prefer passing acceptsKeyboardFocus if
165
- // passed explicitly to preserve original behavior, and trigger view warnings.
166
- ...(this.props.acceptsKeyboardFocus !== undefined
167
- ? {
168
- acceptsKeyboardFocus:
169
- this.props.acceptsKeyboardFocus === true && !this.props.disabled,
170
- }
171
- : {
172
- focusable: this.props.focusable !== false && !this.props.disabled,
173
- }),
174
- // macOS]
163
+ this.props.acceptsFirstMouse !== false && !this.props.disabled,
175
164
  enableFocusRing:
176
- this.props.enableFocusRing !== false && !this.props.disabled, // ]TODO(macOS GH#774)
165
+ this.props.enableFocusRing !== false && !this.props.disabled,
166
+ // ]TODO(macOS GH#774)
177
167
  };
178
168
  for (const prop of PASSTHROUGH_PROPS) {
179
169
  if (this.props[prop] !== undefined) {
@@ -21,9 +21,6 @@ const UIView = {
21
21
  accessibilityState: true,
22
22
  accessibilityValue: true,
23
23
  accessibilityHint: true,
24
- acceptsFirstMouse: true, // TODO(macOS GH#774)
25
- acceptsKeyboardFocus: true, // TODO(macOS GH#774)
26
- enableFocusRing: true, // TODO(macOS GH#774)
27
24
  importantForAccessibility: true,
28
25
  nativeID: true,
29
26
  testID: true,
@@ -36,7 +33,11 @@ const UIView = {
36
33
  onAccessibilityEscape: true,
37
34
  collapsable: true,
38
35
  needsOffscreenAlphaCompositing: true,
39
- onMouseEnter: true, // [TODO(macOS GH#774)
36
+ style: ReactNativeStyleAttributes,
37
+ // [TODO(macOS GH#774)
38
+ acceptsFirstMouse: true,
39
+ enableFocusRing: true,
40
+ onMouseEnter: true,
40
41
  onMouseLeave: true,
41
42
  onDragEnter: true,
42
43
  onDragLeave: true,
@@ -45,9 +46,9 @@ const UIView = {
45
46
  onKeyUp: true,
46
47
  validKeysDown: true,
47
48
  validKeysUp: true,
48
- draggedTypes: true, // ]TODO(macOS GH#774)
49
- nextKeyViewTag: true, // TODO(macOS GH#768)
50
- style: ReactNativeStyleAttributes,
49
+ draggedTypes: true,
50
+ nextKeyViewTag: true,
51
+ // ]TODO(macOS GH#774)
51
52
  };
52
53
 
53
54
  const RCTView = {
@@ -36,7 +36,6 @@ const ReactNativeViewViewConfigMacOS = {
36
36
  },
37
37
  validAttributes: {
38
38
  acceptsFirstMouse: true,
39
- acceptsKeyboardFocus: true,
40
39
  accessibilityTraits: true,
41
40
  draggedTypes: true,
42
41
  enableFocusRing: true,
@@ -51,7 +50,7 @@ const ReactNativeViewViewConfigMacOS = {
51
50
  onKeyUp: true,
52
51
  validKeysDown: true,
53
52
  validKeysUp: true,
54
- nextKeyViewTag: true, // TODO(macOS GH#768)
53
+ nextKeyViewTag: true,
55
54
  onMouseEnter: true,
56
55
  onMouseLeave: true,
57
56
  tooltip: true,
@@ -12,8 +12,8 @@ import type {ViewProps} from './ViewPropTypes';
12
12
 
13
13
  import ViewNativeComponent from './ViewNativeComponent';
14
14
  import TextAncestor from '../../Text/TextAncestor';
15
- import warnOnce from '../../Utilities/warnOnce'; // [macOS #656]
16
15
  import * as React from 'react';
16
+ import invariant from 'invariant'; // TODO(macOS GH#774)
17
17
 
18
18
  export type Props = ViewProps;
19
19
 
@@ -28,15 +28,13 @@ const View: React.AbstractComponent<
28
28
  ViewProps,
29
29
  React.ElementRef<typeof ViewNativeComponent>,
30
30
  > = React.forwardRef((props: ViewProps, forwardedRef) => {
31
- // [macOS #656 Intercept props to warn about them going away
32
- if (props.acceptsKeyboardFocus !== undefined) {
33
- warnOnce(
34
- 'deprecated-acceptsKeyboardFocus',
35
- '"acceptsKeyboardFocus" has been deprecated in favor of "focusable" and will be removed in a future version of react-native-macos',
36
- );
37
- }
38
- // macOS]
39
-
31
+ // [TODO(macOS GH#774)
32
+ invariant(
33
+ // $FlowFixMe Wanting to catch untyped usages
34
+ props.acceptsKeyboardFocus === undefined,
35
+ 'Support for the "acceptsKeyboardFocus" property has been removed in favor of "focusable"',
36
+ );
37
+ // TODO(macOS GH#774)]
40
38
  return (
41
39
  <TextAncestor.Provider value={false}>
42
40
  <ViewNativeComponent {...props} ref={forwardedRef} />
@@ -49,7 +49,6 @@ export type AccessibilityRole =
49
49
  | 'timer'
50
50
  | 'list'
51
51
  | 'toolbar'
52
- | 'popupbutton'
53
52
  | 'menubutton'; // TODO(macOS GH#774)
54
53
 
55
54
  // the info associated with an accessibility action
@@ -77,7 +77,7 @@ type DirectEventProps = $ReadOnly<{|
77
77
  onPreferredScrollerStyleDidChange?: ?(event: ScrollEvent) => mixed, // TODO(macOS GH#774)
78
78
 
79
79
  /**
80
- * When `acceptsKeyboardFocus` is true, the system will try to invoke this function
80
+ * When `focusable` is true, the system will try to invoke this function
81
81
  * when the user performs accessibility key down gesture.
82
82
  */
83
83
  onScrollKeyDown?: ?(event: ScrollEvent) => mixed, // TODO(macOS GH#774)
@@ -594,12 +594,6 @@ export type ViewProps = $ReadOnly<{|
594
594
  */
595
595
  acceptsFirstMouse?: ?boolean, // TODO(macOS GH#774)
596
596
 
597
- /**
598
- * Specifies whether the view participates in the key view loop as user tabs
599
- * through different controls.
600
- */
601
- acceptsKeyboardFocus?: ?boolean, // TODO(macOS GH#774)
602
-
603
597
  /**
604
598
  * The react tag of the view that follows the current view in the key view loop.
605
599
  */
@@ -9,9 +9,13 @@
9
9
  * @flow strict
10
10
  */
11
11
 
12
+ // [TODO(macOS GH#944)
13
+ // Note: Be careful not to override these version numbers
14
+ // when we merge upstream stable branches into main
15
+ // TODO(macOS GH#944)]
12
16
  exports.version = {
13
17
  major: 0,
14
18
  minor: 0,
15
19
  patch: 0,
16
- prerelease: '793ebb8ba',
20
+ prerelease: '7ae1439d0',
17
21
  };
@@ -649,18 +649,12 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithFrame:(CGRect)frame)
649
649
 
650
650
  - (NSColor *)tintColor
651
651
  {
652
- NSColor *tintColor = nil;
653
- if (@available(macOS 10.14, *)) {
654
- tintColor = _imageView.contentTintColor;
655
- }
656
- return tintColor;
652
+ return _imageView.contentTintColor;
657
653
  }
658
654
 
659
655
  - (void)setTintColor:(NSColor *)tintColor
660
656
  {
661
- if (@available(macOS 10.14, *)) {
662
- _imageView.contentTintColor = tintColor;
663
- }
657
+ _imageView.contentTintColor = tintColor;
664
658
  }
665
659
  #endif // ]TODO(macOS GH#774)
666
660
 
@@ -320,40 +320,40 @@ export function checkWarningFilter(format: string): WarningInfo {
320
320
  return warningFilter(format);
321
321
  }
322
322
 
323
+ export function getIgnorePatterns(): $ReadOnlyArray<IgnorePattern> {
324
+ return Array.from(ignorePatterns);
325
+ }
326
+
323
327
  export function addIgnorePatterns(
324
328
  patterns: $ReadOnlyArray<IgnorePattern>,
325
329
  ): void {
330
+ const existingSize = ignorePatterns.size;
326
331
  // The same pattern may be added multiple times, but adding a new pattern
327
332
  // can be expensive so let's find only the ones that are new.
328
- const newPatterns = patterns.filter((pattern: IgnorePattern) => {
333
+ patterns.forEach((pattern: IgnorePattern) => {
329
334
  if (pattern instanceof RegExp) {
330
- for (const existingPattern of ignorePatterns.entries()) {
335
+ for (const existingPattern of ignorePatterns) {
331
336
  if (
332
337
  existingPattern instanceof RegExp &&
333
338
  existingPattern.toString() === pattern.toString()
334
339
  ) {
335
- return false;
340
+ return;
336
341
  }
337
342
  }
338
- return true;
343
+ ignorePatterns.add(pattern);
339
344
  }
340
- return !ignorePatterns.has(pattern);
345
+ ignorePatterns.add(pattern);
341
346
  });
342
-
343
- if (newPatterns.length === 0) {
347
+ if (ignorePatterns.size === existingSize) {
344
348
  return;
345
349
  }
346
- for (const pattern of newPatterns) {
347
- ignorePatterns.add(pattern);
348
-
349
- // We need to recheck all of the existing logs.
350
- // This allows adding an ignore pattern anywhere in the codebase.
351
- // Without this, if you ignore a pattern after the a log is created,
352
- // then we would keep showing the log.
353
- logs = new Set(
354
- Array.from(logs).filter(log => !isMessageIgnored(log.message.content)),
355
- );
356
- }
350
+ // We need to recheck all of the existing logs.
351
+ // This allows adding an ignore pattern anywhere in the codebase.
352
+ // Without this, if you ignore a pattern after the a log is created,
353
+ // then we would keep showing the log.
354
+ logs = new Set(
355
+ Array.from(logs).filter(log => !isMessageIgnored(log.message.content)),
356
+ );
357
357
  handleUpdate();
358
358
  }
359
359