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.
- package/Libraries/Components/Pressable/Pressable.js +8 -1
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +16 -0
- package/Libraries/Components/TextInput/TextInput.js +26 -9
- package/Libraries/Components/View/ReactNativeViewAttributes.js +1 -0
- package/Libraries/Components/View/View.js +30 -10
- package/Libraries/Components/View/ViewPropTypes.js +2 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +8 -0
- package/Libraries/Pressability/Pressability.js +38 -4
- package/Libraries/Text/RCTTextAttributes.mm +1 -1
- package/Libraries/Text/TextInput/Multiline/RCTUITextView.mm +1 -1
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm +1 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +6 -3
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.h +0 -4
- package/Libraries/Text/TextInput/Singleline/RCTUITextField.mm +3 -20
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +5 -3
- package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.mm +83 -0
- package/Libraries/Utilities/normalizeLegacyHandledKeyEvents.js +164 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +31 -1
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +38 -2
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +61 -2
- package/React/Fabric/RCTSurfacePointerHandler.mm +6 -2
- package/React/Views/RCTView.h +1 -0
- package/React/Views/RCTViewManager.m +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +1 -1
- package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/IOSSwitchShadowNode.mm +5 -0
- package/ReactCommon/react/renderer/components/switch/iosswitch/react/renderer/components/switch/MacOSSwitchShadowNode.mm +5 -0
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.cpp +4 -0
- package/ReactCommon/react/renderer/components/view/TouchEventEmitter.h +1 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.cpp +16 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEventEmitter.h +2 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewEvents.h +6 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/HostPlatformViewProps.cpp +2 -0
- package/ReactCommon/react/renderer/components/view/platform/macos/react/renderer/components/view/MouseEvent.h +8 -0
- package/ReactCommon/react/renderer/components/view/primitives.h +2 -0
- package/ReactCommon/react/renderer/components/view/propsConversions.h +4 -0
- package/ReactCommon/react/renderer/graphics/Color.h +1 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.h +2 -0
- package/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm +11 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +13 -2
- package/package.json +26 -5
- package/react-native.config.js +0 -5
- package/sdks/hermes-engine/utils/build-apple-framework.sh +2 -1
- package/sdks/hermes-engine/utils/build-ios-framework.sh +8 -3
- 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)
|
|
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.
|
|
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.
|
|
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",
|
package/react-native.config.js
CHANGED
|
@@ -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
|
-
|
|
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"
|