react-native-macos 0.74.27 → 0.74.29
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/TextInput/TextInput.d.ts +16 -0
- package/Libraries/Components/TextInput/TextInput.flow.js +2 -0
- package/Libraries/Components/TextInput/TextInput.js +4 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Views/RCTModalHostView.m +1 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java +9 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1 -4
- package/ReactCommon/react/renderer/animations/utils.h +45 -0
- package/package.json +7 -7
- package/sdks/hermes-engine/utils/build-apple-framework.sh +0 -12
- package/template/Gemfile +2 -0
- package/template/package.json +5 -5
|
@@ -1048,6 +1048,22 @@ interface TextInputState {
|
|
|
1048
1048
|
* noop if it wasn't focused
|
|
1049
1049
|
*/
|
|
1050
1050
|
blurTextInput(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1051
|
+
|
|
1052
|
+
// [macOS
|
|
1053
|
+
/**
|
|
1054
|
+
* @param textField ref of the text field that was focused
|
|
1055
|
+
* Call on custom implementations of TextInput to notify the control was focused
|
|
1056
|
+
* noop if it was already focused
|
|
1057
|
+
*/
|
|
1058
|
+
onTextInputFocus(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* @param textField ref of the text field that was blurred
|
|
1062
|
+
* Call on custom implementations of TextInput to notify the control was blurred
|
|
1063
|
+
* noop if it wasn't focused
|
|
1064
|
+
*/
|
|
1065
|
+
onTextInputBlur(textField?: React.ElementRef<HostComponent<unknown>>): void;
|
|
1066
|
+
// macOS]
|
|
1051
1067
|
}
|
|
1052
1068
|
|
|
1053
1069
|
/**
|
|
@@ -1223,6 +1223,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
1223
1223
|
currentlyFocusedField: () => ?number,
|
|
1224
1224
|
focusTextInput: (textField: ?ComponentRef) => void,
|
|
1225
1225
|
blurTextInput: (textField: ?ComponentRef) => void,
|
|
1226
|
+
onTextInputFocus: (textField: ?ComponentRef) => void, // [macOS]
|
|
1227
|
+
onTextInputBlur: (textField: ?ComponentRef) => void, // [macOS]
|
|
1226
1228
|
|}>,
|
|
1227
1229
|
|}>;
|
|
1228
1230
|
|
|
@@ -1934,6 +1934,8 @@ ExportedForwardRef.State = {
|
|
|
1934
1934
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
1935
1935
|
focusTextInput: TextInputState.focusTextInput,
|
|
1936
1936
|
blurTextInput: TextInputState.blurTextInput,
|
|
1937
|
+
onTextInputFocus: TextInputState.focusInput, // [macOS]
|
|
1938
|
+
onTextInputBlur: TextInputState.blurInput, // [macOS]
|
|
1937
1939
|
};
|
|
1938
1940
|
|
|
1939
1941
|
export type TextInputComponentStatics = $ReadOnly<{|
|
|
@@ -1942,6 +1944,8 @@ export type TextInputComponentStatics = $ReadOnly<{|
|
|
|
1942
1944
|
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
|
|
1943
1945
|
focusTextInput: typeof TextInputState.focusTextInput,
|
|
1944
1946
|
blurTextInput: typeof TextInputState.blurTextInput,
|
|
1947
|
+
onTextInputFocus: typeof TextInputState.focusInput, // [macOS]
|
|
1948
|
+
onTextInputBlur: typeof TextInputState.blurInput, // [macOS]
|
|
1945
1949
|
|}>,
|
|
1946
1950
|
|}>;
|
|
1947
1951
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -122,6 +122,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : coder)
|
|
|
122
122
|
if (_isPresented) {
|
|
123
123
|
[_delegate dismissModalHostView:self withViewController:_modalViewController animated:[self hasAnimationType]];
|
|
124
124
|
_isPresented = NO;
|
|
125
|
+
[self setVisible:NO];
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
|
package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java
CHANGED
|
@@ -579,6 +579,7 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
// Clip border ONLY if its color is non transparent
|
|
582
|
+
float pathAdjustment = 0f;
|
|
582
583
|
if (Color.alpha(colorLeft) != 0
|
|
583
584
|
&& Color.alpha(colorTop) != 0
|
|
584
585
|
&& Color.alpha(colorRight) != 0
|
|
@@ -589,6 +590,10 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
|
|
589
590
|
mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom;
|
|
590
591
|
mInnerClipTempRectForBorderRadius.left += borderWidth.left;
|
|
591
592
|
mInnerClipTempRectForBorderRadius.right -= borderWidth.right;
|
|
593
|
+
|
|
594
|
+
// only close gap between border and main path if we draw the border, otherwise
|
|
595
|
+
// we wind up pixelating small pixel-radius curves
|
|
596
|
+
pathAdjustment = mGapBetweenPaths;
|
|
592
597
|
}
|
|
593
598
|
|
|
594
599
|
mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f;
|
|
@@ -716,10 +721,10 @@ public class ReactViewBackgroundDrawable extends Drawable {
|
|
|
716
721
|
// (mInnerClipTempRectForBorderRadius), ensuring the border can be
|
|
717
722
|
// drawn on top without the gap.
|
|
718
723
|
mBackgroundColorRenderPath.addRoundRect(
|
|
719
|
-
mInnerClipTempRectForBorderRadius.left -
|
|
720
|
-
mInnerClipTempRectForBorderRadius.top -
|
|
721
|
-
mInnerClipTempRectForBorderRadius.right +
|
|
722
|
-
mInnerClipTempRectForBorderRadius.bottom +
|
|
724
|
+
mInnerClipTempRectForBorderRadius.left - pathAdjustment,
|
|
725
|
+
mInnerClipTempRectForBorderRadius.top - pathAdjustment,
|
|
726
|
+
mInnerClipTempRectForBorderRadius.right + pathAdjustment,
|
|
727
|
+
mInnerClipTempRectForBorderRadius.bottom + pathAdjustment,
|
|
723
728
|
new float[] {
|
|
724
729
|
innerTopLeftRadiusX,
|
|
725
730
|
innerTopLeftRadiusY,
|
|
@@ -795,10 +795,7 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
795
795
|
finalConflictingMutations.end(),
|
|
796
796
|
&shouldFirstComeBeforeSecondMutation);
|
|
797
797
|
|
|
798
|
-
|
|
799
|
-
immediateMutations.begin(),
|
|
800
|
-
immediateMutations.end(),
|
|
801
|
-
&shouldFirstComeBeforeSecondRemovesOnly);
|
|
798
|
+
handleShouldFirstComeBeforeSecondRemovesOnly(immediateMutations);
|
|
802
799
|
|
|
803
800
|
animation.keyFrames = keyFramesToAnimate;
|
|
804
801
|
inflightAnimations_.push_back(std::move(animation));
|
|
@@ -24,6 +24,40 @@ static inline bool shouldFirstComeBeforeSecondRemovesOnly(
|
|
|
24
24
|
(lhs.index > rhs.index);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
static inline void handleShouldFirstComeBeforeSecondRemovesOnly(
|
|
28
|
+
ShadowViewMutation::List& list) noexcept {
|
|
29
|
+
std::unordered_map<std::string, std::vector<ShadowViewMutation>>
|
|
30
|
+
removeMutationsByTag;
|
|
31
|
+
ShadowViewMutation::List finalList;
|
|
32
|
+
for (auto& mutation : list) {
|
|
33
|
+
if (mutation.type == ShadowViewMutation::Type::Remove) {
|
|
34
|
+
auto key = std::to_string(mutation.parentShadowView.tag);
|
|
35
|
+
removeMutationsByTag[key].push_back(mutation);
|
|
36
|
+
} else {
|
|
37
|
+
finalList.push_back(mutation);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (removeMutationsByTag.size() == 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (auto& mutationsPair : removeMutationsByTag) {
|
|
46
|
+
if (mutationsPair.second.size() > 1) {
|
|
47
|
+
std::stable_sort(
|
|
48
|
+
mutationsPair.second.begin(),
|
|
49
|
+
mutationsPair.second.end(),
|
|
50
|
+
&shouldFirstComeBeforeSecondRemovesOnly);
|
|
51
|
+
}
|
|
52
|
+
finalList.insert(
|
|
53
|
+
finalList.begin(),
|
|
54
|
+
mutationsPair.second.begin(),
|
|
55
|
+
mutationsPair.second.end());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
list = finalList;
|
|
59
|
+
}
|
|
60
|
+
|
|
27
61
|
static inline bool shouldFirstComeBeforeSecondMutation(
|
|
28
62
|
const ShadowViewMutation& lhs,
|
|
29
63
|
const ShadowViewMutation& rhs) noexcept {
|
|
@@ -55,6 +89,17 @@ static inline bool shouldFirstComeBeforeSecondMutation(
|
|
|
55
89
|
lhs.type == ShadowViewMutation::Type::Insert) {
|
|
56
90
|
return false;
|
|
57
91
|
}
|
|
92
|
+
|
|
93
|
+
// Remove comes before Update
|
|
94
|
+
if (lhs.type == ShadowViewMutation::Type::Remove &&
|
|
95
|
+
rhs.type == ShadowViewMutation::Type::Update) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (rhs.type == ShadowViewMutation::Type::Remove &&
|
|
99
|
+
lhs.type == ShadowViewMutation::Type::Update) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
58
103
|
} else {
|
|
59
104
|
// Make sure that removes on the same level are sorted - highest indices
|
|
60
105
|
// must come first.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-macos",
|
|
3
|
-
"version": "0.74.
|
|
3
|
+
"version": "0.74.29",
|
|
4
4
|
"description": "React Native for macOS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -113,12 +113,12 @@
|
|
|
113
113
|
"@react-native-community/cli-platform-apple": "13.6.9",
|
|
114
114
|
"@react-native-community/cli-platform-ios": "13.6.9",
|
|
115
115
|
"@react-native-mac/virtualized-lists": "0.74.87",
|
|
116
|
-
"@react-native/assets-registry": "0.74.
|
|
117
|
-
"@react-native/codegen": "0.74.
|
|
118
|
-
"@react-native/community-cli-plugin": "0.74.
|
|
119
|
-
"@react-native/gradle-plugin": "0.74.
|
|
120
|
-
"@react-native/js-polyfills": "0.74.
|
|
121
|
-
"@react-native/normalize-colors": "0.74.
|
|
116
|
+
"@react-native/assets-registry": "0.74.89",
|
|
117
|
+
"@react-native/codegen": "0.74.89",
|
|
118
|
+
"@react-native/community-cli-plugin": "0.74.89",
|
|
119
|
+
"@react-native/gradle-plugin": "0.74.89",
|
|
120
|
+
"@react-native/js-polyfills": "0.74.89",
|
|
121
|
+
"@react-native/normalize-colors": "0.74.89",
|
|
122
122
|
"abort-controller": "^3.0.0",
|
|
123
123
|
"anser": "^1.4.9",
|
|
124
124
|
"ansi-regex": "^5.0.0",
|
|
@@ -192,19 +192,7 @@ function create_universal_framework {
|
|
|
192
192
|
for i in "${!platforms[@]}"; do
|
|
193
193
|
local platform="${platforms[$i]}"
|
|
194
194
|
local hermes_framework_path="${platform}/hermes.framework"
|
|
195
|
-
local dSYM_path="$hermes_framework_path"
|
|
196
|
-
local dSYM_base_path="$HERMES_PATH/destroot/Library/Frameworks"
|
|
197
|
-
|
|
198
|
-
# If the dSYM rename has failed, the dSYM are generated as 0.dSYM
|
|
199
|
-
# (Apple default name) rather then hermes.framework.dSYM.
|
|
200
|
-
if [[ -e "$dSYM_base_path/${platform}/0.dSYM" ]]; then
|
|
201
|
-
dSYM_path="${platform}/0"
|
|
202
|
-
fi
|
|
203
|
-
|
|
204
195
|
args+="-framework $hermes_framework_path "
|
|
205
|
-
|
|
206
|
-
# Path to dSYM must be absolute
|
|
207
|
-
args+="-debug-symbols $dSYM_base_path/$dSYM_path.dSYM "
|
|
208
196
|
done
|
|
209
197
|
|
|
210
198
|
mkdir -p universal
|
package/template/Gemfile
CHANGED
package/template/package.json
CHANGED
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"react": "18.2.0",
|
|
15
|
-
"react-native-macos": "0.74.
|
|
15
|
+
"react-native-macos": "0.74.28"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@babel/core": "^7.20.0",
|
|
19
19
|
"@babel/preset-env": "^7.20.0",
|
|
20
20
|
"@babel/runtime": "^7.20.0",
|
|
21
|
-
"@react-native/babel-preset": "0.74.
|
|
22
|
-
"@react-native/eslint-config": "0.74.
|
|
23
|
-
"@react-native/metro-config": "0.74.
|
|
24
|
-
"@react-native/typescript-config": "0.74.
|
|
21
|
+
"@react-native/babel-preset": "0.74.89",
|
|
22
|
+
"@react-native/eslint-config": "0.74.89",
|
|
23
|
+
"@react-native/metro-config": "0.74.89",
|
|
24
|
+
"@react-native/typescript-config": "0.74.89",
|
|
25
25
|
"@types/react": "^18.2.6",
|
|
26
26
|
"@types/react-test-renderer": "^18.0.0",
|
|
27
27
|
"babel-jest": "^29.6.3",
|