react-native-macos 0.0.0-278d1b69d → 0.0.0-291c44ded
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.
- package/Libraries/Components/Touchable/TouchableBounce.js +11 -22
- package/Libraries/Components/Touchable/TouchableHighlight.js +19 -30
- package/Libraries/Components/Touchable/TouchableOpacity.js +14 -29
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +8 -18
- package/Libraries/Components/View/ReactNativeViewAttributes.js +8 -7
- package/Libraries/Components/View/ReactNativeViewViewConfigMacOS.js +1 -2
- package/Libraries/Components/View/View.js +8 -10
- package/Libraries/Components/View/ViewPropTypes.js +1 -7
- package/Libraries/Core/ReactNativeVersion.js +5 -1
- package/README.md +14 -39
- package/React/Base/RCTBridgeModule.h +1 -1
- package/React/Base/RCTVersion.m +5 -1
- package/React/CoreModules/RCTAlertController.m +8 -4
- package/React/Views/RCTViewManager.m +0 -6
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +5 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +5 -1
- package/package.json +2 -2
- package/template/package.json +3 -1
|
@@ -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
|
-
}
|
|
160
|
+
}
|
|
157
161
|
enableFocusRing={
|
|
158
162
|
(this.props.enableFocusRing === undefined ||
|
|
159
163
|
this.props.enableFocusRing === true) &&
|
|
160
164
|
!this.props.disabled
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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}
|
|
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
|
|
287
|
-
onMouseLeave, // ]TODO(macOS
|
|
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}
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
//
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
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}
|
|
356
|
-
|
|
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 #
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
{
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
|
|
311
|
-
|
|
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
|
-
|
|
72
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
49
|
-
nextKeyViewTag: true,
|
|
50
|
-
|
|
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,
|
|
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 #
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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} />
|
|
@@ -77,7 +77,7 @@ type DirectEventProps = $ReadOnly<{|
|
|
|
77
77
|
onPreferredScrollerStyleDidChange?: ?(event: ScrollEvent) => mixed, // TODO(macOS GH#774)
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* When `
|
|
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: '
|
|
20
|
+
prerelease: '291c44ded',
|
|
17
21
|
};
|
package/README.md
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
</a>
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
> See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.
|
|
19
|
+
> See the official [React Native website](https://reactnative.dev/) for an introduction to React Native.
|
|
20
20
|
|
|
21
21
|
[React Native](https://reactnative.dev) is a framework developed by Facebook that enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and [React](https://reactjs.org/). The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere.
|
|
22
22
|
|
|
23
|
-
This repository is a working fork of **facebook/react-native** that adds support for the official React Native for macOS implementation from Microsoft.
|
|
23
|
+
This repository is a working fork of **facebook/react-native** that adds support for the official React Native for macOS implementation from Microsoft.
|
|
24
24
|
|
|
25
25
|
[hello-world]: https://snack.expo.io/@hramos/hello,-world!
|
|
26
26
|
[new-app]: https://reactnative.dev/docs/getting-started
|
|
@@ -28,38 +28,6 @@ This repository is a working fork of **facebook/react-native** that adds support
|
|
|
28
28
|
|
|
29
29
|
You can read more about the macOS implementation in our website - [React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/)
|
|
30
30
|
|
|
31
|
-
The full documentation for React Native can be found on our [website][docs].
|
|
32
|
-
|
|
33
|
-
The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
|
|
34
|
-
|
|
35
|
-
The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
|
|
36
|
-
|
|
37
|
-
[docs]: https://reactnative.dev/docs/getting-started
|
|
38
|
-
[r-docs]: https://reactjs.org/docs/getting-started.html
|
|
39
|
-
[repo-website]: https://github.com/facebook/react-native-website
|
|
40
|
-
|
|
41
|
-
## 🚀 Upgrading
|
|
42
|
-
|
|
43
|
-
Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the [Upgrading Guide][u] for instructions.
|
|
44
|
-
|
|
45
|
-
React Native releases are discussed in the React Native Community, [**@react-native-community/react-native-releases**][repo-releases].
|
|
46
|
-
|
|
47
|
-
[u]: https://reactnative.dev/docs/upgrading
|
|
48
|
-
[repo-releases]: https://github.com/react-native-community/react-native-releases
|
|
49
|
-
|
|
50
|
-
## 👏 How to Contribute
|
|
51
|
-
|
|
52
|
-
You can read more about the macOS implementation on our website - [React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/)
|
|
53
|
-
|
|
54
|
-
## Contents
|
|
55
|
-
|
|
56
|
-
- [Requirements](#requirements)
|
|
57
|
-
- [Getting Started](#getting-started)
|
|
58
|
-
- [Contributing](#contributing)
|
|
59
|
-
- [Documentation](#documentation)
|
|
60
|
-
- [License](#license)
|
|
61
|
-
- [Code of Conduct](#code-of-conduct)
|
|
62
|
-
|
|
63
31
|
## Requirements
|
|
64
32
|
|
|
65
33
|
You can run React Native for macOS apps on Mac devices with versions Catalina (10.15) or newer.
|
|
@@ -67,25 +35,31 @@ You can run React Native for macOS apps on Mac devices with versions Catalina (1
|
|
|
67
35
|
For a full and detailed list of the system requirements and how to set up your development platform, see our [System Requirements](https://microsoft.github.io/react-native-windows/docs/rnm-dependencies) documentation on our website.
|
|
68
36
|
|
|
69
37
|
## Getting Started
|
|
38
|
+
|
|
70
39
|
See the [Getting Started Guide](https://microsoft.github.io/react-native-windows/docs/rnm-getting-started) on our React Native for Windows + macOS website to build your first React Native for macOS app.
|
|
71
40
|
|
|
72
41
|
### Logging Issues
|
|
42
|
+
|
|
73
43
|
Search the [existing issues](https://github.com/microsoft/react-native-macos/issues) and try to make sure your problem doesn’t already exist before opening a new issue. If your issue doesn't exist yet, try to make sure you provide as much information as possible to us so we can help you sooner. It’s helpful if you include information like:
|
|
74
44
|
|
|
75
45
|
- The version of macOS, React Native, React Native macOS extension where you ran into the issue.
|
|
76
46
|
- A stack trace and reduced repro case when possible.
|
|
77
47
|
- Ensure the [appropriate template](https://github.com/microsoft/react-native-macos/issues/new/choose) is used when filing your issue(s).
|
|
78
48
|
|
|
79
|
-
##
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
80
51
|
See [Contributing guidelines](https://github.com/microsoft/react-native-macos/blob/master/CONTRIBUTING.md) for how to set up your fork of the repo and start a PR to contribute to React Native for macOS.
|
|
81
52
|
|
|
82
53
|
[Good First Issue](https://github.com/microsoft/react-native-macos/labels/good%20first%20issue) and [help wanted](https://github.com/microsoft/react-native-macos/labels/help%20wanted) are great starting points for PRs.
|
|
83
54
|
|
|
84
55
|
## Documentation
|
|
85
|
-
|
|
56
|
+
|
|
57
|
+
The full documentation for React Native can be found on the [documentation website][docs]. The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs].
|
|
58
|
+
|
|
59
|
+
The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website].
|
|
86
60
|
|
|
87
61
|
[React Native for Windows + macOS](https://microsoft.github.io/react-native-windows/) has its own separate documentation site where Windows and macOS
|
|
88
|
-
specific information, like API docs and blog updates live. We are
|
|
62
|
+
specific information, like API docs and blog updates live. We are still working on the documentation for macOS, contributions are welcome!
|
|
89
63
|
|
|
90
64
|
### Examples
|
|
91
65
|
|
|
@@ -100,5 +74,6 @@ The React Native for macOS extension, including modifications to the original Fa
|
|
|
100
74
|
|
|
101
75
|
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
102
76
|
|
|
103
|
-
[
|
|
104
|
-
[
|
|
77
|
+
[docs]: https://reactnative.dev/docs/getting-started
|
|
78
|
+
[r-docs]: https://reactjs.org/docs/getting-started.html
|
|
79
|
+
[repo-website]: https://github.com/facebook/react-native-website
|
|
@@ -441,7 +441,7 @@ typedef NSURL * (^RCTBridgelessBundleURLGetter)(void);
|
|
|
441
441
|
andSetter:(RCTBridgelessBundleURLSetter)setter
|
|
442
442
|
andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter;
|
|
443
443
|
- (void)resetBundleURL;
|
|
444
|
-
@property NSURL *bundleURL;
|
|
444
|
+
@property (strong) NSURL *bundleURL; // TODO(macOS GH#774)
|
|
445
445
|
@end
|
|
446
446
|
|
|
447
447
|
typedef RCTPlatformView * (^RCTBridgelessComponentViewProvider)(NSNumber *); // TODO(macOS GH#774)
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -15,6 +15,10 @@ NSString* const RCTVersionPatch = @"patch";
|
|
|
15
15
|
NSString* const RCTVersionPrerelease = @"prerelease";
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
// [TODO(macOS GH#944)
|
|
19
|
+
// Note: Be careful not to override these version numbers
|
|
20
|
+
// when we merge upstream stable branches into main
|
|
21
|
+
// TODO(macOS GH#944)]
|
|
18
22
|
NSDictionary* RCTGetReactNativeVersion(void)
|
|
19
23
|
{
|
|
20
24
|
static NSDictionary* __rnVersion;
|
|
@@ -24,7 +28,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
24
28
|
RCTVersionMajor: @(0),
|
|
25
29
|
RCTVersionMinor: @(0),
|
|
26
30
|
RCTVersionPatch: @(0),
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
31
|
+
RCTVersionPrerelease: @"291c44ded",
|
|
28
32
|
};
|
|
29
33
|
});
|
|
30
34
|
return __rnVersion;
|
|
@@ -32,12 +32,16 @@
|
|
|
32
32
|
|
|
33
33
|
- (void)show:(BOOL)animated completion:(void (^)(void))completion
|
|
34
34
|
{
|
|
35
|
-
[self.alertWindow makeKeyAndVisible];
|
|
36
|
-
|
|
37
35
|
// [TODO(macOS GH#774)
|
|
36
|
+
// Call self.alertWindow to ensure that it gets populated
|
|
37
|
+
UIWindow *alertWindow = self.alertWindow;
|
|
38
|
+
|
|
38
39
|
// If the window is tracked by our application then it will show the alert
|
|
39
|
-
if ([[[UIApplication sharedApplication] windows] containsObject:
|
|
40
|
-
|
|
40
|
+
if ([[[UIApplication sharedApplication] windows] containsObject:alertWindow]) {
|
|
41
|
+
// On iOS 14, makeKeyAndVisible should only be called if alertWindow is tracked by the application.
|
|
42
|
+
// Later versions of iOS appear to already do this check for us behind the scenes.
|
|
43
|
+
[alertWindow makeKeyAndVisible];
|
|
44
|
+
[alertWindow.rootViewController presentViewController:self animated:animated completion:completion];
|
|
41
45
|
} else {
|
|
42
46
|
// When using Scenes, we must present the alert from a view controller associated with a window in the Scene. A fresh window (i.e. _alertWindow) cannot show the alert.
|
|
43
47
|
[RCTPresentedViewController() presentViewController:self animated:animated completion:completion];
|
|
@@ -385,12 +385,6 @@ RCT_CUSTOM_VIEW_PROPERTY(acceptsFirstMouse, BOOL, RCTView)
|
|
|
385
385
|
view.acceptsFirstMouse = json ? [RCTConvert BOOL:json] : defaultView.acceptsFirstMouse;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
RCT_CUSTOM_VIEW_PROPERTY(acceptsKeyboardFocus, BOOL, RCTView)
|
|
389
|
-
{
|
|
390
|
-
if ([view respondsToSelector:@selector(setFocusable:)]) {
|
|
391
|
-
view.focusable = json ? [RCTConvert BOOL:json] : defaultView.focusable;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
388
|
RCT_CUSTOM_VIEW_PROPERTY(focusable, BOOL, RCTView)
|
|
395
389
|
{
|
|
396
390
|
if ([view respondsToSelector:@selector(setFocusable:)]) {
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java
CHANGED
|
@@ -13,10 +13,14 @@ import com.facebook.react.common.MapBuilder;
|
|
|
13
13
|
|
|
14
14
|
import java.util.Map;
|
|
15
15
|
|
|
16
|
+
// [TODO(macOS GH#944)
|
|
17
|
+
// Note: Be careful not to override these version numbers
|
|
18
|
+
// when we merge upstream stable branches into main
|
|
19
|
+
// TODO(macOS GH#944)]
|
|
16
20
|
public class ReactNativeVersion {
|
|
17
21
|
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
|
18
22
|
"major", 0,
|
|
19
23
|
"minor", 0,
|
|
20
24
|
"patch", 0,
|
|
21
|
-
"prerelease", "
|
|
25
|
+
"prerelease", "291c44ded");
|
|
22
26
|
}
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
namespace facebook::react {
|
|
16
16
|
|
|
17
|
+
// [TODO(macOS GH#944)
|
|
18
|
+
// Note: Be careful not to override these version numbers
|
|
19
|
+
// when we merge upstream stable branches into main
|
|
20
|
+
// TODO(macOS GH#944)]
|
|
17
21
|
constexpr struct {
|
|
18
22
|
int32_t Major = 0;
|
|
19
23
|
int32_t Minor = 0;
|
|
20
24
|
int32_t Patch = 0;
|
|
21
|
-
std::string_view Prerelease = "
|
|
25
|
+
std::string_view Prerelease = "291c44ded";
|
|
22
26
|
} ReactNativeVersion;
|
|
23
27
|
|
|
24
28
|
} // namespace facebook::react
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-291c44ded",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "React Native for macOS",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": "git@github.com:microsoft/react-native-macos.git",
|
|
8
8
|
"engines": {
|
package/template/package.json
CHANGED
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"android": "react-native run-android",
|
|
7
7
|
"ios": "react-native run-ios",
|
|
8
|
+
"macos": "react-native run-macos",
|
|
8
9
|
"start": "react-native start",
|
|
9
10
|
"test": "jest",
|
|
10
11
|
"lint": "eslint ."
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"react": "17.0.2",
|
|
14
|
-
"react-native": "
|
|
15
|
+
"react-native-macos": "1000.0.0",
|
|
16
|
+
"react-native": "0.0.0-291c44ded"
|
|
15
17
|
},
|
|
16
18
|
"devDependencies": {
|
|
17
19
|
"@babel/core": "^7.12.9",
|