react-native-macos 0.81.0 → 0.81.2

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.
@@ -17,6 +17,6 @@ export const version: $ReadOnly<{
17
17
  }> = {
18
18
  major: 0,
19
19
  minor: 81,
20
- patch: 0,
20
+ patch: 2,
21
21
  prerelease: null,
22
22
  };
@@ -18,7 +18,7 @@
18
18
 
19
19
  NS_ASSUME_NONNULL_BEGIN
20
20
 
21
- @interface RCTWrappedTextView : RCTPlatformView <RCTBackedTextInputViewProtocol>
21
+ @interface RCTWrappedTextView : RCTPlatformView <RCTBackedTextInputViewProtocol, RCTBackedTextInputDelegate, NSTextViewDelegate> // [macOS]
22
22
 
23
23
  @property (nonatomic, weak) id<RCTBackedTextInputDelegate> textInputDelegate;
24
24
  @property (assign) BOOL hideVerticalScrollIndicator;
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(81),
26
- RCTVersionPatch: @(0),
26
+ RCTVersionPatch: @(2),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -465,7 +465,7 @@
465
465
  // right after the semaphore signals.
466
466
 
467
467
  // Atomic variant of `_waitingForMountingStageOnMainQueue = YES;`
468
- atomic_fetch_or(&_waitingForMountingStageOnMainQueue, 1);
468
+ atomic_store(&_waitingForMountingStageOnMainQueue, 1); // [macOS] C++23 compatibility
469
469
  }
470
470
 
471
471
  dispatch_semaphore_t semaphore;
@@ -488,7 +488,7 @@
488
488
  auto timeoutOccurred = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC));
489
489
 
490
490
  // Atomic equivalent of `_waitingForMountingStageOnMainQueue = NO;`.
491
- atomic_fetch_and(&_waitingForMountingStageOnMainQueue, 0);
491
+ atomic_store(&_waitingForMountingStageOnMainQueue, 0); // [macOS] C++23 compatibility
492
492
 
493
493
  if (!timeoutOccurred) {
494
494
  // Balancing the semaphore.
@@ -546,7 +546,7 @@
546
546
  {
547
547
  if (atomic_load(&_waitingForMountingStageOnMainQueue) && (self.stage & RCTSurfaceStageSurfaceDidInitialLayout)) {
548
548
  // Atomic equivalent of `_waitingForMountingStageOnMainQueue = NO;`.
549
- atomic_fetch_and(&_waitingForMountingStageOnMainQueue, 0);
549
+ atomic_store(&_waitingForMountingStageOnMainQueue, 0); // [macOS] C++23 compatibility
550
550
 
551
551
  {
552
552
  std::lock_guard<std::mutex> lock(_mutex);
@@ -9,6 +9,7 @@
9
9
 
10
10
  #import <objc/runtime.h>
11
11
  #import <algorithm>
12
+ #import <mutex> // [macOS]
12
13
  #import <vector>
13
14
 
14
15
  #import <React/RCTAssert.h>
@@ -8,6 +8,7 @@
8
8
  // [macOS]
9
9
 
10
10
  #import <Foundation/Foundation.h>
11
+ #import <React/RCTUIKit.h>
11
12
  #import "RCTCursor.h"
12
13
 
13
14
  #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 /* __MAC_15_0 */
@@ -442,6 +442,7 @@ RCT_CUSTOM_VIEW_PROPERTY(pointerEvents, RCTPointerEvents, RCTView)
442
442
  // Unspecified values do not.
443
443
  // This wouldn't override a container view's `userInteractionEnabled = NO`
444
444
  view.userInteractionEnabled = YES;
445
+ break; // [macOS]
445
446
  case RCTPointerEventsNone:
446
447
  view.userInteractionEnabled = NO;
447
448
  break;
@@ -318,7 +318,7 @@
318
318
  @implementation RCTScrollView {
319
319
  id<RCTEventDispatcherProtocol> _eventDispatcher;
320
320
  CGRect _prevFirstVisibleFrame;
321
- __weak RCTUIView *_firstVisibleView; // [macOS]
321
+ __weak RCTPlatformView *_firstVisibleView; // [macOS]
322
322
  RCTCustomScrollView *_scrollView;
323
323
  #if !TARGET_OS_OSX // [macOS]
324
324
  UIView *_contentView;
@@ -940,17 +940,15 @@ RCT_SCROLL_EVENT_HANDLER(scrollViewDidScrollToTop, onScrollToTop)
940
940
  _scrollView.contentInset = UIEdgeInsetsMake(top, left, top, left);
941
941
  }
942
942
 
943
- #if !TARGET_OS_OSX // [macOS]
944
- - (void)addScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener
943
+ - (void)addScrollListener:(NSObject<RCTUIScrollViewDelegate> *)scrollListener // [macOS]
945
944
  {
946
945
  [_scrollListeners addObject:scrollListener];
947
946
  }
948
947
 
949
- - (void)removeScrollListener:(NSObject<UIScrollViewDelegate> *)scrollListener
948
+ - (void)removeScrollListener:(NSObject<RCTUIScrollViewDelegate> *)scrollListener // [macOS]
950
949
  {
951
950
  [_scrollListeners removeObject:scrollListener];
952
951
  }
953
- #endif // [macOS]
954
952
 
955
953
  - (void)scrollViewDidScroll:(RCTCustomScrollView *)scrollView // [macOS]
956
954
  {
@@ -1,4 +1,4 @@
1
- VERSION_NAME=0.81.0
1
+ VERSION_NAME=0.81.2
2
2
  react.internal.publishingGroup=com.facebook.react
3
3
 
4
4
  android.useAndroidX=true
@@ -14,7 +14,7 @@ public object ReactNativeVersion {
14
14
  public val VERSION: Map<String, Any?> = mapOf(
15
15
  "major" to 0,
16
16
  "minor" to 81,
17
- "patch" to 0,
17
+ "patch" to 2,
18
18
  "prerelease" to null
19
19
  )
20
20
  }
@@ -14,14 +14,14 @@
14
14
 
15
15
  #define REACT_NATIVE_VERSION_MAJOR 0
16
16
  #define REACT_NATIVE_VERSION_MINOR 81
17
- #define REACT_NATIVE_VERSION_PATCH 0
17
+ #define REACT_NATIVE_VERSION_PATCH 2
18
18
 
19
19
  namespace facebook::react {
20
20
 
21
21
  constexpr struct {
22
22
  int32_t Major = 0;
23
23
  int32_t Minor = 81;
24
- int32_t Patch = 0;
24
+ int32_t Patch = 2;
25
25
  std::string_view Prerelease = "";
26
26
  } ReactNativeVersion;
27
27
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  #pragma once
9
9
 
10
- #include <react/renderer/graphics/Geometry.h>
10
+ #include <react/renderer/graphics/Float.h> // [macOS]
11
11
 
12
12
  namespace facebook::react {
13
13
 
@@ -35,12 +35,27 @@
35
35
  * }} ProjectConfig
36
36
  */
37
37
 
38
- const chalk = require('chalk');
39
- const child_process = require('child_process');
40
- const path = require('path');
38
+ const child_process = require('node:child_process');
39
+ const path = require('node:path');
41
40
 
42
- const {logger, CLIError, getDefaultUserTerminal} = (() => {
43
- const cli = require.resolve('@react-native-community/cli/package.json');
41
+ const colors = (() => {
42
+ const {WriteStream} = require('node:tty');
43
+ if (WriteStream.prototype.hasColors() &&
44
+ !process.env.NODE_TEST_CONTEXT &&
45
+ process.env.NODE_ENV !== 'test'
46
+ ) {
47
+ return {
48
+ bold: (s) => '\u001B[1m' + s + '\u001B[22m',
49
+ dim: (s) => '\u001B[2m' + s + '\u001B[22m',
50
+ }
51
+ }
52
+
53
+ const passthrough = (s) => s;
54
+ return { bold: passthrough, dim: passthrough };
55
+ })();
56
+
57
+ const {logger, CLIError, getDefaultUserTerminal} = ((projectRoot = process.cwd()) => {
58
+ const cli = require.resolve('@react-native-community/cli/package.json', {paths: [projectRoot]});
44
59
  const options = {paths: [path.dirname(cli)]};
45
60
  const tools = require.resolve('@react-native-community/cli-tools', options);
46
61
  return require(tools);
@@ -92,7 +107,7 @@ function parseArgs(ctx, args) {
92
107
  logger.info(
93
108
  `Found Xcode ${
94
109
  xcodeProject.isWorkspace ? 'workspace' : 'project'
95
- } "${chalk.bold(xcodeProject.name)}"`,
110
+ } "${colors.bold(xcodeProject.name)}"`,
96
111
  );
97
112
 
98
113
  return {sourceDir, xcodeProject, scheme};
@@ -146,7 +161,7 @@ async function run(sourceDir, xcodeProject, scheme, args) {
146
161
  .trim();
147
162
 
148
163
  logger.info(
149
- `Launching app "${chalk.bold(bundleID)}" from "${chalk.bold(appPath)}"`,
164
+ `Launching app "${colors.bold(bundleID)}" from "${colors.bold(appPath)}"`,
150
165
  );
151
166
 
152
167
  child_process.exec(
@@ -179,7 +194,7 @@ function buildProject(sourceDir, xcodeProject, scheme, args) {
179
194
  scheme,
180
195
  ];
181
196
  logger.info(
182
- `Building ${chalk.dim(
197
+ `Building ${colors.dim(
183
198
  `(using "xcodebuild ${xcodebuildArgs.join(' ')}")`,
184
199
  )}`,
185
200
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.81.0",
3
+ "version": "0.81.2",
4
4
  "description": "React Native for macOS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -166,7 +166,7 @@
166
166
  },
167
167
  "dependencies": {
168
168
  "@jest/create-cache-key-function": "^29.7.0",
169
- "@react-native-macos/virtualized-lists": "0.81.0",
169
+ "@react-native-macos/virtualized-lists": "0.81.2",
170
170
  "@react-native/assets-registry": "0.81.5",
171
171
  "@react-native/codegen": "0.81.5",
172
172
  "@react-native/community-cli-plugin": "0.81.5",
@@ -205,7 +205,7 @@
205
205
  {
206
206
  "name": "FBReactNativeSpec",
207
207
  "type": "all",
208
- "ios": {
208
+ "macos": {
209
209
  "modules": {
210
210
  "AccessibilityManager": {
211
211
  "unstableRequiresMainQueueSetup": true
@@ -71,8 +71,14 @@ try {
71
71
  // [macOS
72
72
  let apple;
73
73
  try {
74
+ const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
75
+ paths: [process.cwd()],
76
+ });
74
77
  // $FlowFixMe[untyped-import]
75
- apple = require('@react-native-community/cli-platform-apple');
78
+ apple = findCommunityPlatformPackage(
79
+ '@react-native-community/cli-platform-apple',
80
+ iosPath,
81
+ );
76
82
  } catch {
77
83
  if (verbose) {
78
84
  console.warn(
@@ -156,7 +162,7 @@ if (android != null) {
156
162
 
157
163
  // [macOS
158
164
  config.commands.push(...macosCommands);
159
- if (apple != null) {
165
+ if (apple) {
160
166
  config.platforms.macos = {
161
167
  linkConfig: () => {
162
168
  return {