react-native-windows 0.0.0-canary.992 → 0.0.0-canary.993
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/.flowconfig +3 -1
- package/Libraries/Animated/Animated.js +0 -1
- package/Libraries/Animated/Animated.js.flow +0 -1
- package/Libraries/Animated/AnimatedExports.js +0 -1
- package/Libraries/Animated/AnimatedExports.js.flow +1 -2
- package/Libraries/Animated/animations/Animation.js +5 -2
- package/Libraries/Animated/components/AnimatedScrollView.js +53 -52
- package/Libraries/Animated/createAnimatedComponent.js +37 -33
- package/Libraries/Animated/nodes/AnimatedObject.js +2 -3
- package/Libraries/Animated/nodes/AnimatedProps.js +1 -1
- package/Libraries/Animated/shouldUseTurboAnimatedModule.js +6 -1
- package/Libraries/AppState/AppState.js +6 -1
- package/Libraries/Components/ActivityIndicator/ActivityIndicator.js +19 -18
- package/Libraries/Components/Button.js +2 -2
- package/Libraries/Components/Button.windows.js +2 -3
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +2 -3
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +2 -1
- package/Libraries/Components/LayoutConformance/LayoutConformance.js +0 -1
- package/Libraries/Components/Pressable/Pressable.js +9 -6
- package/Libraries/Components/Pressable/Pressable.windows.js +9 -6
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +14 -13
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.js +13 -1
- package/Libraries/Components/ProgressBarAndroid/ProgressBarAndroidTypes.js +29 -20
- package/Libraries/Components/ScrollView/ScrollView.d.ts +9 -5
- package/Libraries/Components/ScrollView/ScrollView.js +18 -12
- package/Libraries/Components/ScrollView/ScrollView.windows.js +19 -12
- package/Libraries/Components/ScrollView/ScrollViewContext.js +2 -1
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -1
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +19 -6
- package/Libraries/Components/Switch/Switch.js +8 -2
- package/Libraries/Components/Switch/Switch.windows.js +8 -2
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.windows.js +1 -6
- package/Libraries/Components/TextInput/TextInput.js +26 -25
- package/Libraries/Components/TextInput/TextInput.windows.js +27 -25
- package/Libraries/Components/TextInput/WindowsTextInputNativeComponent.js +1 -5
- package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
- package/Libraries/Components/Touchable/TouchableBounce.windows.js +9 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
- package/Libraries/Components/Touchable/TouchableHighlight.windows.js +9 -4
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.windows.js +2 -1
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
- package/Libraries/Components/Touchable/TouchableOpacity.windows.js +7 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +2 -2
- package/Libraries/Components/View/View.js +111 -25
- package/Libraries/Components/View/View.windows.js +427 -227
- package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
- package/Libraries/Core/Devtools/loadBundleFromServer.windows.js +49 -7
- package/Libraries/Core/InitializeCore.js +1 -22
- package/Libraries/Core/ReactNativeVersion.js +3 -2
- package/Libraries/Debugging/DebuggingOverlay.js +6 -8
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +0 -1
- package/Libraries/Debugging/useSubscribeToDebuggingOverlayRegistry.js +0 -1
- package/Libraries/EventEmitter/NativeEventEmitter.js +1 -1
- package/Libraries/Image/AssetRegistry.js +4 -10
- package/Libraries/Image/AssetSourceResolver.js +17 -4
- package/Libraries/Image/AssetSourceResolver.windows.js +17 -4
- package/Libraries/Image/Image.android.js +112 -106
- package/Libraries/Image/Image.ios.js +10 -2
- package/Libraries/Image/Image.windows.js +30 -20
- package/Libraries/Image/ImageAnalyticsTagContext.js +2 -2
- package/Libraries/Image/RelativeImageStub.js +1 -0
- package/Libraries/Lists/FlatList.d.ts +9 -5
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +9 -3
- package/Libraries/LogBox/UI/LogBoxButton.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorReactFrames.windows.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorStackFrames.js +2 -1
- package/Libraries/ReactNative/AppContainer-dev.js +4 -4
- package/Libraries/ReactNative/AppContainer-prod.js +0 -1
- package/Libraries/ReactNative/RootTag.js +2 -2
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +21 -25
- package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +270 -0
- package/Libraries/StyleSheet/StyleSheetExports.js.flow +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.js +4 -3
- package/Libraries/StyleSheet/private/_TransformStyle.js +49 -21
- package/Libraries/StyleSheet/processBoxShadow.js +0 -1
- package/Libraries/StyleSheet/processFilter.js +0 -1
- package/Libraries/Text/Text.d.ts +1 -2
- package/Libraries/Text/Text.js +255 -244
- package/Libraries/Text/Text.windows.js +281 -300
- package/Libraries/Text/TextAncestor.js +3 -2
- package/Libraries/Text/TextProps.js +2 -34
- package/Libraries/Text/TextProps.windows.js +2 -34
- package/Libraries/Types/ReactDevToolsTypes.js +0 -1
- package/Libraries/Utilities/PerformanceLoggerContext.js +2 -2
- package/Libraries/Utilities/PlatformTypes.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +28 -4
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +1 -1
- package/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiShadowNode.h +1 -1
- package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentDescriptor.h +2 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +10 -9
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +21 -17
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.h +4 -4
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.cpp +19 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputState.h +76 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/textlayoutmanager/WindowsTextLayoutManager.cpp +6 -0
- package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +19 -2
- package/Microsoft.ReactNative/Utils/ThemeUtils.cpp +49 -0
- package/Microsoft.ReactNative/Utils/ThemeUtils.h +31 -0
- package/Microsoft.ReactNative/Views/ShadowNodeBase.cpp +36 -8
- package/Microsoft.ReactNative/Views/ShadowNodeRegistry.cpp +6 -2
- package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +9 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Base.h +45 -34
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bool.h +1 -1
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Bridging.h +1 -0
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Class.h +36 -33
- package/Microsoft.ReactNative.Cxx/ReactCommon/react/bridging/Number.h +10 -10
- package/PropertySheets/External/Microsoft.ReactNative.Cpp.Dependencies.props +10 -0
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/PropertySheets/React.Cpp.props +1 -1
- package/ReactCommon/ReactCommon.vcxproj +10 -19
- package/ReactCommon/ReactCommon.vcxproj.filters +36 -13
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/NativeToJsBridge.cpp +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/jsi/jsi/test/testlib.cpp +110 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/bridging/Bridging.h +1 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.cpp +19 -3
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/nativemodule/dom/NativeDOM.h +9 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/ParagraphShadowNode.cpp +459 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/text/platform/android/react/renderer/components/text/ParagraphState.h +92 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityPrimitives.h +35 -0
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/view/AccessibilityProps.cpp +28 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/css/CSSTokenizer.h +1 -2
- package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +2 -1
- package/Scripts/creaternwapp.cmd +11 -8
- package/Shared/HermesRuntimeHolder.cpp +3 -1
- package/Shared/Shared.vcxitems +5 -1
- package/Shared/Shared.vcxitems.filters +4 -0
- package/codegen/NativeDOMSpec.g.h +6 -0
- package/codegen/NativeIntersectionObserverSpec.g.h +19 -5
- package/codegen/NativeMutationObserverSpec.g.h +11 -5
- package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +104 -92
- package/codegen/react/components/rnwcore/States.h +8 -8
- package/codegen/rnwcoreJSI-generated.cpp +48 -3
- package/codegen/rnwcoreJSI.h +73 -10
- package/index.js +0 -1
- package/jest/mockNativeComponent.js +2 -1
- package/jest/renderer.js +0 -1
- package/jest/resolver.js +31 -0
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +6 -1
- package/src/private/animated/createAnimatedPropsHook.js +11 -4
- package/src/private/animated/createAnimatedPropsMemoHook.js +0 -1
- package/src/private/components/safeareaview/SafeAreaView_INTERNAL_DO_NOT_USE.js +0 -1
- package/src/private/components/scrollview/HScrollViewNativeComponents.js +0 -1
- package/src/private/components/scrollview/VScrollViewNativeComponents.js +0 -1
- package/src/private/devsupport/rndevtools/FuseboxSessionObserver.js +0 -1
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.android.js +8 -9
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.ios.js +12 -15
- package/src/private/devsupport/rndevtools/ReactDevToolsSettingsManager.windows.js +8 -9
- package/src/private/devsupport/rndevtools/setUpFuseboxReactDevToolsDispatcher.js +0 -1
- package/src/private/devsupport/rndevtools/specs/NativeReactDevToolsRuntimeSettingsModule.js +0 -1
- package/src/private/featureflags/ReactNativeFeatureFlags.js +39 -4
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -2
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +44 -0
- package/src/private/styles/composeStyles.js +12 -5
- package/src/private/webapis/dom/events/Event.js +3 -0
- package/src/private/webapis/dom/events/EventTarget.js +3 -0
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +6 -23
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +3 -1
- package/src/private/webapis/dom/nodes/specs/NativeDOM.js +38 -0
- package/src/private/webapis/dom/oldstylecollections/HTMLCollection.js +3 -0
- package/src/private/webapis/dom/oldstylecollections/NodeList.js +3 -0
- package/src/private/webapis/errors/DOMException.js +166 -0
- package/src/private/webapis/geometry/DOMRect.js +5 -0
- package/src/private/webapis/geometry/DOMRectList.js +3 -0
- package/src/private/webapis/geometry/DOMRectReadOnly.js +6 -0
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +15 -7
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +3 -0
- package/src/private/webapis/intersectionobserver/internals/IntersectionObserverManager.js +80 -18
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +12 -0
- package/src/private/webapis/mutationobserver/MutationObserver.js +23 -33
- package/src/private/webapis/mutationobserver/MutationRecord.js +3 -0
- package/src/private/webapis/mutationobserver/internals/MutationObserverManager.js +56 -24
- package/src/private/webapis/mutationobserver/specs/NativeMutationObserver.js +4 -1
- package/src/private/webapis/performance/MemoryInfo.js +4 -1
- package/src/private/webapis/performance/Performance.js +19 -8
- package/src/private/webapis/performance/PerformanceEntry.js +4 -0
- package/src/private/webapis/performance/ReactNativeStartupTiming.js +4 -1
- package/src/private/webapis/performance/internals/RawPerformanceEntry.js +2 -0
- package/src/private/webapis/structuredClone/structuredClone.js +233 -0
- package/src/private/webapis/webidl/PlatformObjects.js +59 -0
- package/src/types/globals.d.ts +42 -0
- package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -1
- package/types/index.d.ts +1 -1
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.cpp +0 -78
- package/ReactCommon/TEMP_UntilReactCommonUpdate/cxxreact/JSExecutor.h +0 -196
|
@@ -10,9 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
import type {ViewProps} from './ViewPropTypes';
|
|
12
12
|
|
|
13
|
+
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
13
14
|
import TextAncestor from '../../Text/TextAncestor';
|
|
14
15
|
import ViewNativeComponent from './ViewNativeComponent';
|
|
15
16
|
import * as React from 'react';
|
|
17
|
+
import {use} from 'react';
|
|
16
18
|
import invariant from 'invariant'; // [Windows]
|
|
17
19
|
// [Windows
|
|
18
20
|
import type {KeyEvent} from '../../Types/CoreEventTypes';
|
|
@@ -20,6 +22,11 @@ import type {KeyEvent} from '../../Types/CoreEventTypes';
|
|
|
20
22
|
|
|
21
23
|
export type Props = ViewProps;
|
|
22
24
|
|
|
25
|
+
type PropsWithRef = $ReadOnly<{
|
|
26
|
+
ref?: React.RefSetter<React.ElementRef<typeof ViewNativeComponent>>,
|
|
27
|
+
...ViewProps,
|
|
28
|
+
}>;
|
|
29
|
+
|
|
23
30
|
// [Windows
|
|
24
31
|
// $FlowFixMe - children typing
|
|
25
32
|
const childrenWithImportantForAccessibility = children => {
|
|
@@ -57,57 +64,270 @@ const childrenWithImportantForAccessibility = children => {
|
|
|
57
64
|
*
|
|
58
65
|
* @see https://reactnative.dev/docs/view
|
|
59
66
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
67
|
+
function View(props: PropsWithRef): React.Node {
|
|
68
|
+
const hasTextAncestor = use(TextAncestor);
|
|
69
|
+
|
|
70
|
+
// Extract common props needed by all paths
|
|
71
|
+
const {
|
|
72
|
+
accessibilityElementsHidden,
|
|
73
|
+
accessibilityLabel,
|
|
74
|
+
accessibilityLabelledBy,
|
|
75
|
+
accessibilityLevel, // Windows
|
|
76
|
+
accessibilityDescription, //Windows
|
|
77
|
+
accessibilityLiveRegion,
|
|
78
|
+
accessibilityPosInSet, // Windows
|
|
79
|
+
accessibilitySetSize, // Windows
|
|
80
|
+
accessibilityState,
|
|
81
|
+
accessibilityValue,
|
|
82
|
+
'aria-busy': ariaBusy,
|
|
83
|
+
'aria-checked': ariaChecked,
|
|
84
|
+
'aria-disabled': ariaDisabled,
|
|
85
|
+
'aria-expanded': ariaExpanded,
|
|
86
|
+
'aria-multiselectable': ariaMultiselectable, // Windows
|
|
87
|
+
'aria-required': ariaRequired, // Windows
|
|
88
|
+
'aria-description': ariaDescription, //Windows
|
|
89
|
+
'aria-hidden': ariaHidden,
|
|
90
|
+
'aria-label': ariaLabel,
|
|
91
|
+
'aria-labelledby': ariaLabelledBy,
|
|
92
|
+
'aria-level': ariaLevel,
|
|
93
|
+
'aria-live': ariaLive,
|
|
94
|
+
'aria-posinset': ariaPosinset, // Windows
|
|
95
|
+
'aria-readonly': ariaReadOnly, // Windows
|
|
96
|
+
'aria-selected': ariaSelected,
|
|
97
|
+
'aria-setsize': ariaSetsize, // Windows
|
|
98
|
+
'aria-valuemax': ariaValueMax,
|
|
99
|
+
'aria-valuemin': ariaValueMin,
|
|
100
|
+
'aria-valuenow': ariaValueNow,
|
|
101
|
+
'aria-valuetext': ariaValueText,
|
|
102
|
+
focusable,
|
|
103
|
+
disabled,
|
|
104
|
+
id,
|
|
105
|
+
importantForAccessibility,
|
|
106
|
+
nativeID,
|
|
107
|
+
tabIndex,
|
|
108
|
+
ref,
|
|
109
|
+
...otherProps
|
|
110
|
+
} = props;
|
|
111
|
+
|
|
112
|
+
// Pre-compute common values needed by both optimized and Paper paths
|
|
113
|
+
const _accessibilityLabelledBy =
|
|
114
|
+
ariaLabelledBy?.split(/\s*,\s*/g) ?? accessibilityLabelledBy;
|
|
115
|
+
|
|
116
|
+
const _accessibilityState =
|
|
117
|
+
accessibilityState != null ||
|
|
118
|
+
ariaBusy != null ||
|
|
119
|
+
ariaChecked != null ||
|
|
120
|
+
ariaDisabled != null ||
|
|
121
|
+
ariaExpanded != null ||
|
|
122
|
+
ariaSelected != null ||
|
|
123
|
+
ariaReadOnly != null || // Windows
|
|
124
|
+
ariaMultiselectable != null || // Windows
|
|
125
|
+
ariaRequired != null // Windows
|
|
126
|
+
? {
|
|
127
|
+
busy: ariaBusy ?? accessibilityState?.busy,
|
|
128
|
+
checked: ariaChecked ?? accessibilityState?.checked,
|
|
129
|
+
disabled: ariaDisabled ?? accessibilityState?.disabled,
|
|
130
|
+
expanded: ariaExpanded ?? accessibilityState?.expanded,
|
|
131
|
+
selected: ariaSelected ?? accessibilityState?.selected,
|
|
132
|
+
readOnly: ariaReadOnly ?? accessibilityState?.readOnly, // Windows
|
|
133
|
+
multiselectable:
|
|
134
|
+
ariaMultiselectable ?? accessibilityState?.multiselectable, // Windows
|
|
135
|
+
required: ariaRequired ?? accessibilityState?.required, // Windows
|
|
136
|
+
}
|
|
137
|
+
: undefined;
|
|
138
|
+
|
|
139
|
+
const _accessibilityValue =
|
|
140
|
+
accessibilityValue != null ||
|
|
141
|
+
ariaValueMax != null ||
|
|
142
|
+
ariaValueMin != null ||
|
|
143
|
+
ariaValueNow != null ||
|
|
144
|
+
ariaValueText != null
|
|
145
|
+
? {
|
|
146
|
+
max: ariaValueMax ?? accessibilityValue?.max,
|
|
147
|
+
min: ariaValueMin ?? accessibilityValue?.min,
|
|
148
|
+
now: ariaValueNow ?? accessibilityValue?.now,
|
|
149
|
+
text: ariaValueText ?? accessibilityValue?.text,
|
|
150
|
+
}
|
|
151
|
+
: undefined;
|
|
152
|
+
|
|
153
|
+
const _keyDown =
|
|
154
|
+
otherProps.keyDownEvents || otherProps.onKeyDown
|
|
155
|
+
? (event: KeyEvent) => {
|
|
156
|
+
if (
|
|
157
|
+
otherProps.keyDownEvents &&
|
|
158
|
+
event.isPropagationStopped() !== true
|
|
159
|
+
) {
|
|
160
|
+
// $FlowFixMe - keyDownEvents was already checked to not be undefined
|
|
161
|
+
for (const el of otherProps.keyDownEvents) {
|
|
162
|
+
if (
|
|
163
|
+
event.nativeEvent.code === el.code &&
|
|
164
|
+
el.handledEventPhase === 3
|
|
165
|
+
) {
|
|
166
|
+
event.stopPropagation();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
otherProps.onKeyDown && otherProps.onKeyDown(event);
|
|
171
|
+
}
|
|
172
|
+
: undefined;
|
|
173
|
+
|
|
174
|
+
const _keyUp =
|
|
175
|
+
otherProps.keyUpEvents || otherProps.onKeyUp
|
|
176
|
+
? (event: KeyEvent) => {
|
|
177
|
+
if (otherProps.keyUpEvents && event.isPropagationStopped() !== true) {
|
|
178
|
+
// $FlowFixMe - keyUpEvents was already checked to not be undefined
|
|
179
|
+
for (const el of otherProps.keyUpEvents) {
|
|
180
|
+
if (
|
|
181
|
+
event.nativeEvent.code === el.code &&
|
|
182
|
+
el.handledEventPhase === 3
|
|
183
|
+
) {
|
|
184
|
+
event.stopPropagation();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
otherProps.onKeyUp && otherProps.onKeyUp(event);
|
|
189
|
+
}
|
|
190
|
+
: undefined;
|
|
191
|
+
|
|
192
|
+
const _keyDownCapture =
|
|
193
|
+
otherProps.keyDownEvents || otherProps.onKeyDownCapture
|
|
194
|
+
? (event: KeyEvent) => {
|
|
195
|
+
if (
|
|
196
|
+
otherProps.keyDownEvents &&
|
|
197
|
+
event.isPropagationStopped() !== true
|
|
198
|
+
) {
|
|
199
|
+
// $FlowFixMe - keyDownEvents was already checked to not be undefined
|
|
200
|
+
for (const el of otherProps.keyDownEvents) {
|
|
201
|
+
if (
|
|
202
|
+
event.nativeEvent.code === el.code &&
|
|
203
|
+
el.handledEventPhase === 1
|
|
204
|
+
) {
|
|
205
|
+
event.stopPropagation();
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
otherProps.onKeyDownCapture && otherProps.onKeyDownCapture(event);
|
|
210
|
+
}
|
|
211
|
+
: undefined;
|
|
212
|
+
|
|
213
|
+
const _keyUpCapture =
|
|
214
|
+
otherProps.keyUpEvents || otherProps.onKeyUpCapture
|
|
215
|
+
? (event: KeyEvent) => {
|
|
216
|
+
if (otherProps.keyUpEvents && event.isPropagationStopped() !== true) {
|
|
217
|
+
// $FlowFixMe - keyUpEvents was already checked to not be undefined
|
|
218
|
+
for (const el of otherProps.keyUpEvents) {
|
|
219
|
+
if (
|
|
220
|
+
event.nativeEvent.code === el.code &&
|
|
221
|
+
el.handledEventPhase === 1
|
|
222
|
+
) {
|
|
223
|
+
event.stopPropagation();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
otherProps.onKeyUpCapture && otherProps.onKeyUpCapture(event);
|
|
228
|
+
}
|
|
229
|
+
: undefined;
|
|
230
|
+
|
|
231
|
+
// Windows computed values
|
|
232
|
+
const _focusable = tabIndex !== undefined ? !tabIndex : focusable;
|
|
233
|
+
const _accessible =
|
|
234
|
+
importantForAccessibility === 'no-hide-descendants'
|
|
235
|
+
? false
|
|
236
|
+
: otherProps.accessible;
|
|
237
|
+
|
|
238
|
+
if (_focusable === true && _accessible === false) {
|
|
239
|
+
console.warn(
|
|
240
|
+
'All focusable views should report proper accessibility information. Views marked as focusable should always be accessible.',
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const computedImportantForAccessibility =
|
|
245
|
+
ariaHidden === true ||
|
|
246
|
+
importantForAccessibility === 'no-hide-descendants' ||
|
|
247
|
+
accessibilityElementsHidden === true
|
|
248
|
+
? 'no-hide-descendants'
|
|
249
|
+
: importantForAccessibility;
|
|
250
|
+
|
|
251
|
+
let actualView;
|
|
252
|
+
if (ReactNativeFeatureFlags.reduceDefaultPropsInView()) {
|
|
253
|
+
//Destructured props at function scope, just create processedProps
|
|
254
|
+
const processedProps = otherProps as {...PropsWithRef};
|
|
255
|
+
|
|
256
|
+
const parsedAriaLabelledBy = ariaLabelledBy?.split(/\s*,\s*/g);
|
|
257
|
+
if (parsedAriaLabelledBy !== undefined) {
|
|
258
|
+
processedProps.accessibilityLabelledBy = parsedAriaLabelledBy;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (ariaLabel !== undefined) {
|
|
262
|
+
processedProps.accessibilityLabel = ariaLabel;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (ariaLive !== undefined) {
|
|
266
|
+
processedProps.accessibilityLiveRegion =
|
|
267
|
+
ariaLive === 'off' ? 'none' : ariaLive;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (ariaHidden !== undefined) {
|
|
271
|
+
processedProps.accessibilityElementsHidden = ariaHidden;
|
|
272
|
+
if (ariaHidden === true) {
|
|
273
|
+
processedProps.importantForAccessibility = 'no-hide-descendants';
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Windows accessibility properties
|
|
278
|
+
if (ariaLevel !== undefined) {
|
|
279
|
+
processedProps.accessibilityLevel = ariaLevel;
|
|
280
|
+
} else if (accessibilityLevel !== undefined) {
|
|
281
|
+
processedProps.accessibilityLevel = accessibilityLevel;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (ariaDescription !== undefined) {
|
|
285
|
+
processedProps.accessibilityDescription = ariaDescription;
|
|
286
|
+
} else if (accessibilityDescription !== undefined) {
|
|
287
|
+
processedProps.accessibilityDescription = accessibilityDescription;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if (ariaPosinset !== undefined) {
|
|
291
|
+
processedProps.accessibilityPosInSet = ariaPosinset;
|
|
292
|
+
} else if (accessibilityPosInSet !== undefined) {
|
|
293
|
+
processedProps.accessibilityPosInSet = accessibilityPosInSet;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (ariaSetsize !== undefined) {
|
|
297
|
+
processedProps.accessibilitySetSize = ariaSetsize;
|
|
298
|
+
} else if (accessibilitySetSize !== undefined) {
|
|
299
|
+
processedProps.accessibilitySetSize = accessibilitySetSize;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Windows base properties
|
|
303
|
+
if (focusable !== undefined) {
|
|
304
|
+
processedProps.focusable = tabIndex !== undefined ? !tabIndex : focusable;
|
|
305
|
+
} else if (tabIndex !== undefined) {
|
|
306
|
+
processedProps.focusable = !tabIndex;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (disabled !== undefined) {
|
|
310
|
+
processedProps.disabled = disabled;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (importantForAccessibility !== undefined) {
|
|
314
|
+
processedProps.importantForAccessibility = importantForAccessibility;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (nativeID !== undefined) {
|
|
318
|
+
processedProps.nativeID = nativeID;
|
|
319
|
+
}
|
|
320
|
+
// Windows]
|
|
321
|
+
|
|
322
|
+
if (id !== undefined) {
|
|
323
|
+
processedProps.nativeID = id;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (tabIndex !== undefined) {
|
|
327
|
+
processedProps.focusable = !tabIndex;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
if (
|
|
111
331
|
accessibilityState != null ||
|
|
112
332
|
ariaBusy != null ||
|
|
113
333
|
ariaChecked != null ||
|
|
@@ -117,138 +337,123 @@ const View: component(
|
|
|
117
337
|
ariaReadOnly != null || // Windows
|
|
118
338
|
ariaMultiselectable != null || // Windows
|
|
119
339
|
ariaRequired != null // Windows
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
340
|
+
) {
|
|
341
|
+
processedProps.accessibilityState = {
|
|
342
|
+
busy: ariaBusy ?? accessibilityState?.busy,
|
|
343
|
+
checked: ariaChecked ?? accessibilityState?.checked,
|
|
344
|
+
disabled: ariaDisabled ?? accessibilityState?.disabled,
|
|
345
|
+
expanded: ariaExpanded ?? accessibilityState?.expanded,
|
|
346
|
+
selected: ariaSelected ?? accessibilityState?.selected,
|
|
347
|
+
readOnly: ariaReadOnly ?? accessibilityState?.readOnly, // Windows
|
|
348
|
+
multiselectable:
|
|
349
|
+
ariaMultiselectable ?? accessibilityState?.multiselectable, // Windows
|
|
350
|
+
required: ariaRequired ?? accessibilityState?.required, // Windows
|
|
351
|
+
};
|
|
352
|
+
}
|
|
132
353
|
|
|
133
|
-
|
|
354
|
+
if (
|
|
134
355
|
accessibilityValue != null ||
|
|
135
356
|
ariaValueMax != null ||
|
|
136
357
|
ariaValueMin != null ||
|
|
137
358
|
ariaValueNow != null ||
|
|
138
359
|
ariaValueText != null
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
360
|
+
) {
|
|
361
|
+
processedProps.accessibilityValue = {
|
|
362
|
+
max: ariaValueMax ?? accessibilityValue?.max,
|
|
363
|
+
min: ariaValueMin ?? accessibilityValue?.min,
|
|
364
|
+
now: ariaValueNow ?? accessibilityValue?.now,
|
|
365
|
+
text: ariaValueText ?? accessibilityValue?.text,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
146
368
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
369
|
+
// [Windows key event processing and accessible property
|
|
370
|
+
if (otherProps.keyDownEvents || otherProps.onKeyDown) {
|
|
371
|
+
processedProps.onKeyDown = event => {
|
|
372
|
+
if (otherProps.keyDownEvents && event.isPropagationStopped() !== true) {
|
|
373
|
+
// $FlowFixMe - keyDownEvents was already checked to not be undefined
|
|
374
|
+
for (const el of otherProps.keyDownEvents) {
|
|
150
375
|
if (
|
|
151
|
-
|
|
152
|
-
|
|
376
|
+
event.nativeEvent.code === el.code &&
|
|
377
|
+
el.handledEventPhase === 3
|
|
153
378
|
) {
|
|
154
|
-
|
|
155
|
-
for (const el of otherProps.keyDownEvents) {
|
|
156
|
-
if (
|
|
157
|
-
event.nativeEvent.code === el.code &&
|
|
158
|
-
el.handledEventPhase === 3
|
|
159
|
-
) {
|
|
160
|
-
event.stopPropagation();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
379
|
+
event.stopPropagation();
|
|
163
380
|
}
|
|
164
|
-
otherProps.onKeyDown && otherProps.onKeyDown(event);
|
|
165
381
|
}
|
|
166
|
-
|
|
382
|
+
}
|
|
383
|
+
otherProps.onKeyDown && otherProps.onKeyDown(event);
|
|
384
|
+
};
|
|
385
|
+
}
|
|
167
386
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
387
|
+
if (otherProps.keyUpEvents || otherProps.onKeyUp) {
|
|
388
|
+
processedProps.onKeyUp = event => {
|
|
389
|
+
if (otherProps.keyUpEvents && event.isPropagationStopped() !== true) {
|
|
390
|
+
// $FlowFixMe - keyUpEvents was already checked to not be undefined
|
|
391
|
+
for (const el of otherProps.keyUpEvents) {
|
|
171
392
|
if (
|
|
172
|
-
|
|
173
|
-
|
|
393
|
+
event.nativeEvent.code === el.code &&
|
|
394
|
+
el.handledEventPhase === 3
|
|
174
395
|
) {
|
|
175
|
-
|
|
176
|
-
for (const el of otherProps.keyUpEvents) {
|
|
177
|
-
if (
|
|
178
|
-
event.nativeEvent.code === el.code &&
|
|
179
|
-
el.handledEventPhase === 3
|
|
180
|
-
) {
|
|
181
|
-
event.stopPropagation();
|
|
182
|
-
}
|
|
183
|
-
}
|
|
396
|
+
event.stopPropagation();
|
|
184
397
|
}
|
|
185
|
-
otherProps.onKeyUp && otherProps.onKeyUp(event);
|
|
186
398
|
}
|
|
187
|
-
|
|
399
|
+
}
|
|
400
|
+
otherProps.onKeyUp && otherProps.onKeyUp(event);
|
|
401
|
+
};
|
|
402
|
+
}
|
|
188
403
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
404
|
+
if (otherProps.keyDownEvents || otherProps.onKeyDownCapture) {
|
|
405
|
+
processedProps.onKeyDownCapture = event => {
|
|
406
|
+
if (otherProps.keyDownEvents && event.isPropagationStopped() !== true) {
|
|
407
|
+
// $FlowFixMe - keyDownEvents was already checked to not be undefined
|
|
408
|
+
for (const el of otherProps.keyDownEvents) {
|
|
192
409
|
if (
|
|
193
|
-
|
|
194
|
-
|
|
410
|
+
event.nativeEvent.code === el.code &&
|
|
411
|
+
el.handledEventPhase === 1
|
|
195
412
|
) {
|
|
196
|
-
|
|
197
|
-
for (const el of otherProps.keyDownEvents) {
|
|
198
|
-
if (
|
|
199
|
-
event.nativeEvent.code === el.code &&
|
|
200
|
-
el.handledEventPhase === 1
|
|
201
|
-
) {
|
|
202
|
-
event.stopPropagation();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
413
|
+
event.stopPropagation();
|
|
205
414
|
}
|
|
206
|
-
otherProps.onKeyDownCapture && otherProps.onKeyDownCapture(event);
|
|
207
415
|
}
|
|
208
|
-
|
|
416
|
+
}
|
|
417
|
+
otherProps.onKeyDownCapture && otherProps.onKeyDownCapture(event);
|
|
418
|
+
};
|
|
419
|
+
}
|
|
209
420
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
421
|
+
if (otherProps.keyUpEvents || otherProps.onKeyUpCapture) {
|
|
422
|
+
processedProps.onKeyUpCapture = event => {
|
|
423
|
+
if (otherProps.keyUpEvents && event.isPropagationStopped() !== true) {
|
|
424
|
+
// $FlowFixMe - keyUpEvents was already checked to not be undefined
|
|
425
|
+
for (const el of otherProps.keyUpEvents) {
|
|
213
426
|
if (
|
|
214
|
-
|
|
215
|
-
|
|
427
|
+
event.nativeEvent.code === el.code &&
|
|
428
|
+
el.handledEventPhase === 1
|
|
216
429
|
) {
|
|
217
|
-
|
|
218
|
-
for (const el of otherProps.keyUpEvents) {
|
|
219
|
-
if (
|
|
220
|
-
event.nativeEvent.code === el.code &&
|
|
221
|
-
el.handledEventPhase === 1
|
|
222
|
-
) {
|
|
223
|
-
event.stopPropagation();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
430
|
+
event.stopPropagation();
|
|
226
431
|
}
|
|
227
|
-
otherProps.onKeyUpCapture && otherProps.onKeyUpCapture(event);
|
|
228
432
|
}
|
|
229
|
-
|
|
433
|
+
}
|
|
434
|
+
otherProps.onKeyUpCapture && otherProps.onKeyUpCapture(event);
|
|
435
|
+
};
|
|
436
|
+
}
|
|
230
437
|
|
|
231
|
-
//
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
importantForAccessibility === 'no-hide-descendants'
|
|
438
|
+
// Windows accessible property
|
|
439
|
+
const computedAccessible =
|
|
440
|
+
processedProps.importantForAccessibility === 'no-hide-descendants'
|
|
235
441
|
? false
|
|
236
442
|
: otherProps.accessible;
|
|
443
|
+
if (computedAccessible !== undefined) {
|
|
444
|
+
processedProps.accessible = computedAccessible;
|
|
445
|
+
}
|
|
237
446
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
);
|
|
447
|
+
//Windows add ref to processedProps
|
|
448
|
+
if (ref !== undefined) {
|
|
449
|
+
processedProps.ref = ref;
|
|
242
450
|
}
|
|
243
451
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
accessibilityElementsHidden === true
|
|
248
|
-
? 'no-hide-descendants'
|
|
249
|
-
: importantForAccessibility;
|
|
452
|
+
actualView = <ViewNativeComponent {...processedProps} />;
|
|
453
|
+
} else {
|
|
454
|
+
// Destructured props at function scope
|
|
250
455
|
|
|
251
|
-
|
|
456
|
+
actualView = (
|
|
252
457
|
<ViewNativeComponent
|
|
253
458
|
{...otherProps}
|
|
254
459
|
accessibilityLiveRegion={
|
|
@@ -267,90 +472,85 @@ const View: component(
|
|
|
267
472
|
accessibilityValue={_accessibilityValue}
|
|
268
473
|
importantForAccessibility={computedImportantForAccessibility}
|
|
269
474
|
nativeID={id ?? nativeID}
|
|
270
|
-
ref={forwardedRef}
|
|
271
|
-
onKeyDown={_keyDown}
|
|
272
|
-
onKeyDownCapture={_keyDownCapture}
|
|
273
|
-
onKeyUp={_keyUp}
|
|
274
|
-
onKeyUpCapture={_keyUpCapture}
|
|
275
475
|
// [Windows
|
|
276
476
|
accessible={_accessible}
|
|
277
477
|
children={otherProps.children}
|
|
278
478
|
// Windows]
|
|
279
479
|
/>
|
|
280
480
|
);
|
|
481
|
+
}
|
|
281
482
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return (
|
|
342
|
-
<TextAncestor.Provider value={false}>
|
|
343
|
-
{actualView}
|
|
344
|
-
</TextAncestor.Provider>
|
|
345
|
-
);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
// Windows]
|
|
483
|
+
// [Windows - Paper doesn't support Views in Text while Fabric does
|
|
484
|
+
if (global.RN$Bridgeless !== true) {
|
|
485
|
+
return (
|
|
486
|
+
// [Windows
|
|
487
|
+
// In core this is a TextAncestor.Provider value={false} See
|
|
488
|
+
// https://github.com/facebook/react-native/commit/66601e755fcad10698e61d20878d52194ad0e90c
|
|
489
|
+
// But since Views are not currently supported in Text, we do not need the extra provider
|
|
490
|
+
<TextAncestor.Consumer>
|
|
491
|
+
{consumerHasTextAncestor => {
|
|
492
|
+
invariant(
|
|
493
|
+
!hasTextAncestor,
|
|
494
|
+
'Nesting of <View> within <Text> is not currently supported.',
|
|
495
|
+
);
|
|
496
|
+
return (
|
|
497
|
+
<ViewNativeComponent
|
|
498
|
+
{...otherProps}
|
|
499
|
+
accessibilityLiveRegion={
|
|
500
|
+
ariaLive === 'off'
|
|
501
|
+
? 'none'
|
|
502
|
+
: ariaLive ?? accessibilityLiveRegion
|
|
503
|
+
}
|
|
504
|
+
accessibilityLabel={ariaLabel ?? accessibilityLabel}
|
|
505
|
+
accessibilityLevel={ariaLevel ?? accessibilityLevel}
|
|
506
|
+
accessibilityDescription={
|
|
507
|
+
ariaDescription ?? accessibilityDescription
|
|
508
|
+
}
|
|
509
|
+
accessibilityPosInSet={ariaPosinset ?? accessibilityPosInSet}
|
|
510
|
+
accessibilitySetSize={ariaSetsize ?? accessibilitySetSize}
|
|
511
|
+
focusable={_focusable}
|
|
512
|
+
disabled={disabled}
|
|
513
|
+
accessibilityState={_accessibilityState}
|
|
514
|
+
accessibilityElementsHidden={
|
|
515
|
+
ariaHidden ?? accessibilityElementsHidden
|
|
516
|
+
}
|
|
517
|
+
accessibilityLabelledBy={_accessibilityLabelledBy}
|
|
518
|
+
accessibilityValue={_accessibilityValue}
|
|
519
|
+
importantForAccessibility={computedImportantForAccessibility}
|
|
520
|
+
nativeID={id ?? nativeID}
|
|
521
|
+
ref={ref}
|
|
522
|
+
onKeyDown={_keyDown}
|
|
523
|
+
onKeyDownCapture={_keyDownCapture}
|
|
524
|
+
onKeyUp={_keyUp}
|
|
525
|
+
onKeyUpCapture={_keyUpCapture}
|
|
526
|
+
// [Windows
|
|
527
|
+
accessible={_accessible}
|
|
528
|
+
children={
|
|
529
|
+
computedImportantForAccessibility === 'no-hide-descendants'
|
|
530
|
+
? childrenWithImportantForAccessibility(otherProps.children)
|
|
531
|
+
: otherProps.children
|
|
532
|
+
}
|
|
533
|
+
// Windows]
|
|
534
|
+
/>
|
|
535
|
+
);
|
|
536
|
+
}}
|
|
537
|
+
</TextAncestor.Consumer>
|
|
538
|
+
// Windows]
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
// Windows]
|
|
349
542
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
)
|
|
543
|
+
// Fabric supports Views in Text, so we can use the TextAncestor context
|
|
544
|
+
// [Windows
|
|
545
|
+
if (hasTextAncestor) {
|
|
546
|
+
return <TextAncestor value={false}>{actualView}</TextAncestor>;
|
|
547
|
+
}
|
|
548
|
+
// Windows]
|
|
353
549
|
|
|
354
|
-
|
|
550
|
+
return actualView;
|
|
551
|
+
}
|
|
355
552
|
|
|
356
|
-
export default View
|
|
553
|
+
export default View as component(
|
|
554
|
+
ref?: React.RefSetter<React.ElementRef<typeof ViewNativeComponent>>,
|
|
555
|
+
...props: ViewProps
|
|
556
|
+
);
|