react-native-macos 0.63.38 → 0.63.42

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.
@@ -165,6 +165,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
165
165
  delayLongPress,
166
166
  disabled,
167
167
  focusable,
168
+ onMouseEnter, // [TODO(macOS GH#774)
169
+ onMouseLeave, // ]TODO(macOS GH#774)
168
170
  onLongPress,
169
171
  onPress,
170
172
  onPressIn,
@@ -191,6 +193,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
191
193
  pressRectOffset: pressRetentionOffset,
192
194
  android_disableSound,
193
195
  delayLongPress,
196
+ onHoverIn: onMouseEnter, // [TODO(macOS GH#774)
197
+ onHoverOut: onMouseLeave, // ]TODO(macOS GH#774)
194
198
  onLongPress,
195
199
  onPress,
196
200
  onPressIn(event: PressEvent): void {
@@ -219,6 +223,8 @@ function Pressable(props: Props, forwardedRef): React.Node {
219
223
  delayLongPress,
220
224
  disabled,
221
225
  hitSlop,
226
+ onMouseEnter, // [TODO(macOS GH#774)
227
+ onMouseLeave, // ]TODO(macOS GH#774)
222
228
  onLongPress,
223
229
  onPress,
224
230
  onPressIn,
@@ -235,9 +241,9 @@ function Pressable(props: Props, forwardedRef): React.Node {
235
241
  {...eventHandlers}
236
242
  {...android_rippleConfig?.viewProps}
237
243
  acceptsFirstMouse={acceptsFirstMouse !== false && !disabled} // [TODO(macOS ISS#2323203)
238
- enableFocusRing={enableFocusRing !== false && !disabled} // ]TODO(macOS ISS#2323203)
244
+ enableFocusRing={enableFocusRing !== false && !disabled}
239
245
  accessible={accessible !== false}
240
- focusable={focusable !== false}
246
+ focusable={focusable !== false && !disabled} // ]TODO(macOS ISS#2323203)
241
247
  hitSlop={hitSlop}
242
248
  ref={viewRef}
243
249
  style={typeof style === 'function' ? style({pressed}) : style}>
@@ -182,10 +182,7 @@ class TouchableBounce extends React.Component<Props, State> {
182
182
  !this.props.disabled,
183
183
  }
184
184
  : {
185
- focusable:
186
- this.props.focusable !== false &&
187
- this.props.onPress !== undefined &&
188
- !this.props.disabled,
185
+ focusable: this.props.focusable !== false && !this.props.disabled,
189
186
  })}
190
187
  // macOS]
191
188
  tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203)
@@ -338,9 +338,7 @@ class TouchableHighlight extends React.Component<Props, State> {
338
338
  !this.props.disabled,
339
339
  }
340
340
  : {
341
- focusable:
342
- this.props.focusable !== false &&
343
- this.props.onPress !== undefined,
341
+ focusable: this.props.focusable !== false && !this.props.disabled,
344
342
  })}
345
343
  // macOS]
346
344
  tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203)
@@ -289,9 +289,7 @@ class TouchableOpacity extends React.Component<Props, State> {
289
289
  !this.props.disabled,
290
290
  }
291
291
  : {
292
- focusable:
293
- this.props.focusable !== false &&
294
- this.props.onPress !== undefined,
292
+ focusable: this.props.focusable !== false && !this.props.disabled,
295
293
  })}
296
294
  // macOS]
297
295
  tooltip={this.props.tooltip} // TODO(macOS/win ISS#2323203)
@@ -169,9 +169,7 @@ class TouchableWithoutFeedback extends React.Component<Props, State> {
169
169
  this.props.acceptsKeyboardFocus === true && !this.props.disabled,
170
170
  }
171
171
  : {
172
- focusable:
173
- this.props.focusable !== false &&
174
- this.props.onPress !== undefined,
172
+ focusable: this.props.focusable !== false && !this.props.disabled,
175
173
  }),
176
174
  // macOS]
177
175
  enableFocusRing:
@@ -96,6 +96,15 @@
96
96
 
97
97
  - (void)invalidate
98
98
  {
99
+ // [TODO: GH#858
100
+ // ensure observer callbacks do not hold a reference to weak self via pauseCallback
101
+ for (RCTModuleData *moduleData in _frameUpdateObservers) {
102
+ id<RCTFrameUpdateObserver> observer = (id<RCTFrameUpdateObserver>)moduleData.instance;
103
+ [observer setPauseCallback:nil];
104
+ }
105
+ [_frameUpdateObservers removeAllObjects]; // just to be explicit
106
+ // TODO: GH#858]
107
+
99
108
  [_jsDisplayLink invalidate];
100
109
  }
101
110
 
@@ -146,9 +155,7 @@
146
155
  BOOL pauseDisplayLink = YES;
147
156
  for (RCTModuleData *moduleData in _frameUpdateObservers) {
148
157
  id<RCTFrameUpdateObserver> observer = (id<RCTFrameUpdateObserver>)moduleData.instance;
149
- BOOL validObserverProtocol = [observer conformsToProtocol:@protocol(RCTFrameUpdateObserver)]; // [TODO: GH#774- add protocol check before accessing data
150
- RCTAssert(validObserverProtocol, @"Observer does not conform to necessary protocol (RCTFrameUpdateObserver)");
151
- if (validObserverProtocol && !observer.paused) { // TODO: GH#774- add protocol check before accessing data]
158
+ if (!observer.paused) {
152
159
  pauseDisplayLink = NO;
153
160
  break;
154
161
  }
@@ -65,6 +65,7 @@ static CVReturn RCTPlatformDisplayLinkCallBack(__unused CVDisplayLinkRef display
65
65
  if (_displayLink != NULL) {
66
66
  CVDisplayLinkStop(_displayLink);
67
67
  CVDisplayLinkRelease(_displayLink);
68
+ _displayLink = NULL;
68
69
  }
69
70
  }
70
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.63.38",
3
+ "version": "0.63.42",
4
4
  "bin": "./cli.js",
5
5
  "description": "[Microsoft Fork] A framework for building native apps using React",
6
6
  "license": "MIT",