@office-iss/react-native-win32 0.0.0-canary.296 → 0.0.0-canary.297
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/CHANGELOG.json +22 -1
- package/CHANGELOG.md +13 -4
- 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.win32.js +2 -2
- 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.win32.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/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/TextInput/AndroidTextInputNativeComponent.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -5
- package/Libraries/Components/TextInput/TextInput.flow.win32.js +1 -5
- package/Libraries/Components/TextInput/TextInput.js +26 -25
- package/Libraries/Components/TextInput/TextInput.win32.js +27 -25
- package/Libraries/Components/Touchable/TouchableBounce.js +9 -3
- package/Libraries/Components/Touchable/TouchableHighlight.js +9 -4
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +7 -3
- package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +2 -2
- package/Libraries/Components/View/View.js +111 -25
- package/Libraries/Core/Devtools/loadBundleFromServer.js +49 -7
- package/Libraries/Core/Devtools/loadBundleFromServer.win32.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/Image.android.js +112 -106
- package/Libraries/Image/Image.ios.js +10 -2
- package/Libraries/Image/Image.win32.js +11 -3
- 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.win32.js +2 -1
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.js +3 -2
- package/Libraries/LogBox/UI/LogBoxInspectorSourceMapStatus.win32.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.win32.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 +7 -0
- package/Libraries/Text/Text.js +255 -244
- package/Libraries/Text/Text.win32.js +293 -284
- package/Libraries/Text/TextAncestor.js +3 -2
- package/Libraries/Text/TextProps.js +2 -34
- package/Libraries/Text/TextProps.win32.js +2 -33
- 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/index.js +0 -1
- package/jest/mockNativeComponent.js +2 -1
- package/jest/renderer.js +0 -1
- package/jest/resolver.js +31 -0
- package/jest/setup.js +1 -1
- package/overrides.json +27 -20
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +6 -1
- package/src/private/animated/NativeAnimatedHelper.win32.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.win32.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/src-win/Libraries/Text/Text.d.ts +7 -0
- package/types/index.d.ts +1 -1
|
@@ -39,23 +39,24 @@ export type {ProgressBarAndroidProps};
|
|
|
39
39
|
* },
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
|
-
const
|
|
42
|
+
const ProgressBarAndroid: component(
|
|
43
43
|
ref?: React.RefSetter<
|
|
44
44
|
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
|
45
45
|
>,
|
|
46
46
|
...props: ProgressBarAndroidProps
|
|
47
|
-
) =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
) = function ProgressBarAndroid({
|
|
48
|
+
ref: forwardedRef,
|
|
49
|
+
// $FlowFixMe[incompatible-type]
|
|
50
|
+
styleAttr = 'Normal',
|
|
51
|
+
indeterminate = true,
|
|
52
|
+
animating = true,
|
|
53
|
+
...restProps
|
|
54
|
+
}: {
|
|
55
|
+
ref?: React.RefSetter<
|
|
56
56
|
React.ElementRef<typeof ProgressBarAndroidNativeComponent>,
|
|
57
57
|
>,
|
|
58
|
-
|
|
58
|
+
...ProgressBarAndroidProps,
|
|
59
|
+
}) {
|
|
59
60
|
return (
|
|
60
61
|
<ProgressBarAndroidNativeComponent
|
|
61
62
|
styleAttr={styleAttr}
|
|
@@ -65,6 +66,6 @@ const ProgressBarAndroidWithForwardedRef: component(
|
|
|
65
66
|
ref={forwardedRef}
|
|
66
67
|
/>
|
|
67
68
|
);
|
|
68
|
-
}
|
|
69
|
+
};
|
|
69
70
|
|
|
70
|
-
export default
|
|
71
|
+
export default ProgressBarAndroid;
|
|
@@ -17,11 +17,23 @@ import Platform from '../../Utilities/Platform';
|
|
|
17
17
|
|
|
18
18
|
export type {ProgressBarAndroidProps};
|
|
19
19
|
|
|
20
|
+
// A utility type to preserve the semantics of the union uses in the definition
|
|
21
|
+
// of ProgressBarAndroidProps. TS's Omit does not distribute over unions, so
|
|
22
|
+
// we define our own version which does. This does not affect Flow.
|
|
23
|
+
// $FlowExpectedError[unclear-type]
|
|
24
|
+
type Omit<T, K> = T extends any ? Pick<T, Exclude<$Keys<T>, K>> : T;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* ProgressBarAndroid has been extracted from react-native core and will be removed in a future release.
|
|
28
|
+
* It can now be installed and imported from `@react-native-community/progress-bar-android` instead of 'react-native'.
|
|
29
|
+
* @see https://github.com/react-native-community/progress-bar-android
|
|
30
|
+
* @deprecated
|
|
31
|
+
*/
|
|
20
32
|
let ProgressBarAndroid: component(
|
|
21
33
|
ref?: React.RefSetter<
|
|
22
34
|
React.ElementRef<ProgressBarAndroidNativeComponentType>,
|
|
23
35
|
>,
|
|
24
|
-
...props: ProgressBarAndroidProps
|
|
36
|
+
...props: Omit<ProgressBarAndroidProps, empty>
|
|
25
37
|
);
|
|
26
38
|
|
|
27
39
|
if (Platform.OS === 'android') {
|
|
@@ -17,28 +17,25 @@ import type {ViewProps} from '../View/ViewPropTypes';
|
|
|
17
17
|
* `indeterminate` can only be false if `styleAttr` is Horizontal, and requires a
|
|
18
18
|
* `progress` value.
|
|
19
19
|
*/
|
|
20
|
-
type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
| {
|
|
27
|
-
styleAttr:
|
|
28
|
-
| 'Horizontal'
|
|
29
|
-
| 'Normal'
|
|
30
|
-
| 'Small'
|
|
31
|
-
| 'Large'
|
|
32
|
-
| 'Inverse'
|
|
33
|
-
| 'SmallInverse'
|
|
34
|
-
| 'LargeInverse',
|
|
35
|
-
indeterminate: true,
|
|
36
|
-
};
|
|
20
|
+
type DeterminateProgressBarAndroidStyleAttrProp = {
|
|
21
|
+
styleAttr: 'Horizontal',
|
|
22
|
+
indeterminate: false,
|
|
23
|
+
progress: number,
|
|
24
|
+
};
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
type IndeterminateProgressBarAndroidStyleAttrProp = {
|
|
27
|
+
styleAttr:
|
|
28
|
+
| 'Horizontal'
|
|
29
|
+
| 'Normal'
|
|
30
|
+
| 'Small'
|
|
31
|
+
| 'Large'
|
|
32
|
+
| 'Inverse'
|
|
33
|
+
| 'SmallInverse'
|
|
34
|
+
| 'LargeInverse',
|
|
35
|
+
indeterminate: true,
|
|
36
|
+
};
|
|
41
37
|
|
|
38
|
+
type ProgressBarAndroidBaseProps = $ReadOnly<{
|
|
42
39
|
/**
|
|
43
40
|
* Whether to show the ProgressBar (true, the default) or hide it (false).
|
|
44
41
|
*/
|
|
@@ -52,3 +49,15 @@ export type ProgressBarAndroidProps = $ReadOnly<{
|
|
|
52
49
|
*/
|
|
53
50
|
testID?: ?string,
|
|
54
51
|
}>;
|
|
52
|
+
|
|
53
|
+
export type ProgressBarAndroidProps =
|
|
54
|
+
| $ReadOnly<{
|
|
55
|
+
...ViewProps,
|
|
56
|
+
...ProgressBarAndroidBaseProps,
|
|
57
|
+
...DeterminateProgressBarAndroidStyleAttrProp,
|
|
58
|
+
}>
|
|
59
|
+
| $ReadOnly<{
|
|
60
|
+
...ViewProps,
|
|
61
|
+
...ProgressBarAndroidBaseProps,
|
|
62
|
+
...IndeterminateProgressBarAndroidStyleAttrProp,
|
|
63
|
+
}>;
|
|
@@ -565,16 +565,20 @@ export interface ScrollViewPropsAndroid {
|
|
|
565
565
|
nestedScrollEnabled?: boolean | undefined;
|
|
566
566
|
|
|
567
567
|
/**
|
|
568
|
-
*
|
|
568
|
+
* Controls the fading effect at the edges of the scroll content.
|
|
569
569
|
*
|
|
570
|
-
*
|
|
571
|
-
* to
|
|
572
|
-
*
|
|
570
|
+
* A value greater than 0 will apply the fading effect, indicating more content is available
|
|
571
|
+
* to scroll.
|
|
572
|
+
*
|
|
573
|
+
* You can specify a single number to apply the same fading length to both edges.
|
|
574
|
+
* Alternatively, use an object with `start` and `end` properties to set different
|
|
575
|
+
* fading lengths for the start and end of the scroll content.
|
|
573
576
|
*
|
|
574
577
|
* The default value is 0.
|
|
578
|
+
*
|
|
575
579
|
* @platform android
|
|
576
580
|
*/
|
|
577
|
-
fadingEdgeLength?: number | undefined;
|
|
581
|
+
fadingEdgeLength?: number | {start: number; end: number} | undefined;
|
|
578
582
|
|
|
579
583
|
/**
|
|
580
584
|
* Causes the scrollbars not to turn transparent when they are not in use. The default value is false.
|
|
@@ -52,6 +52,7 @@ import invariant from 'invariant';
|
|
|
52
52
|
import memoize from 'memoize-one';
|
|
53
53
|
import nullthrows from 'nullthrows';
|
|
54
54
|
import * as React from 'react';
|
|
55
|
+
import {cloneElement} from 'react';
|
|
55
56
|
|
|
56
57
|
/*
|
|
57
58
|
* iOS scroll event timing nuances:
|
|
@@ -372,17 +373,20 @@ export type ScrollViewPropsAndroid = $ReadOnly<{
|
|
|
372
373
|
*/
|
|
373
374
|
persistentScrollbar?: ?boolean,
|
|
374
375
|
/**
|
|
375
|
-
*
|
|
376
|
+
* Controls the fading effect at the edges of the scroll content.
|
|
376
377
|
*
|
|
377
|
-
*
|
|
378
|
-
* to
|
|
379
|
-
*
|
|
378
|
+
* A value greater than 0 will apply the fading effect, indicating more content is available
|
|
379
|
+
* to scroll.
|
|
380
|
+
*
|
|
381
|
+
* You can specify a single number to apply the same fading length to both edges.
|
|
382
|
+
* Alternatively, use an object with `start` and `end` properties to set different
|
|
383
|
+
* fading lengths for the start and end of the scroll content.
|
|
380
384
|
*
|
|
381
385
|
* The default value is 0.
|
|
382
386
|
*
|
|
383
387
|
* @platform android
|
|
384
388
|
*/
|
|
385
|
-
fadingEdgeLength?: ?number,
|
|
389
|
+
fadingEdgeLength?: ?number | {start: number, end: number},
|
|
386
390
|
}>;
|
|
387
391
|
|
|
388
392
|
type StickyHeaderComponentType = component(
|
|
@@ -1827,7 +1831,7 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
|
|
|
1827
1831
|
// however, the ScrollView still needs the baseStyle to be scrollable
|
|
1828
1832
|
const {outer, inner} = splitLayoutProps(flattenStyle(props.style));
|
|
1829
1833
|
// $FlowFixMe[incompatible-call]
|
|
1830
|
-
return
|
|
1834
|
+
return cloneElement(
|
|
1831
1835
|
refreshControl,
|
|
1832
1836
|
{style: StyleSheet.compose(baseStyle, outer)},
|
|
1833
1837
|
<NativeScrollView
|
|
@@ -1907,23 +1911,25 @@ function createRefForwarder<TNativeInstance, TPublicInstance>(
|
|
|
1907
1911
|
return state;
|
|
1908
1912
|
}
|
|
1909
1913
|
|
|
1910
|
-
// TODO: After upgrading to React 19, remove `forwardRef` from this component.
|
|
1911
1914
|
// NOTE: This wrapper component is necessary because `ScrollView` is a class
|
|
1912
1915
|
// component and we need to map `ref` to a differently named prop. This can be
|
|
1913
1916
|
// removed when `ScrollView` is a functional component.
|
|
1914
1917
|
const ScrollViewWrapper: component(
|
|
1915
1918
|
ref?: React.RefSetter<PublicScrollViewInstance>,
|
|
1916
1919
|
...props: ScrollViewProps
|
|
1917
|
-
) =
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1920
|
+
) = function Wrapper({
|
|
1921
|
+
ref,
|
|
1922
|
+
...props
|
|
1923
|
+
}: {
|
|
1924
|
+
ref?: React.RefSetter<PublicScrollViewInstance>,
|
|
1925
|
+
...ScrollViewProps,
|
|
1926
|
+
}): React.Node {
|
|
1921
1927
|
return ref == null ? (
|
|
1922
1928
|
<ScrollView {...props} />
|
|
1923
1929
|
) : (
|
|
1924
1930
|
<ScrollView {...props} scrollViewRef={ref} />
|
|
1925
1931
|
);
|
|
1926
|
-
}
|
|
1932
|
+
};
|
|
1927
1933
|
ScrollViewWrapper.displayName = 'ScrollView';
|
|
1928
1934
|
// $FlowExpectedError[prop-missing]
|
|
1929
1935
|
ScrollViewWrapper.Context = ScrollViewContext;
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import * as React from 'react';
|
|
12
|
+
import {createContext} from 'react';
|
|
12
13
|
|
|
13
14
|
type Value = {horizontal: boolean} | null;
|
|
14
15
|
|
|
15
|
-
const ScrollViewContext: React.Context<Value> =
|
|
16
|
+
const ScrollViewContext: React.Context<Value> = createContext(null);
|
|
16
17
|
if (__DEV__) {
|
|
17
18
|
ScrollViewContext.displayName = 'ScrollViewContext';
|
|
18
19
|
}
|
|
@@ -42,7 +42,7 @@ export type ScrollViewNativeProps = $ReadOnly<{
|
|
|
42
42
|
directionalLockEnabled?: ?boolean,
|
|
43
43
|
disableIntervalMomentum?: ?boolean,
|
|
44
44
|
endFillColor?: ?ColorValue,
|
|
45
|
-
fadingEdgeLength?: ?number,
|
|
45
|
+
fadingEdgeLength?: ?number | {start: number, end: number},
|
|
46
46
|
indicatorStyle?: ?('default' | 'black' | 'white'),
|
|
47
47
|
isInvertedVirtualizedList?: ?boolean,
|
|
48
48
|
keyboardDismissMode?: ?('none' | 'on-drag' | 'interactive'),
|
|
@@ -16,7 +16,14 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
|
16
16
|
import Platform from '../../Utilities/Platform';
|
|
17
17
|
import useMergeRefs from '../../Utilities/useMergeRefs';
|
|
18
18
|
import * as React from 'react';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
cloneElement,
|
|
21
|
+
useCallback,
|
|
22
|
+
useEffect,
|
|
23
|
+
useMemo,
|
|
24
|
+
useRef,
|
|
25
|
+
useState,
|
|
26
|
+
} from 'react';
|
|
20
27
|
|
|
21
28
|
export type ScrollViewStickyHeaderProps = $ReadOnly<{
|
|
22
29
|
children?: React.Node,
|
|
@@ -36,10 +43,16 @@ interface Instance extends React.ElementRef<typeof Animated.View> {
|
|
|
36
43
|
+setNextHeaderY: number => void;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
const
|
|
46
|
+
const ScrollViewStickyHeader: component(
|
|
40
47
|
ref: React.RefSetter<Instance>,
|
|
41
48
|
...props: ScrollViewStickyHeaderProps
|
|
42
|
-
) =
|
|
49
|
+
) = function ScrollViewStickyHeader({
|
|
50
|
+
ref: forwardedRef,
|
|
51
|
+
...props
|
|
52
|
+
}: {
|
|
53
|
+
ref?: React.RefSetter<Instance>,
|
|
54
|
+
...ScrollViewStickyHeaderProps,
|
|
55
|
+
}) {
|
|
43
56
|
const {
|
|
44
57
|
inverted,
|
|
45
58
|
scrollViewHeight,
|
|
@@ -289,13 +302,13 @@ const ScrollViewStickyHeaderWithForwardedRef: component(
|
|
|
289
302
|
passthroughAnimatedPropExplicitValues={
|
|
290
303
|
passthroughAnimatedPropExplicitValues
|
|
291
304
|
}>
|
|
292
|
-
{
|
|
305
|
+
{cloneElement(child, {
|
|
293
306
|
style: styles.fill, // We transfer the child style to the wrapper.
|
|
294
307
|
onLayout: undefined, // we call this manually through our this._onLayout
|
|
295
308
|
})}
|
|
296
309
|
</Animated.View>
|
|
297
310
|
);
|
|
298
|
-
}
|
|
311
|
+
};
|
|
299
312
|
|
|
300
313
|
const styles = StyleSheet.create({
|
|
301
314
|
header: {
|
|
@@ -306,4 +319,4 @@ const styles = StyleSheet.create({
|
|
|
306
319
|
},
|
|
307
320
|
});
|
|
308
321
|
|
|
309
|
-
export default
|
|
322
|
+
export default ScrollViewStickyHeader;
|
|
@@ -165,7 +165,13 @@ type SwitchRef = React.ElementRef<
|
|
|
165
165
|
const Switch: component(
|
|
166
166
|
ref?: React.RefSetter<SwitchRef>,
|
|
167
167
|
...props: SwitchProps
|
|
168
|
-
) =
|
|
168
|
+
) = function Switch({
|
|
169
|
+
ref: forwardedRef,
|
|
170
|
+
...props
|
|
171
|
+
}: {
|
|
172
|
+
ref?: React.RefSetter<SwitchRef>,
|
|
173
|
+
...SwitchProps,
|
|
174
|
+
}): React.Node {
|
|
169
175
|
const {
|
|
170
176
|
disabled,
|
|
171
177
|
ios_backgroundColor,
|
|
@@ -285,6 +291,6 @@ const Switch: component(
|
|
|
285
291
|
/>
|
|
286
292
|
);
|
|
287
293
|
}
|
|
288
|
-
}
|
|
294
|
+
};
|
|
289
295
|
|
|
290
296
|
export default Switch;
|
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import type {HostComponent} from '../../../src/private/types/HostComponent';
|
|
12
12
|
import type {PartialViewConfig} from '../../Renderer/shims/ReactNativeTypes';
|
|
13
|
-
import type {
|
|
14
|
-
ColorValue,
|
|
15
|
-
TextStyleProp,
|
|
16
|
-
ViewStyleProp,
|
|
17
|
-
} from '../../StyleSheet/StyleSheet';
|
|
13
|
+
import type {ColorValue, TextStyleProp} from '../../StyleSheet/StyleSheet';
|
|
18
14
|
import type {
|
|
19
15
|
BubblingEventHandler,
|
|
20
16
|
DirectEventHandler,
|
|
@@ -16,11 +16,7 @@ import type {
|
|
|
16
16
|
} from '../../Types/CoreEventTypes';
|
|
17
17
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
type ColorValue,
|
|
21
|
-
type TextStyleProp,
|
|
22
|
-
type ViewStyleProp,
|
|
23
|
-
} from '../../StyleSheet/StyleSheet';
|
|
19
|
+
import {type ColorValue, type TextStyleProp} from '../../StyleSheet/StyleSheet';
|
|
24
20
|
import * as React from 'react';
|
|
25
21
|
|
|
26
22
|
/**
|
|
@@ -16,11 +16,7 @@ import type {
|
|
|
16
16
|
} from '../../Types/CoreEventTypes';
|
|
17
17
|
import type {ViewProps} from '../View/ViewPropTypes';
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
type ColorValue,
|
|
21
|
-
type TextStyleProp,
|
|
22
|
-
type ViewStyleProp,
|
|
23
|
-
} from '../../StyleSheet/StyleSheet';
|
|
19
|
+
import {type ColorValue, type TextStyleProp} from '../../StyleSheet/StyleSheet';
|
|
24
20
|
import * as React from 'react';
|
|
25
21
|
|
|
26
22
|
/**
|
|
@@ -60,7 +60,7 @@ import TextInputState from './TextInputState';
|
|
|
60
60
|
import invariant from 'invariant';
|
|
61
61
|
import nullthrows from 'nullthrows';
|
|
62
62
|
import * as React from 'react';
|
|
63
|
-
import {useCallback, useLayoutEffect, useRef, useState} from 'react';
|
|
63
|
+
import {useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react';
|
|
64
64
|
|
|
65
65
|
let AndroidTextInput;
|
|
66
66
|
let AndroidTextInputCommands;
|
|
@@ -578,7 +578,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
578
578
|
rejectResponderTermination,
|
|
579
579
|
} = props;
|
|
580
580
|
|
|
581
|
-
const config =
|
|
581
|
+
const config = useMemo(
|
|
582
582
|
() => ({
|
|
583
583
|
hitSlop,
|
|
584
584
|
onPress: (event: GestureResponderEvent) => {
|
|
@@ -871,27 +871,28 @@ const autoCompleteWebToTextContentTypeMap = {
|
|
|
871
871
|
username: 'username',
|
|
872
872
|
};
|
|
873
873
|
|
|
874
|
-
const
|
|
874
|
+
const TextInput: component(
|
|
875
875
|
ref?: React.RefSetter<TextInputInstance>,
|
|
876
876
|
...props: React.ElementConfig<typeof InternalTextInput>
|
|
877
|
-
) =
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
877
|
+
) = function TextInput({
|
|
878
|
+
ref: forwardedRef,
|
|
879
|
+
allowFontScaling = true,
|
|
880
|
+
rejectResponderTermination = true,
|
|
881
|
+
underlineColorAndroid = 'transparent',
|
|
882
|
+
autoComplete,
|
|
883
|
+
textContentType,
|
|
884
|
+
readOnly,
|
|
885
|
+
editable,
|
|
886
|
+
enterKeyHint,
|
|
887
|
+
returnKeyType,
|
|
888
|
+
inputMode,
|
|
889
|
+
showSoftInputOnFocus,
|
|
890
|
+
keyboardType,
|
|
891
|
+
...restProps
|
|
892
|
+
}: {
|
|
893
|
+
ref?: React.RefSetter<TextInputInstance>,
|
|
894
|
+
...React.ElementConfig<typeof InternalTextInput>,
|
|
895
|
+
}) {
|
|
895
896
|
return (
|
|
896
897
|
<InternalTextInput
|
|
897
898
|
allowFontScaling={allowFontScaling}
|
|
@@ -930,12 +931,12 @@ const ExportedForwardRef: component(
|
|
|
930
931
|
forwardedRef={forwardedRef}
|
|
931
932
|
/>
|
|
932
933
|
);
|
|
933
|
-
}
|
|
934
|
+
};
|
|
934
935
|
|
|
935
|
-
|
|
936
|
+
TextInput.displayName = 'TextInput';
|
|
936
937
|
|
|
937
938
|
// $FlowFixMe[prop-missing]
|
|
938
|
-
|
|
939
|
+
TextInput.State = {
|
|
939
940
|
currentlyFocusedInput: TextInputState.currentlyFocusedInput,
|
|
940
941
|
|
|
941
942
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
@@ -964,4 +965,4 @@ const verticalAlignToTextAlignVerticalMap = {
|
|
|
964
965
|
};
|
|
965
966
|
|
|
966
967
|
// $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
|
|
967
|
-
export default
|
|
968
|
+
export default TextInput as any as TextInputType;
|
|
@@ -61,7 +61,7 @@ import TextInputState from './TextInputState';
|
|
|
61
61
|
import invariant from 'invariant';
|
|
62
62
|
import nullthrows from 'nullthrows';
|
|
63
63
|
import * as React from 'react';
|
|
64
|
-
import {useCallback, useLayoutEffect, useRef, useState} from 'react';
|
|
64
|
+
import {useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react';
|
|
65
65
|
|
|
66
66
|
let AndroidTextInput;
|
|
67
67
|
let AndroidTextInputCommands;
|
|
@@ -463,6 +463,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
463
463
|
*/
|
|
464
464
|
if (instance != null) {
|
|
465
465
|
// $FlowFixMe[prop-missing] - See the explanation above.
|
|
466
|
+
// $FlowFixMe[unsafe-object-assign]
|
|
466
467
|
Object.assign(instance, {
|
|
467
468
|
clear(): void {
|
|
468
469
|
if (inputRef.current != null) {
|
|
@@ -604,7 +605,7 @@ function InternalTextInput(props: TextInputProps): React.Node {
|
|
|
604
605
|
rejectResponderTermination,
|
|
605
606
|
} = props;
|
|
606
607
|
|
|
607
|
-
const config =
|
|
608
|
+
const config = useMemo(
|
|
608
609
|
() => ({
|
|
609
610
|
hitSlop,
|
|
610
611
|
onPress: (event: GestureResponderEvent) => {
|
|
@@ -981,27 +982,28 @@ const autoCompleteWebToTextContentTypeMap = {
|
|
|
981
982
|
username: 'username',
|
|
982
983
|
};
|
|
983
984
|
|
|
984
|
-
const
|
|
985
|
+
const TextInput: component(
|
|
985
986
|
ref?: React.RefSetter<TextInputInstance>,
|
|
986
987
|
...props: React.ElementConfig<typeof InternalTextInput>
|
|
987
|
-
) =
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
988
|
+
) = function TextInput({
|
|
989
|
+
ref: forwardedRef,
|
|
990
|
+
allowFontScaling = true,
|
|
991
|
+
rejectResponderTermination = true,
|
|
992
|
+
underlineColorAndroid = 'transparent',
|
|
993
|
+
autoComplete,
|
|
994
|
+
textContentType,
|
|
995
|
+
readOnly,
|
|
996
|
+
editable,
|
|
997
|
+
enterKeyHint,
|
|
998
|
+
returnKeyType,
|
|
999
|
+
inputMode,
|
|
1000
|
+
showSoftInputOnFocus,
|
|
1001
|
+
keyboardType,
|
|
1002
|
+
...restProps
|
|
1003
|
+
}: {
|
|
1004
|
+
ref?: React.RefSetter<TextInputInstance>,
|
|
1005
|
+
...React.ElementConfig<typeof InternalTextInput>,
|
|
1006
|
+
}) {
|
|
1005
1007
|
return (
|
|
1006
1008
|
<InternalTextInput
|
|
1007
1009
|
allowFontScaling={allowFontScaling}
|
|
@@ -1039,12 +1041,12 @@ const ExportedForwardRef: component(
|
|
|
1039
1041
|
forwardedRef={forwardedRef}
|
|
1040
1042
|
/>
|
|
1041
1043
|
);
|
|
1042
|
-
}
|
|
1044
|
+
};
|
|
1043
1045
|
|
|
1044
|
-
|
|
1046
|
+
TextInput.displayName = 'TextInput';
|
|
1045
1047
|
|
|
1046
1048
|
// $FlowFixMe[prop-missing]
|
|
1047
|
-
|
|
1049
|
+
TextInput.State = {
|
|
1048
1050
|
currentlyFocusedInput: TextInputState.currentlyFocusedInput,
|
|
1049
1051
|
|
|
1050
1052
|
currentlyFocusedField: TextInputState.currentlyFocusedField,
|
|
@@ -1073,4 +1075,4 @@ const verticalAlignToTextAlignVerticalMap = {
|
|
|
1073
1075
|
};
|
|
1074
1076
|
|
|
1075
1077
|
// $FlowFixMe[unclear-type] Unclear type. Using `any` type is not safe.
|
|
1076
|
-
export default
|
|
1078
|
+
export default TextInput as any as TextInputType;
|
|
@@ -221,9 +221,15 @@ class TouchableBounce extends React.Component<
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
export default (
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
export default (function TouchableBounceWrapper({
|
|
225
|
+
ref: hostRef,
|
|
226
|
+
...props
|
|
227
|
+
}: {
|
|
228
|
+
ref: React.RefSetter<mixed>,
|
|
229
|
+
...$ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>,
|
|
230
|
+
}) {
|
|
231
|
+
return <TouchableBounce {...props} hostRef={hostRef} />;
|
|
232
|
+
} as component(
|
|
227
233
|
ref: React.RefSetter<mixed>,
|
|
228
234
|
...props: $ReadOnly<Omit<TouchableBounceProps, 'hostRef'>>
|
|
229
235
|
));
|
|
@@ -19,6 +19,7 @@ import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
|
19
19
|
import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
20
20
|
import Platform from '../../Utilities/Platform';
|
|
21
21
|
import * as React from 'react';
|
|
22
|
+
import {cloneElement} from 'react';
|
|
22
23
|
|
|
23
24
|
type AndroidProps = $ReadOnly<{
|
|
24
25
|
nextFocusDown?: ?number,
|
|
@@ -371,7 +372,7 @@ class TouchableHighlightImpl extends React.Component<
|
|
|
371
372
|
testID={this.props.testID}
|
|
372
373
|
ref={this.props.hostRef}
|
|
373
374
|
{...eventHandlersWithoutBlurAndFocus}>
|
|
374
|
-
{
|
|
375
|
+
{cloneElement(child, {
|
|
375
376
|
style: StyleSheet.compose(
|
|
376
377
|
child.props.style,
|
|
377
378
|
this.state.extraStyles?.child,
|
|
@@ -408,9 +409,13 @@ class TouchableHighlightImpl extends React.Component<
|
|
|
408
409
|
const TouchableHighlight: component(
|
|
409
410
|
ref?: React.RefSetter<React.ElementRef<typeof View>>,
|
|
410
411
|
...props: $ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>
|
|
411
|
-
) =
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
) = ({
|
|
413
|
+
ref: hostRef,
|
|
414
|
+
...props
|
|
415
|
+
}: {
|
|
416
|
+
ref?: React.RefSetter<React.ElementRef<typeof View>>,
|
|
417
|
+
...$ReadOnly<Omit<TouchableHighlightProps, 'hostRef'>>,
|
|
418
|
+
}) => <TouchableHighlightImpl {...props} hostRef={hostRef} />;
|
|
414
419
|
|
|
415
420
|
TouchableHighlight.displayName = 'TouchableHighlight';
|
|
416
421
|
|
|
@@ -22,6 +22,7 @@ import Platform from '../../Utilities/Platform';
|
|
|
22
22
|
import {Commands} from '../View/ViewNativeComponent';
|
|
23
23
|
import invariant from 'invariant';
|
|
24
24
|
import * as React from 'react';
|
|
25
|
+
import {cloneElement} from 'react';
|
|
25
26
|
|
|
26
27
|
type TVProps = {
|
|
27
28
|
/**
|
|
@@ -334,7 +335,7 @@ class TouchableNativeFeedback extends React.Component<
|
|
|
334
335
|
|
|
335
336
|
const accessibilityLabel =
|
|
336
337
|
this.props['aria-label'] ?? this.props.accessibilityLabel;
|
|
337
|
-
return
|
|
338
|
+
return cloneElement(
|
|
338
339
|
element,
|
|
339
340
|
{
|
|
340
341
|
...eventHandlersWithoutBlurAndFocus,
|
|
@@ -13,12 +13,14 @@ import type {TouchableWithoutFeedbackProps} from './TouchableWithoutFeedback';
|
|
|
13
13
|
import Pressability, {
|
|
14
14
|
type PressabilityConfig,
|
|
15
15
|
} from '../../Pressability/Pressability';
|
|
16
|
+
import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
|
16
17
|
import {findHostInstance_DEPRECATED} from '../../ReactNative/RendererProxy';
|
|
17
18
|
import processColor from '../../StyleSheet/processColor';
|
|
18
19
|
import Platform from '../../Utilities/Platform';
|
|
19
20
|
import {Commands} from '../View/ViewNativeComponent';
|
|
20
21
|
import invariant from 'invariant';
|
|
21
22
|
import * as React from 'react';
|
|
23
|
+
import {cloneElement} from 'react';
|
|
22
24
|
|
|
23
25
|
type TVProps = {
|
|
24
26
|
/**
|
|
@@ -379,9 +379,13 @@ class TouchableOpacity extends React.Component<
|
|
|
379
379
|
const Touchable: component(
|
|
380
380
|
ref?: React.RefSetter<React.ElementRef<typeof Animated.View>>,
|
|
381
381
|
...props: TouchableOpacityProps
|
|
382
|
-
) =
|
|
383
|
-
|
|
384
|
-
|
|
382
|
+
) = ({
|
|
383
|
+
ref,
|
|
384
|
+
...props
|
|
385
|
+
}: {
|
|
386
|
+
ref?: React.RefSetter<React.ElementRef<typeof Animated.View>>,
|
|
387
|
+
...TouchableOpacityProps,
|
|
388
|
+
}) => <TouchableOpacity {...props} hostRef={ref} />;
|
|
385
389
|
|
|
386
390
|
Touchable.displayName = 'TouchableOpacity';
|
|
387
391
|
|