react-native-macos 0.81.5 → 0.81.7

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 (49) hide show
  1. package/Libraries/Components/Pressable/Pressable.js +8 -1
  2. package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +16 -0
  3. package/Libraries/Components/TextInput/TextInput.js +26 -9
  4. package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
  5. package/Libraries/Components/View/View.js +30 -10
  6. package/Libraries/Components/View/ViewPropTypes.js +2 -0
  7. package/Libraries/Core/ReactNativeVersion.js +1 -1
  8. package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -0
  9. package/Libraries/Pressability/Pressability.js +38 -4
  10. package/Libraries/Text/RCTTextAttributes.mm +1 -1
  11. package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +1 -1
  12. package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +1 -1
  13. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +6 -3
  14. package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +0 -4
  15. package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +3 -20
  16. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +5 -3
  17. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.mm +83 -0
  18. package/Libraries/Utilities/normalizeLegacyHandledKeyEvents.js +164 -0
  19. package/React/Base/RCTVersion.m +1 -1
  20. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +31 -1
  21. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +38 -2
  22. package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +61 -2
  23. package/React/Fabric/RCTSurfacePointerHandler.mm +6 -2
  24. package/React/Views/RCTView.h +1 -0
  25. package/React/Views/RCTViewManager.m +1 -0
  26. package/ReactAndroid/gradle.properties +1 -1
  27. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
  28. package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
  29. package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +1 -1
  30. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +5 -0
  31. package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +5 -0
  32. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +4 -0
  33. package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
  34. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
  35. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +2 -0
  36. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +6 -0
  37. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +2 -0
  38. package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +8 -0
  39. package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
  40. package/ReactCommon/react/renderer/components/view/propsConversions.h +4 -0
  41. package/ReactCommon/react/renderer/graphics/Color.h +1 -0
  42. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +2 -0
  43. package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +11 -0
  44. package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +13 -2
  45. package/package.json +26 -5
  46. package/react-native.config.js +0 -5
  47. package/sdks/hermes-engine/utils/build-apple-framework.sh +2 -1
  48. package/sdks/hermes-engine/utils/build-ios-framework.sh +8 -3
  49. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +0 -14
@@ -10,6 +10,7 @@
10
10
  #import <Foundation/Foundation.h>
11
11
  #import <React/RCTUIKit.h> // [macOS]
12
12
  #import <objc/runtime.h>
13
+ #import <react/renderer/graphics/Color.h> // [macOS]
13
14
  #import <react/renderer/graphics/RCTPlatformColorUtils.h>
14
15
  #import <react/utils/ManagedObjectWrapper.h>
15
16
  #import <string>
@@ -342,6 +343,16 @@ Color Color::createSemanticColor(std::vector<std::string> &semanticItems)
342
343
  return Color(wrapManagedObject(semanticColor));
343
344
  }
344
345
 
346
+ // [macOS
347
+ SharedColor defaultForegroundTextColor() {
348
+ static SharedColor color = [] {
349
+ std::vector<std::string> items = {"labelColor"};
350
+ return SharedColor(Color::createSemanticColor(items));
351
+ }();
352
+ return color;
353
+ }
354
+ // macOS]
355
+
345
356
  } // namespace facebook::react
346
357
 
347
358
  NS_ASSUME_NONNULL_END
@@ -144,9 +144,16 @@ inline static UIFont *RCTEffectiveFontFromTextAttributes(const TextAttributes &t
144
144
 
145
145
  inline static RCTUIColor *RCTEffectiveForegroundColorFromTextAttributes(const TextAttributes &textAttributes) // [macOS]
146
146
  {
147
- RCTUIColor *effectiveForegroundColor = RCTUIColorFromSharedColor(textAttributes.foregroundColor) ? RCTUIColorFromSharedColor(textAttributes.foregroundColor) : [RCTUIColor blackColor]; // [macOS]
148
-
147
+ RCTUIColor *effectiveForegroundColor = RCTUIColorFromSharedColor(textAttributes.foregroundColor) ?: [RCTUIColor labelColor]; // [macOS]
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-macos",
3
- "version": "0.81.5",
3
+ "version": "0.81.7",
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.5",
190
+ "@react-native-macos/virtualized-lists": "0.81.7",
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",
@@ -71,13 +71,8 @@ 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
- });
77
- // $FlowFixMe[untyped-import]
78
74
  apple = findCommunityPlatformPackage(
79
75
  '@react-native-community/cli-platform-apple',
80
- iosPath,
81
76
  );
82
77
  } catch {
83
78
  if (verbose) {
@@ -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"
@@ -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"