react-native-windows 0.0.0-canary.595 → 0.0.0-canary.597
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.
|
@@ -289,22 +289,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
289
289
|
const viewRef = useRef<React.ElementRef<typeof View> | null>(null);
|
|
290
290
|
useImperativeHandle(forwardedRef, () => viewRef.current);
|
|
291
291
|
|
|
292
|
-
// [Windows
|
|
293
|
-
const _onBlur = (event: BlurEvent) => {
|
|
294
|
-
TextInputState.blurInput(viewRef.current);
|
|
295
|
-
if (props.onBlur) {
|
|
296
|
-
props.onBlur(event);
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
const _onFocus = (event: FocusEvent) => {
|
|
301
|
-
TextInputState.focusInput(viewRef.current);
|
|
302
|
-
if (props.onFocus) {
|
|
303
|
-
props.onFocus(event);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
// Windows]
|
|
307
|
-
|
|
308
292
|
const android_rippleConfig = useAndroidRippleForView(android_ripple, viewRef);
|
|
309
293
|
|
|
310
294
|
const [pressed, setPressed] = usePressState(testOnly_pressed === true);
|
|
@@ -418,10 +402,6 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
418
402
|
<View
|
|
419
403
|
{...restPropsWithDefaults}
|
|
420
404
|
{...eventHandlers}
|
|
421
|
-
// [Windows
|
|
422
|
-
onBlur={_onBlur}
|
|
423
|
-
onFocus={_onFocus}
|
|
424
|
-
// Windows]
|
|
425
405
|
ref={viewRef}
|
|
426
406
|
style={typeof style === 'function' ? style({pressed}) : style}>
|
|
427
407
|
{typeof children === 'function' ? children({pressed}) : children}
|
|
@@ -69,7 +69,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
69
69
|
UpdateOptimizedText();
|
|
70
70
|
} else if (wasOptimized) {
|
|
71
71
|
// Remove optimized text and re-construct as Inline tree
|
|
72
|
-
UpdateOptimizedText();
|
|
72
|
+
UpdateOptimizedText(true);
|
|
73
73
|
if (const auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
|
|
74
74
|
for (size_t i = 0; i < m_children.size(); ++i) {
|
|
75
75
|
if (const auto childNode =
|
|
@@ -88,8 +88,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
88
88
|
|
|
89
89
|
void removeAllChildren() override {
|
|
90
90
|
if (m_isTextOptimized) {
|
|
91
|
-
|
|
92
|
-
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
91
|
+
UpdateOptimizedText();
|
|
93
92
|
} else {
|
|
94
93
|
Super::removeAllChildren();
|
|
95
94
|
}
|
|
@@ -107,7 +106,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
107
106
|
GetViewManager()->MarkDirty(m_tag);
|
|
108
107
|
}
|
|
109
108
|
|
|
110
|
-
void UpdateOptimizedText() {
|
|
109
|
+
void UpdateOptimizedText(bool clearOptimizedText = false) {
|
|
111
110
|
if (m_children.size() > 0 && m_isTextOptimized) {
|
|
112
111
|
if (const auto uiManager = GetNativeUIManager(GetViewManager()->GetReactContext()).lock()) {
|
|
113
112
|
winrt::hstring text = L"";
|
|
@@ -120,7 +119,7 @@ class TextShadowNode final : public ShadowNodeBase {
|
|
|
120
119
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
121
120
|
textBlock.Text(text);
|
|
122
121
|
}
|
|
123
|
-
} else {
|
|
122
|
+
} else if (m_isTextOptimized || clearOptimizedText) {
|
|
124
123
|
auto textBlock = this->GetView().as<xaml::Controls::TextBlock>();
|
|
125
124
|
textBlock.ClearValue(xaml::Controls::TextBlock::TextProperty());
|
|
126
125
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.0.0-canary.
|
|
13
|
+
<ReactNativeWindowsVersion>0.0.0-canary.597</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>0</ReactNativeWindowsMinor>
|
|
16
16
|
<ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.597",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-native-community/cli": "10.0.0-alpha.5",
|
|
27
27
|
"@react-native-community/cli-platform-android": "10.0.0-alpha.4",
|
|
28
28
|
"@react-native-community/cli-platform-ios": "10.0.0-alpha.3",
|
|
29
|
-
"@react-native-windows/cli": "0.0.0-canary.
|
|
29
|
+
"@react-native-windows/cli": "0.0.0-canary.156",
|
|
30
30
|
"@react-native/assets": "1.0.0",
|
|
31
31
|
"@react-native/normalize-color": "2.1.0",
|
|
32
32
|
"@react-native/polyfills": "2.0.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"ws": "^6.2.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@react-native-windows/codegen": "0.0.0-canary.
|
|
63
|
+
"@react-native-windows/codegen": "0.0.0-canary.47",
|
|
64
64
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
65
65
|
"@rnw-scripts/eslint-config": "1.1.15",
|
|
66
66
|
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.1",
|