react-native-macos 0.81.6 → 0.81.8

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 (57) hide show
  1. package/Libraries/Blob/RCTBlobManager.h +0 -0
  2. package/Libraries/Blob/RCTBlobManager.mm +0 -0
  3. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +0 -0
  4. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  5. package/Libraries/Components/View/ViewPropTypes.js +2 -0
  6. package/Libraries/Core/ReactNativeVersion.js +1 -1
  7. package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -0
  8. package/Libraries/Pressability/Pressability.js +38 -4
  9. package/Libraries/StyleSheet/normalizeColor.js +0 -0
  10. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +13 -4
  11. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +1 -1
  12. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +5 -2
  13. package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +0 -4
  14. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +3 -20
  15. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +5 -3
  16. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.mm +83 -0
  17. package/React/Base/RCTJavaScriptLoader.h +0 -0
  18. package/React/Base/RCTJavaScriptLoader.mm +0 -0
  19. package/React/Base/RCTVersion.m +1 -1
  20. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +27 -21
  21. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +192 -4
  22. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputNativeCommands.h +20 -0
  23. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +61 -2
  24. package/React/Fabric/RCTSurfacePointerHandler.mm +6 -2
  25. package/React/Views/RCTComponentData.mm +1 -1
  26. package/React/Views/RCTView.h +1 -0
  27. package/React/Views/RCTViewManager.m +1 -0
  28. package/ReactAndroid/gradle.properties +1 -1
  29. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  30. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  31. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +5 -0
  32. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +5 -0
  33. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +4 -0
  34. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
  35. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
  36. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +2 -0
  37. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +6 -0
  38. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +2 -0
  39. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +8 -0
  40. package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
  41. package/ReactCommon/react/renderer/components/view/propsConversions.h +4 -0
  42. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +2 -0
  43. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +11 -0
  44. package/gradle/libs.versions.toml +1 -1
  45. package/local-cli/cli.js +0 -0
  46. package/package.json +27 -6
  47. package/react-native.config.js +0 -1
  48. package/scripts/compose-source-maps.js +0 -0
  49. package/scripts/featureflags/index.js +47 -0
  50. package/scripts/find-node-for-xcode.sh +0 -0
  51. package/scripts/ios-prebuild/cli.js +136 -0
  52. package/sdks/hermes-engine/utils/build-apple-framework.sh +2 -1
  53. package/sdks/hermes-engine/utils/build-ios-framework.sh +8 -3
  54. package/sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh +0 -0
  55. package/third-party-podspecs/RCT-Folly.podspec +1 -1
  56. package/third-party-podspecs/fmt.podspec +2 -2
  57. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +0 -14
@@ -146,7 +146,14 @@ inline static RCTUIColor *RCTEffectiveForegroundColorFromTextAttributes(const Te
146
146
  {
147
147
  RCTUIColor *effectiveForegroundColor = RCTUIColorFromSharedColor(textAttributes.foregroundColor) ?: [RCTUIColor labelColor]; // [macOS]
148
148
 
149
+ #if TARGET_OS_OSX // [macOS
150
+ // On macOS, colorWithAlphaComponent: converts dynamic system colors (like
151
+ // NSColor.labelColor) to static resolved colors, preventing them from
152
+ // adapting to appearance changes. Skip when opacity is 1.0 (a no-op).
153
+ if (!isnan(textAttributes.opacity) && textAttributes.opacity != 1.0f) {
154
+ #else // macOS]
149
155
  if (!isnan(textAttributes.opacity)) {
156
+ #endif
150
157
  effectiveForegroundColor = [effectiveForegroundColor
151
158
  colorWithAlphaComponent:CGColorGetAlpha(effectiveForegroundColor.CGColor) * textAttributes.opacity];
152
159
  }
@@ -158,7 +165,11 @@ inline static RCTUIColor *RCTEffectiveBackgroundColorFromTextAttributes(const Te
158
165
  {
159
166
  RCTUIColor *effectiveBackgroundColor = RCTUIColorFromSharedColor(textAttributes.backgroundColor); // [macOS]
160
167
 
168
+ #if TARGET_OS_OSX // [macOS
169
+ if (effectiveBackgroundColor && !isnan(textAttributes.opacity) && textAttributes.opacity != 1.0f) {
170
+ #else // macOS]
161
171
  if (effectiveBackgroundColor && !isnan(textAttributes.opacity)) {
172
+ #endif
162
173
  effectiveBackgroundColor = [effectiveBackgroundColor
163
174
  colorWithAlphaComponent:CGColorGetAlpha(effectiveBackgroundColor.CGColor) * textAttributes.opacity];
164
175
  }
@@ -43,7 +43,7 @@ yoga-proguard-annotations = "1.19.0"
43
43
  boost="1_83_0"
44
44
  doubleconversion="1.1.6"
45
45
  fastFloat="8.0.0"
46
- fmt="11.0.2"
46
+ fmt="12.1.0" # [macOS]
47
47
  folly="2024.11.18.00"
48
48
  glog="0.3.5"
49
49
  gflags="2.2.0"
package/local-cli/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.81.6",
3
+ "version": "0.81.8",
4
4
  "description": "React Native for macOS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,6 +27,27 @@
27
27
  "react-native": "cli.js",
28
28
  "react-native-macos": "cli.js"
29
29
  },
30
+ "publishConfig": {
31
+ "executableFiles": [
32
+ "scripts/find-node-for-xcode.sh",
33
+ "scripts/ios-configure-glog.sh",
34
+ "scripts/node-binary.sh",
35
+ "scripts/packager.sh",
36
+ "scripts/react-native-xcode.sh",
37
+ "scripts/react_native_pods_utils/script_phases.sh",
38
+ "scripts/update-ruby.sh",
39
+ "scripts/xcode/ccache-clang.sh",
40
+ "scripts/xcode/ccache-clang++.sh",
41
+ "scripts/xcode/with-environment.sh",
42
+ "sdks/hermes-engine/utils/build-apple-framework.sh",
43
+ "sdks/hermes-engine/utils/build-hermes-xcode.sh",
44
+ "sdks/hermes-engine/utils/build-hermesc-xcode.sh",
45
+ "sdks/hermes-engine/utils/build-ios-framework.sh",
46
+ "sdks/hermes-engine/utils/build-mac-framework.sh",
47
+ "sdks/hermes-engine/utils/copy-hermes-xcode.sh",
48
+ "sdks/hermes-engine/utils/create-dummy-hermes-xcframework.sh"
49
+ ]
50
+ },
30
51
  "main": "./index.js",
31
52
  "types": "types",
32
53
  "exports": {
@@ -111,8 +132,8 @@
111
132
  "rn-get-polyfills.js",
112
133
  "scripts/replace-rncore-version.js",
113
134
  "scripts/bundle.js",
114
- "scripts/cocoapods",
115
- "scripts/codegen",
135
+ "scripts/cocoapods/**",
136
+ "scripts/codegen/**",
116
137
  "scripts/compose-source-maps.js",
117
138
  "scripts/find-node-for-xcode.sh",
118
139
  "scripts/generate-codegen-artifacts.js",
@@ -135,7 +156,7 @@
135
156
  "scripts/xcode/ccache.conf",
136
157
  "scripts/xcode/with-environment.sh",
137
158
  "sdks/.hermesversion",
138
- "sdks/hermes-engine",
159
+ "sdks/hermes-engine/**",
139
160
  "sdks/hermesc",
140
161
  "settings.gradle.kts",
141
162
  "src",
@@ -166,7 +187,7 @@
166
187
  },
167
188
  "dependencies": {
168
189
  "@jest/create-cache-key-function": "^29.7.0",
169
- "@react-native-macos/virtualized-lists": "0.81.6",
190
+ "@react-native-macos/virtualized-lists": "0.81.8",
170
191
  "@react-native/assets-registry": "0.81.6",
171
192
  "@react-native/codegen": "0.81.6",
172
193
  "@react-native/community-cli-plugin": "0.81.6",
@@ -232,4 +253,4 @@
232
253
  }
233
254
  ]
234
255
  }
235
- }
256
+ }
@@ -74,7 +74,6 @@ try {
74
74
  const iosPath = require.resolve('@react-native-community/cli-platform-ios', {
75
75
  paths: [process.cwd()],
76
76
  });
77
- // $FlowFixMe[untyped-import]
78
77
  apple = findCommunityPlatformPackage(
79
78
  '@react-native-community/cli-platform-apple',
80
79
  iosPath,
File without changes
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and 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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ if (require.main === module) {
12
+ require('../../../../scripts/babel-register').registerForMonorepo();
13
+
14
+ let command;
15
+
16
+ if (process.argv.includes('--update')) {
17
+ command = 'update';
18
+ } else if (process.argv.includes('--verify-unchanged')) {
19
+ command = 'verify-unchanged';
20
+ } else if (process.argv.includes('--print')) {
21
+ command = 'print';
22
+ } else if (process.argv.includes('--help')) {
23
+ command = 'help';
24
+ } else {
25
+ console.log('Defaulting to `--update`. See all options using `--help`.');
26
+ command = 'update';
27
+ }
28
+
29
+ switch (command) {
30
+ case 'update':
31
+ require('./update').default(false);
32
+ break;
33
+ case 'verify-unchanged':
34
+ require('./update').default(true);
35
+ break;
36
+ case 'print':
37
+ require('./print').default(process.argv.includes('--json'));
38
+ break;
39
+ case 'help':
40
+ console.log(
41
+ 'Usage: node featureflags.js [--update|--verify-unchanged|--print|--help]',
42
+ );
43
+ break;
44
+ default:
45
+ throw new Error('Unexpected script execution.');
46
+ }
47
+ }
File without changes
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and 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
+ * @flow
8
+ * @format
9
+ */
10
+
11
+ const yargs = require('yargs');
12
+
13
+ /*::
14
+ import type {BuildFlavor, Destination, Platform} from './types';
15
+ */
16
+
17
+ const platforms /*: $ReadOnlyArray<Platform> */ = [
18
+ 'ios',
19
+ 'ios-simulator',
20
+ 'mac-catalyst',
21
+ 'macos', // [macOS]
22
+ 'visionos', // [macOS]
23
+ 'visionos-simulator', // [macOS]
24
+ ];
25
+
26
+ // CI can't use commas in cache keys, so 'macOS,variant=Mac Catalyst' was creating troubles
27
+ // This map that converts from platforms to valid Xcodebuild destinations.
28
+ const platformToDestination /*: $ReadOnly<{|[Platform]: Destination|}> */ = {
29
+ ios: 'iOS',
30
+ 'ios-simulator': 'iOS Simulator',
31
+ 'mac-catalyst': 'macOS,variant=Mac Catalyst',
32
+ macos: 'macOS', // [macOS]
33
+ visionos: 'visionOS', // [macOS]
34
+ 'visionos-simulator': 'visionOS Simulator', // [macOS]
35
+ };
36
+
37
+ const cli = yargs
38
+ .usage(
39
+ 'This script prepares iOS prebuilds for React Native. It downloads the dependencies, prepare them, builds them and creates the XCFrameworks.' +
40
+ 'Calling the script with no options will build all the dependencies for all the slices and configurations.',
41
+ )
42
+ .option('setup', {
43
+ alias: 's',
44
+ type: 'boolean',
45
+ describe: 'Download and setup dependencies',
46
+ })
47
+ .option('build', {
48
+ alias: 'b',
49
+ type: 'boolean',
50
+ describe: 'Build dependencies/platforms',
51
+ })
52
+ .option('compose', {
53
+ alias: 'c',
54
+ type: 'boolean',
55
+ describe: 'Compose xcframework from built dependencies',
56
+ })
57
+ .option('platforms', {
58
+ alias: 'p',
59
+ type: 'array',
60
+ default: platforms,
61
+ describe: 'Specify one or more platforms to build for',
62
+ })
63
+ .option('flavor', {
64
+ alias: 'f',
65
+ type: 'string',
66
+ describe: 'Specify the flavor to build, Debug (default) or Release.',
67
+ default: 'Debug',
68
+ })
69
+ .option('identity', {
70
+ alias: 'i',
71
+ type: 'string',
72
+ describe:
73
+ 'Specify the code signing identity to use for signing the frameworks.',
74
+ })
75
+ .help();
76
+
77
+ /**
78
+ * Returns the tasks that need to be run based on the command line arguments
79
+ */
80
+ async function getCLIConfiguration() /*: Promise<?{|
81
+ tasks: {|
82
+ setup: boolean,
83
+ build: boolean,
84
+ compose: boolean,
85
+ |},
86
+ flavor: BuildFlavor,
87
+ destinations: $ReadOnlyArray<Destination>,
88
+ identity: ?string,
89
+ |}> */ {
90
+ // Run input parsing
91
+ const argv = await cli.argv;
92
+
93
+ // Verify that the platforms argument is valid
94
+ const platformArray = Array.isArray(argv.platforms)
95
+ ? argv.platforms
96
+ : [argv.platforms];
97
+ const invalidPlatforms = platformArray.filter(rs => !platforms.includes(rs));
98
+
99
+ if (invalidPlatforms.length > 0) {
100
+ console.error(
101
+ `Invalid platform specified: ${invalidPlatforms.join(', ')}\nValid platforms are: ${platforms.join(', ')}`,
102
+ );
103
+ return undefined;
104
+ }
105
+
106
+ // Prepare platforms and dependencies
107
+ const resolvedPlatforms = platforms
108
+ .filter(p => argv.platforms.includes(p))
109
+ .map(p => platformToDestination[p]);
110
+
111
+ // Validate flavor
112
+ const flavor = argv.flavor;
113
+ if (flavor !== 'Debug' && flavor !== 'Release') {
114
+ console.error(
115
+ `Invalid flavor specified: ${flavor}\nValid flavors are: Debug, Release`,
116
+ );
117
+ return undefined;
118
+ }
119
+
120
+ // Are we running all commands?
121
+ const runAllCommands =
122
+ argv.setup == null && argv.build == null && argv.compose == null;
123
+
124
+ return {
125
+ tasks: {
126
+ setup: runAllCommands || argv.setup != null,
127
+ build: runAllCommands || argv.build != null,
128
+ compose: runAllCommands || argv.compose != null,
129
+ },
130
+ flavor: flavor,
131
+ destinations: resolvedPlatforms,
132
+ identity: argv.identity,
133
+ };
134
+ }
135
+
136
+ module.exports = {getCLIConfiguration};
@@ -12,7 +12,8 @@ CURR_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
12
12
  IMPORT_HERMESC_PATH=${HERMES_OVERRIDE_HERMESC_PATH:-$PWD/build_host_hermesc/ImportHermesc.cmake}
13
13
  BUILD_TYPE=${BUILD_TYPE:-Debug}
14
14
 
15
- HERMES_PATH="$CURR_SCRIPT_DIR/.."
15
+ # [macOS]
16
+ HERMES_PATH=${HERMES_PATH:-"$CURR_SCRIPT_DIR/.."}
16
17
  REACT_NATIVE_PATH=${REACT_NATIVE_PATH:-$CURR_SCRIPT_DIR/../../..}
17
18
 
18
19
  NUM_CORES=$(sysctl -n hw.ncpu)
@@ -10,7 +10,7 @@ fi
10
10
  set -e
11
11
 
12
12
  # Given a specific target, retrieve the right architecture for it
13
- # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
13
+ # $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, macosx, xros, xrsimulator
14
14
  function get_architecture {
15
15
  if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
16
16
  echo "arm64"
@@ -20,7 +20,7 @@ function get_architecture {
20
20
  echo "arm64"
21
21
  elif [[ $1 == "appletvsimulator" ]]; then
22
22
  echo "x86_64;arm64"
23
- elif [[ $1 == "catalyst" ]]; then
23
+ elif [[ $1 == "catalyst" || $1 == "macosx" ]]; then # [macOS]
24
24
  echo "x86_64;arm64"
25
25
  else
26
26
  echo "Error: unknown architecture passed $1"
@@ -31,6 +31,10 @@ function get_architecture {
31
31
  function get_deployment_target {
32
32
  if [[ $1 == "xros" || $1 == "xrsimulator" ]]; then
33
33
  echo "$(get_visionos_deployment_target)"
34
+ # [macOS
35
+ elif [[ $1 == "macosx" ]]; then
36
+ echo "$(get_mac_deployment_target)"
37
+ # macOS]
34
38
  else # tvOS and iOS use the same deployment target
35
39
  echo "$(get_ios_deployment_target)"
36
40
  fi
@@ -53,7 +57,7 @@ function build_framework {
53
57
  # group the frameworks together to create a universal framework
54
58
  function build_universal_framework {
55
59
  if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
56
- create_universal_framework "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator"
60
+ create_universal_framework "macosx" "iphoneos" "iphonesimulator" "catalyst" "xros" "xrsimulator" "appletvos" "appletvsimulator" # [macOS]
57
61
  else
58
62
  echo "Skipping; Clean \"destroot\" to rebuild".
59
63
  fi
@@ -63,6 +67,7 @@ function build_universal_framework {
63
67
  # this is used to preserve backward compatibility
64
68
  function create_framework {
65
69
  if [ ! -d destroot/Library/Frameworks/universal/hermes.xcframework ]; then
70
+ build_framework "macosx" # [macOS]
66
71
  build_framework "iphoneos"
67
72
  build_framework "iphonesimulator"
68
73
  build_framework "appletvos"
@@ -25,7 +25,7 @@ Pod::Spec.new do |spec|
25
25
  spec.dependency "DoubleConversion"
26
26
  spec.dependency "glog"
27
27
  spec.dependency "fast_float", "8.0.0"
28
- spec.dependency "fmt", "11.0.2"
28
+ spec.dependency "fmt", "12.1.0" # [macOS]
29
29
  spec.compiler_flags = '-Wno-documentation -faligned-new'
30
30
  spec.source_files = 'folly/String.cpp',
31
31
  'folly/Conv.cpp',
@@ -8,14 +8,14 @@ fmt_git_url = fmt_config[:git]
8
8
 
9
9
  Pod::Spec.new do |spec|
10
10
  spec.name = "fmt"
11
- spec.version = "11.0.2"
11
+ spec.version = "12.1.0" # [macOS]
12
12
  spec.license = { :type => "MIT" }
13
13
  spec.homepage = "https://github.com/fmtlib/fmt"
14
14
  spec.summary = "{fmt} is an open-source formatting library for C++. It can be used as a safe and fast alternative to (s)printf and iostreams."
15
15
  spec.authors = "The fmt contributors"
16
16
  spec.source = {
17
17
  :git => fmt_git_url,
18
- :tag => "11.0.2"
18
+ :tag => "12.1.0" # [macOS]
19
19
  }
20
20
  spec.pod_target_xcconfig = {
21
21
  "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
@@ -1,14 +0,0 @@
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
-
8
- // [macOS]
9
-
10
- #if TARGET_OS_OSX
11
- #define RCT_SUBCLASS_SECURETEXTFIELD 1
12
- #endif
13
-
14
- #include "../RCTUITextField.mm"