@office-iss/react-native-win32 0.0.0-canary.289 → 0.0.0-canary.290
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 +1 -2
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +13 -5
- package/Libraries/Animated/Animated.js.flow +1 -3
- package/Libraries/Animated/AnimatedExports.js.flow +12 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -1
- package/Libraries/Animated/components/AnimatedSectionList.js +1 -1
- package/Libraries/Animated/createAnimatedComponent.js +92 -56
- package/Libraries/Animated/nodes/AnimatedProps.js +29 -26
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/AppState/AppState.js +1 -1
- package/Libraries/Blob/URL.js +1 -1
- package/Libraries/Blob/URLSearchParams.js +106 -31
- package/Libraries/Blob/URLSearchParams.js.flow +12 -7
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js +1 -1
- package/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js +1 -1
- package/Libraries/Components/Keyboard/Keyboard.js +1 -1
- package/Libraries/Components/Pressable/Pressable.js +14 -3
- package/Libraries/Components/Pressable/Pressable.win32.js +14 -3
- package/Libraries/Components/ScrollView/ScrollView.d.ts +1 -1
- package/Libraries/Components/ScrollView/ScrollView.js +14 -17
- package/Libraries/Components/Switch/Switch.d.ts +3 -0
- package/Libraries/Components/Switch/Switch.js +1 -1
- package/Libraries/Components/TextInput/TextInput.d.ts +64 -33
- package/Libraries/Components/TextInput/TextInput.flow.js +15 -16
- package/Libraries/Components/TextInput/TextInput.js +34 -27
- package/Libraries/Components/TextInput/TextInput.win32.js +34 -27
- package/Libraries/Components/TextInput/TextInputState.js +1 -1
- package/Libraries/Components/TextInput/TextInputState.win32.js +1 -1
- package/Libraries/Components/Touchable/TouchableBounce.js +2 -1
- package/Libraries/Components/Touchable/TouchableHighlight.js +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.js +2 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableOpacity.js +2 -1
- package/Libraries/Components/View/ViewAccessibility.js +2 -1
- package/Libraries/Components/View/ViewAccessibility.win32.js +2 -1
- package/Libraries/Components/View/ViewPropTypes.js +49 -3
- package/Libraries/Components/View/ViewPropTypes.win32.js +49 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Debugging/DebuggingOverlayRegistry.js +3 -3
- package/Libraries/EventEmitter/NativeEventEmitter.js +4 -2
- package/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js +2 -2
- package/Libraries/Image/Image.d.ts +26 -10
- package/Libraries/Image/Image.js.flow +3 -3
- package/Libraries/Image/ImageBackground.js +2 -0
- package/Libraries/Image/ImageProps.js +19 -14
- package/Libraries/Interaction/InteractionManager.d.ts +13 -0
- package/Libraries/Interaction/InteractionManager.js +1 -1
- package/Libraries/Interaction/PanResponder.js +3 -3
- package/Libraries/LayoutAnimation/LayoutAnimation.js +2 -2
- package/Libraries/Linking/Linking.js +1 -1
- package/Libraries/Lists/FlatList.js +7 -10
- package/Libraries/Lists/SectionList.js +39 -42
- package/Libraries/Lists/SectionListModern.js +22 -31
- package/Libraries/Lists/VirtualizedList.js +1 -0
- package/Libraries/Lists/VirtualizedSectionList.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +1 -0
- package/Libraries/Network/RCTNetworking.android.js +1 -1
- package/Libraries/Network/RCTNetworking.ios.js +1 -1
- package/Libraries/Network/RCTNetworking.js.flow +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +1 -1
- package/Libraries/NewAppScreen/components/DebugInstructions.js +1 -3
- package/Libraries/NewAppScreen/components/Header.js +1 -3
- package/Libraries/NewAppScreen/components/HermesBadge.js +1 -3
- package/Libraries/NewAppScreen/components/LearnMoreLinks.js +1 -3
- package/Libraries/NewAppScreen/components/ReloadInstructions.js +1 -3
- package/Libraries/Pressability/Pressability.js +1 -1
- package/Libraries/Pressability/Pressability.win32.js +1 -1
- package/Libraries/ReactNative/AppContainer-dev.js +2 -2
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +2 -4
- package/Libraries/ReactNative/RendererImplementation.js +4 -0
- package/Libraries/ReactPrivate/ReactNativePrivateInterface.js +1 -1
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -3
- package/Libraries/StyleSheet/StyleSheet.js +25 -2
- package/Libraries/StyleSheet/StyleSheet.js.flow +24 -2
- package/Libraries/StyleSheet/StyleSheetTypes.js +13 -3
- package/Libraries/StyleSheet/flattenStyle.js +7 -3
- package/Libraries/StyleSheet/private/_TransformStyle.js +3 -3
- package/Libraries/Text/Text.d.ts +2 -5
- package/Libraries/Text/TextProps.js +3 -2
- package/Libraries/Text/TextProps.win32.js +3 -2
- package/Libraries/Types/CoreEventTypes.d.ts +6 -1
- package/Libraries/Types/CoreEventTypes.js +1 -1
- package/Libraries/Types/CoreEventTypes.win32.js +1 -1
- package/Libraries/Utilities/DeviceInfo.js +2 -0
- package/Libraries/Utilities/Dimensions.js +1 -1
- package/Libraries/Utilities/Dimensions.win32.js +1 -1
- package/Libraries/Utilities/PlatformTypes.js +9 -3
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/vendor/core/ErrorUtils.js +2 -0
- package/flow/global.js +2 -0
- package/index.js +3 -0
- package/index.win32.js +3 -0
- package/interface.js +0 -4
- package/overrides.json +19 -25
- package/package.json +13 -13
- package/src/private/animated/NativeAnimatedHelper.js +3 -1
- package/src/private/animated/NativeAnimatedHelper.win32.js +3 -1
- package/src/private/animated/createAnimatedPropsHook.js +1 -0
- package/src/private/animated/createAnimatedPropsMemoHook.js +1 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +18 -18
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -3
- package/src/private/inspector/getInspectorDataForViewAtPoint.js +2 -2
- package/src/private/types/HostInstance.js +61 -3
- package/src/private/webapis/dom/nodes/ReactNativeElement.js +2 -5
- package/src-win/Libraries/Text/Text.d.ts +2 -5
- package/types/modules/LaunchScreen.d.ts +9 -1
- package/Libraries/Utilities/DeviceInfo.win32.js +0 -19
- package/flow/jest.js +0 -1289
- package/src/private/utilities/ensureInstance.js +0 -21
package/.flowconfig
CHANGED
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
<PROJECT_ROOT>/Libraries/StyleSheet/PlatformColorValueTypes.js
|
|
32
32
|
<PROJECT_ROOT>/Libraries/Text/TextProps.js
|
|
33
33
|
<PROJECT_ROOT>/Libraries/Types/CoreEventTypes.js
|
|
34
|
-
<PROJECT_ROOT>/Libraries/Utilities/DeviceInfo.js
|
|
35
34
|
<PROJECT_ROOT>/Libraries/Utilities/Dimensions.js
|
|
36
35
|
<PROJECT_ROOT>/Libraries/Utilities/Platform.flow.js
|
|
37
36
|
<PROJECT_ROOT>/Libraries/LogBox/UI/LogBoxInspectorCodeFrame.js
|
|
@@ -168,4 +167,4 @@ untyped-import
|
|
|
168
167
|
untyped-type-import
|
|
169
168
|
|
|
170
169
|
[version]
|
|
171
|
-
^0.
|
|
170
|
+
^0.266.1
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 20 Jun 2025 05:21:03 GMT",
|
|
6
|
+
"version": "0.0.0-canary.290",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.290",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kvineeth@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "ca29f4ea3226621a8c1e8f9553fe55302ff6d4b9",
|
|
14
|
+
"comment": "Integrate RN Nightly Build 0.80.0-nightly-20250331-398ac1f71"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 19 Jun 2025 17:16:23 GMT",
|
|
6
21
|
"version": "0.0.0-canary.289",
|
|
7
22
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.289",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 20 Jun 2025 05:21:03 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.0.0-canary.
|
|
7
|
+
## 0.0.0-canary.290
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fri, 20 Jun 2025 05:21:03 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- Integrate RN Nightly Build 0.80.0-nightly-
|
|
14
|
-
- Update to @types/react 19 (30809111+acoates-ms@users.noreply.github.com)
|
|
13
|
+
- Integrate RN Nightly Build 0.80.0-nightly-20250331-398ac1f71 (kvineeth@microsoft.com)
|
|
15
14
|
|
|
15
|
+
## 0.0.0-canary.289
|
|
16
|
+
|
|
17
|
+
Thu, 19 Jun 2025 17:16:23 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- Integrate RN Nightly Build 0.80.0-nightly-20250317-fc7385c1e (hmalothu@microsoft.com)
|
|
22
|
+
- Update to @types/react 19 (30809111+acoates-ms@users.noreply.github.com)
|
|
23
|
+
|
|
16
24
|
## 0.0.0-canary.288
|
|
17
25
|
|
|
18
26
|
Fri, 30 May 2025 05:24:59 GMT
|
|
@@ -24,7 +24,19 @@ export {default as Node} from './nodes/AnimatedNode';
|
|
|
24
24
|
export {default as Value} from './nodes/AnimatedValue';
|
|
25
25
|
export {default as ValueXY} from './nodes/AnimatedValueXY';
|
|
26
26
|
|
|
27
|
+
/** @deprecated Use Animated.Interpolation instead */
|
|
28
|
+
export type {default as AnimatedInterpolation} from './nodes/AnimatedInterpolation';
|
|
29
|
+
/** @deprecated Use Animated.Color instead */
|
|
30
|
+
export type {default as AnimatedColor} from './nodes/AnimatedColor';
|
|
31
|
+
|
|
27
32
|
export type {AnimatedValueConfig as AnimatedConfig} from './nodes/AnimatedValue';
|
|
33
|
+
export type {default as AnimatedNode} from './nodes/AnimatedNode';
|
|
34
|
+
export type {default as AnimatedAddition} from './nodes/AnimatedAddition';
|
|
35
|
+
export type {default as AnimatedDiffClamp} from './nodes/AnimatedDiffClamp';
|
|
36
|
+
export type {default as AnimatedDivision} from './nodes/AnimatedDivision';
|
|
37
|
+
export type {default as AnimatedModulo} from './nodes/AnimatedModulo';
|
|
38
|
+
export type {default as AnimatedMultiplication} from './nodes/AnimatedMultiplication';
|
|
39
|
+
export type {default as AnimatedSubtraction} from './nodes/AnimatedSubtraction';
|
|
28
40
|
|
|
29
41
|
export const add = AnimatedImplementation.add;
|
|
30
42
|
export const attachNativeEvent = AnimatedImplementation.attachNativeEvent;
|
|
@@ -46,11 +46,12 @@ const AnimatedScrollView: AnimatedComponentType<Props, Instance> =
|
|
|
46
46
|
props.style != null
|
|
47
47
|
) {
|
|
48
48
|
return (
|
|
49
|
-
// $FlowFixMe
|
|
49
|
+
// $FlowFixMe - It should return an Animated ScrollView but it returns a ScrollView with Animated props applied.
|
|
50
50
|
<AnimatedScrollViewWithInvertedRefreshControl
|
|
51
51
|
scrollEventThrottle={0.0001}
|
|
52
52
|
{...props}
|
|
53
53
|
ref={forwardedRef}
|
|
54
|
+
// $FlowFixMe[incompatible-type]
|
|
54
55
|
refreshControl={props.refreshControl}
|
|
55
56
|
/>
|
|
56
57
|
);
|
|
@@ -18,5 +18,5 @@ import * as React from 'react';
|
|
|
18
18
|
export default (createAnimatedComponent(SectionList): AnimatedComponentType<
|
|
19
19
|
React.ElementConfig<typeof SectionList>,
|
|
20
20
|
// $FlowExpectedError[unclear-type]
|
|
21
|
-
SectionList<SectionBase<any>>,
|
|
21
|
+
SectionList<any, SectionBase<any>>,
|
|
22
22
|
>);
|
|
@@ -8,7 +8,16 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type AnimatedAddition from './nodes/AnimatedAddition';
|
|
12
|
+
import type AnimatedDiffClamp from './nodes/AnimatedDiffClamp';
|
|
13
|
+
import type AnimatedDivision from './nodes/AnimatedDivision';
|
|
14
|
+
import type AnimatedInterpolation from './nodes/AnimatedInterpolation';
|
|
15
|
+
import type AnimatedModulo from './nodes/AnimatedModulo';
|
|
16
|
+
import type AnimatedMultiplication from './nodes/AnimatedMultiplication';
|
|
17
|
+
import type AnimatedNode from './nodes/AnimatedNode';
|
|
11
18
|
import type {AnimatedPropsAllowlist} from './nodes/AnimatedProps';
|
|
19
|
+
import type AnimatedSubtraction from './nodes/AnimatedSubtraction';
|
|
20
|
+
import type AnimatedValue from './nodes/AnimatedValue';
|
|
12
21
|
|
|
13
22
|
import createAnimatedPropsHook from '../../src/private/animated/createAnimatedPropsHook';
|
|
14
23
|
import composeStyles from '../../src/private/styles/composeStyles';
|
|
@@ -17,34 +26,62 @@ import useMergeRefs from '../Utilities/useMergeRefs';
|
|
|
17
26
|
import * as React from 'react';
|
|
18
27
|
import {useMemo} from 'react';
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
type Nullable = void | null;
|
|
30
|
+
type Primitive = string | number | boolean | symbol | void;
|
|
31
|
+
type Builtin = (...$ReadOnlyArray<empty>) => mixed | Date | Error | RegExp;
|
|
32
|
+
|
|
33
|
+
export type WithAnimatedValue<+T> = T extends Builtin | Nullable
|
|
34
|
+
? T
|
|
35
|
+
: T extends Primitive
|
|
36
|
+
?
|
|
37
|
+
| T
|
|
38
|
+
| AnimatedNode
|
|
39
|
+
| AnimatedAddition
|
|
40
|
+
| AnimatedSubtraction
|
|
41
|
+
| AnimatedDivision
|
|
42
|
+
| AnimatedMultiplication
|
|
43
|
+
| AnimatedModulo
|
|
44
|
+
| AnimatedDiffClamp
|
|
45
|
+
| AnimatedValue
|
|
46
|
+
| AnimatedInterpolation<number | string>
|
|
47
|
+
| AnimatedInterpolation<number>
|
|
48
|
+
| AnimatedInterpolation<string>
|
|
49
|
+
: T extends $ReadOnlyArray<infer P>
|
|
50
|
+
? $ReadOnlyArray<WithAnimatedValue<P>>
|
|
51
|
+
: T extends {...}
|
|
52
|
+
? {+[K in keyof T]: WithAnimatedValue<T[K]>}
|
|
53
|
+
: T;
|
|
29
54
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
type NonAnimatedProps =
|
|
56
|
+
| 'ref'
|
|
57
|
+
| 'innerViewRef'
|
|
58
|
+
| 'scrollViewRef'
|
|
59
|
+
| 'testID'
|
|
60
|
+
| 'disabled'
|
|
61
|
+
| 'accessibilityLabel';
|
|
62
|
+
type PassThroughProps = $ReadOnly<{
|
|
63
|
+
passthroughAnimatedPropExplicitValues?: React.ElementConfig<
|
|
64
|
+
typeof View,
|
|
65
|
+
> | null,
|
|
36
66
|
}>;
|
|
37
67
|
|
|
68
|
+
export type AnimatedProps<Props: {...}> = {
|
|
69
|
+
[K in keyof Props]: K extends NonAnimatedProps
|
|
70
|
+
? Props[K]
|
|
71
|
+
: WithAnimatedValue<Props[K]>,
|
|
72
|
+
} & PassThroughProps;
|
|
73
|
+
|
|
74
|
+
export type AnimatedBaseProps<Props: {...}> = {
|
|
75
|
+
[K in keyof Props]: K extends NonAnimatedProps
|
|
76
|
+
? Props[K]
|
|
77
|
+
: WithAnimatedValue<Props[K]>,
|
|
78
|
+
};
|
|
79
|
+
|
|
38
80
|
export type AnimatedComponentType<Props: {...}, +Instance = mixed> = component(
|
|
39
81
|
ref?: React.RefSetter<Instance>,
|
|
40
82
|
...AnimatedProps<Props>
|
|
41
83
|
);
|
|
42
84
|
|
|
43
|
-
export type StrictAnimatedComponentType<
|
|
44
|
-
Props: {...},
|
|
45
|
-
+Instance = mixed,
|
|
46
|
-
> = component(ref: React.RefSetter<Instance>, ...StrictAnimatedProps<Props>);
|
|
47
|
-
|
|
48
85
|
export default function createAnimatedComponent<
|
|
49
86
|
TInstance: React.ComponentType<any>,
|
|
50
87
|
>(
|
|
@@ -62,48 +99,47 @@ export function unstable_createAnimatedComponentWithAllowlist<
|
|
|
62
99
|
>(
|
|
63
100
|
Component: TInstance,
|
|
64
101
|
allowlist: ?AnimatedPropsAllowlist,
|
|
65
|
-
):
|
|
102
|
+
): AnimatedComponentType<TProps, React.ElementRef<TInstance>> {
|
|
66
103
|
const useAnimatedProps = createAnimatedPropsHook(allowlist);
|
|
67
104
|
|
|
68
|
-
const AnimatedComponent:
|
|
105
|
+
const AnimatedComponent: AnimatedComponentType<
|
|
69
106
|
TProps,
|
|
70
107
|
React.ElementRef<TInstance>,
|
|
71
|
-
> = React.forwardRef<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
React.ElementRef<TInstance
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
forwardedRef,
|
|
82
|
-
);
|
|
108
|
+
> = React.forwardRef<AnimatedProps<TProps>, React.ElementRef<TInstance>>(
|
|
109
|
+
(props, forwardedRef) => {
|
|
110
|
+
const [reducedProps, callbackRef] = useAnimatedProps<
|
|
111
|
+
TProps,
|
|
112
|
+
React.ElementRef<TInstance>,
|
|
113
|
+
>(props);
|
|
114
|
+
const ref = useMergeRefs<React.ElementRef<TInstance>>(
|
|
115
|
+
callbackRef,
|
|
116
|
+
forwardedRef,
|
|
117
|
+
);
|
|
83
118
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
119
|
+
// Some components require explicit passthrough values for animation
|
|
120
|
+
// to work properly. For example, if an animated component is
|
|
121
|
+
// transformed and Pressable, onPress will not work after transform
|
|
122
|
+
// without these passthrough values.
|
|
123
|
+
// $FlowFixMe[prop-missing]
|
|
124
|
+
const {passthroughAnimatedPropExplicitValues, style} = reducedProps;
|
|
125
|
+
const passthroughStyle = passthroughAnimatedPropExplicitValues?.style;
|
|
126
|
+
const mergedStyle = useMemo(
|
|
127
|
+
() => composeStyles(style, passthroughStyle),
|
|
128
|
+
[passthroughStyle, style],
|
|
129
|
+
);
|
|
95
130
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
131
|
+
// NOTE: It is important that `passthroughAnimatedPropExplicitValues` is
|
|
132
|
+
// spread after `reducedProps` but before `style`.
|
|
133
|
+
return (
|
|
134
|
+
<Component
|
|
135
|
+
{...reducedProps}
|
|
136
|
+
{...passthroughAnimatedPropExplicitValues}
|
|
137
|
+
style={mergedStyle}
|
|
138
|
+
ref={ref}
|
|
139
|
+
/>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
);
|
|
107
143
|
|
|
108
144
|
AnimatedComponent.displayName = `Animated(${
|
|
109
145
|
Component.displayName || 'Anonymous'
|
|
@@ -25,6 +25,12 @@ export type AnimatedPropsAllowlist = $ReadOnly<{
|
|
|
25
25
|
[string]: true,
|
|
26
26
|
}>;
|
|
27
27
|
|
|
28
|
+
type TargetView = {
|
|
29
|
+
+instance: TargetViewInstance,
|
|
30
|
+
connectedViewTag: ?number,
|
|
31
|
+
};
|
|
32
|
+
type TargetViewInstance = React.ElementRef<React.ElementType>;
|
|
33
|
+
|
|
28
34
|
function createAnimatedProps(
|
|
29
35
|
inputProps: {[string]: mixed},
|
|
30
36
|
allowlist: ?AnimatedPropsAllowlist,
|
|
@@ -75,11 +81,11 @@ function createAnimatedProps(
|
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
export default class AnimatedProps extends AnimatedNode {
|
|
78
|
-
#animatedView: any;
|
|
79
84
|
#callback: () => void;
|
|
80
85
|
#nodeKeys: $ReadOnlyArray<string>;
|
|
81
86
|
#nodes: $ReadOnlyArray<AnimatedNode>;
|
|
82
87
|
#props: {[string]: mixed};
|
|
88
|
+
#target: ?TargetView = null;
|
|
83
89
|
|
|
84
90
|
constructor(
|
|
85
91
|
inputProps: {[string]: mixed},
|
|
@@ -89,7 +95,6 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
89
95
|
) {
|
|
90
96
|
super(config);
|
|
91
97
|
const [nodeKeys, nodes, props] = createAnimatedProps(inputProps, allowlist);
|
|
92
|
-
this.#animatedView = null;
|
|
93
98
|
this.#nodeKeys = nodeKeys;
|
|
94
99
|
this.#nodes = nodes;
|
|
95
100
|
this.#props = props;
|
|
@@ -181,10 +186,10 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
__detach(): void {
|
|
184
|
-
if (this.__isNative && this.#
|
|
185
|
-
this
|
|
189
|
+
if (this.__isNative && this.#target != null) {
|
|
190
|
+
this.#disconnectAnimatedView(this.#target);
|
|
186
191
|
}
|
|
187
|
-
this.#
|
|
192
|
+
this.#target = null;
|
|
188
193
|
|
|
189
194
|
const nodes = this.#nodes;
|
|
190
195
|
for (let ii = 0, length = nodes.length; ii < length; ii++) {
|
|
@@ -210,56 +215,54 @@ export default class AnimatedProps extends AnimatedNode {
|
|
|
210
215
|
this.__isNative = true;
|
|
211
216
|
|
|
212
217
|
// Since this does not call the super.__makeNative, we need to store the
|
|
213
|
-
// supplied platformConfig here, before calling
|
|
218
|
+
// supplied platformConfig here, before calling #connectAnimatedView
|
|
214
219
|
// where it will be needed to traverse the graph of attached values.
|
|
215
220
|
super.__setPlatformConfig(platformConfig);
|
|
216
221
|
|
|
217
|
-
if (this.#
|
|
218
|
-
this
|
|
222
|
+
if (this.#target != null) {
|
|
223
|
+
this.#connectAnimatedView(this.#target);
|
|
219
224
|
}
|
|
220
225
|
}
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
setNativeView(
|
|
224
|
-
if (this.#
|
|
228
|
+
setNativeView(instance: TargetViewInstance): void {
|
|
229
|
+
if (this.#target?.instance === instance) {
|
|
225
230
|
return;
|
|
226
231
|
}
|
|
227
|
-
this.#
|
|
232
|
+
this.#target = {instance, connectedViewTag: null};
|
|
228
233
|
if (this.__isNative) {
|
|
229
|
-
this
|
|
234
|
+
this.#connectAnimatedView(this.#target);
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
|
|
233
|
-
|
|
238
|
+
#connectAnimatedView(target: TargetView): void {
|
|
234
239
|
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
235
|
-
let
|
|
236
|
-
if (
|
|
240
|
+
let viewTag: ?number = findNodeHandle(target.instance);
|
|
241
|
+
if (viewTag == null) {
|
|
237
242
|
if (process.env.NODE_ENV === 'test') {
|
|
238
|
-
|
|
243
|
+
viewTag = -1;
|
|
239
244
|
} else {
|
|
240
245
|
throw new Error('Unable to locate attached view in the native tree');
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
248
|
NativeAnimatedHelper.API.connectAnimatedNodeToView(
|
|
244
249
|
this.__getNativeTag(),
|
|
245
|
-
|
|
250
|
+
viewTag,
|
|
246
251
|
);
|
|
252
|
+
target.connectedViewTag = viewTag;
|
|
247
253
|
}
|
|
248
254
|
|
|
249
|
-
|
|
255
|
+
#disconnectAnimatedView(target: TargetView): void {
|
|
250
256
|
invariant(this.__isNative, 'Expected node to be marked as "native"');
|
|
251
|
-
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
nativeViewTag = -1;
|
|
255
|
-
} else {
|
|
256
|
-
throw new Error('Unable to locate attached view in the native tree');
|
|
257
|
-
}
|
|
257
|
+
const viewTag = target.connectedViewTag;
|
|
258
|
+
if (viewTag == null) {
|
|
259
|
+
return;
|
|
258
260
|
}
|
|
259
261
|
NativeAnimatedHelper.API.disconnectAnimatedNodeFromView(
|
|
260
262
|
this.__getNativeTag(),
|
|
261
|
-
|
|
263
|
+
viewTag,
|
|
262
264
|
);
|
|
265
|
+
target.connectedViewTag = null;
|
|
263
266
|
}
|
|
264
267
|
|
|
265
268
|
__restoreDefaultValues(): void {
|
|
@@ -214,7 +214,9 @@ export default class AnimatedValueXY extends AnimatedWithChildren {
|
|
|
214
214
|
*
|
|
215
215
|
* See https://reactnative.dev/docs/animatedvaluexy#gettranslatetransform
|
|
216
216
|
*/
|
|
217
|
-
getTranslateTransform(): Array<
|
|
217
|
+
getTranslateTransform(): Array<
|
|
218
|
+
{translateX: AnimatedValue} | {translateY: AnimatedValue},
|
|
219
|
+
> {
|
|
218
220
|
return [{translateX: this.x}, {translateY: this.y}];
|
|
219
221
|
}
|
|
220
222
|
|
|
@@ -107,7 +107,7 @@ class AppStateImpl {
|
|
|
107
107
|
*/
|
|
108
108
|
addEventListener<K: AppStateEvent>(
|
|
109
109
|
type: K,
|
|
110
|
-
handler: (
|
|
110
|
+
handler: (...AppStateEventDefinitions[K]) => void,
|
|
111
111
|
): EventSubscription {
|
|
112
112
|
const emitter = this._emitter;
|
|
113
113
|
if (emitter == null) {
|
package/Libraries/Blob/URL.js
CHANGED
|
@@ -160,7 +160,7 @@ export class URL {
|
|
|
160
160
|
|
|
161
161
|
get searchParams(): URLSearchParams {
|
|
162
162
|
if (this._searchParamsInstance == null) {
|
|
163
|
-
this._searchParamsInstance = new URLSearchParams();
|
|
163
|
+
this._searchParamsInstance = new URLSearchParams(this.search);
|
|
164
164
|
}
|
|
165
165
|
return this._searchParamsInstance;
|
|
166
166
|
}
|
|
@@ -11,60 +11,135 @@
|
|
|
11
11
|
// Small subset from whatwg-url: https://github.com/jsdom/whatwg-url/tree/master/src
|
|
12
12
|
// The reference code bloat comes from Unicode issues with URLs, so those won't work here.
|
|
13
13
|
export class URLSearchParams {
|
|
14
|
-
_searchParams:
|
|
14
|
+
_searchParams: Map<string, string[]> = new Map();
|
|
15
15
|
|
|
16
|
-
constructor(params?: Record<string, string>) {
|
|
17
|
-
if (
|
|
18
|
-
|
|
16
|
+
constructor(params?: Record<string, string> | string | [string, string][]) {
|
|
17
|
+
if (params === null) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (typeof params === 'string') {
|
|
22
|
+
// URLSearchParams("key1=value1&key2=value2");
|
|
23
|
+
params
|
|
24
|
+
.replace(/^\?/, '')
|
|
25
|
+
.split('&')
|
|
26
|
+
.forEach(pair => {
|
|
27
|
+
if (!pair) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const [key, value] = pair
|
|
31
|
+
.split('=')
|
|
32
|
+
.map(part => decodeURIComponent(part.replace(/\+/g, ' ')));
|
|
33
|
+
this.append(key, value);
|
|
34
|
+
});
|
|
35
|
+
} else if (Array.isArray(params)) {
|
|
36
|
+
//URLSearchParams([["key1", "value1"], ["key2", "value2"]]);
|
|
37
|
+
params.forEach(([key, value]) => this.append(key, value));
|
|
38
|
+
} else if (typeof params === 'object') {
|
|
39
|
+
//URLSearchParams({ key1: "value1", key2: "value2" });
|
|
40
|
+
Object.entries(params).forEach(([key, value]) => this.append(key, value));
|
|
19
41
|
}
|
|
20
42
|
}
|
|
21
43
|
|
|
22
44
|
append(key: string, value: string): void {
|
|
23
|
-
this._searchParams.
|
|
45
|
+
if (!this._searchParams.has(key)) {
|
|
46
|
+
this._searchParams.set(key, [value]); // Initialize with an array if key is missing
|
|
47
|
+
} else {
|
|
48
|
+
this._searchParams.get(key)?.push(value); // Else push the value to the array
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
delete(name: string): void {
|
|
53
|
+
this._searchParams.delete(name);
|
|
24
54
|
}
|
|
25
55
|
|
|
26
|
-
|
|
27
|
-
|
|
56
|
+
get(name: string): string | null {
|
|
57
|
+
const values = this._searchParams.get(name);
|
|
58
|
+
return values ? values[0] : null;
|
|
28
59
|
}
|
|
29
60
|
|
|
30
|
-
|
|
31
|
-
|
|
61
|
+
getAll(name: string): string[] {
|
|
62
|
+
return this._searchParams.get(name) ?? [];
|
|
32
63
|
}
|
|
33
64
|
|
|
34
|
-
|
|
35
|
-
|
|
65
|
+
has(name: string): boolean {
|
|
66
|
+
return this._searchParams.has(name);
|
|
36
67
|
}
|
|
37
68
|
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
set(name: string, value: string): void {
|
|
70
|
+
this._searchParams.set(name, [value]);
|
|
40
71
|
}
|
|
41
72
|
|
|
42
|
-
|
|
43
|
-
|
|
73
|
+
keys(): Iterator<string> {
|
|
74
|
+
return this._searchParams.keys();
|
|
44
75
|
}
|
|
45
76
|
|
|
46
|
-
|
|
47
|
-
|
|
77
|
+
values(): Iterator<string> {
|
|
78
|
+
function* generateValues(params: Map<string, string[]>): Iterator<string> {
|
|
79
|
+
for (const valueArray of params.values()) {
|
|
80
|
+
for (const value of valueArray) {
|
|
81
|
+
yield value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return generateValues(this._searchParams);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
entries(): Iterator<[string, string]> {
|
|
89
|
+
function* generateEntries(
|
|
90
|
+
params: Map<string, string[]>,
|
|
91
|
+
): Iterator<[string, string]> {
|
|
92
|
+
for (const [key, values] of params) {
|
|
93
|
+
for (const value of values) {
|
|
94
|
+
yield [key, value];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return generateEntries(this._searchParams);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
forEach(
|
|
103
|
+
callback: (value: string, key: string, searchParams: this) => void,
|
|
104
|
+
): void {
|
|
105
|
+
for (const [key, values] of this._searchParams) {
|
|
106
|
+
for (const value of values) {
|
|
107
|
+
callback(value, key, this);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
sort(): void {
|
|
113
|
+
this._searchParams = new Map(
|
|
114
|
+
[...this._searchParams.entries()].sort(([a], [b]) => a.localeCompare(b)),
|
|
115
|
+
);
|
|
48
116
|
}
|
|
49
117
|
|
|
50
118
|
// $FlowFixMe[unsupported-syntax]
|
|
51
119
|
[Symbol.iterator](): Iterator<[string, string]> {
|
|
52
|
-
|
|
120
|
+
const entries: [string, string][] = [];
|
|
121
|
+
|
|
122
|
+
for (const [key, values] of this._searchParams) {
|
|
123
|
+
for (const value of values) {
|
|
124
|
+
entries.push([key, value]);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return entries[Symbol.iterator]();
|
|
53
129
|
}
|
|
54
130
|
|
|
55
131
|
toString(): string {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
);
|
|
68
|
-
}, '');
|
|
132
|
+
return Array.from(this._searchParams.entries())
|
|
133
|
+
.map(([key, values]) =>
|
|
134
|
+
values
|
|
135
|
+
.map(
|
|
136
|
+
value =>
|
|
137
|
+
`${encodeURIComponent(key).replace(/%20/g, '+')}=${encodeURIComponent(
|
|
138
|
+
value,
|
|
139
|
+
).replace(/%20/g, '+')}`, // Convert only spaces to '+'
|
|
140
|
+
)
|
|
141
|
+
.join('&'),
|
|
142
|
+
)
|
|
143
|
+
.join('&');
|
|
69
144
|
}
|
|
70
145
|
}
|
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
|
|
11
11
|
declare export class URLSearchParams {
|
|
12
12
|
_searchParams: Array<[string, string]>;
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(
|
|
14
|
+
params?: Record<string, string> | string | Array<[string, string]>,
|
|
15
|
+
): void;
|
|
14
16
|
append(key: string, value: string): void;
|
|
15
|
-
delete(name: string):
|
|
16
|
-
get(name: string):
|
|
17
|
-
getAll(name: string):
|
|
18
|
-
has(name: string):
|
|
19
|
-
set(name: string, value: string):
|
|
20
|
-
sort():
|
|
17
|
+
delete(name: string): void;
|
|
18
|
+
get(name: string): string;
|
|
19
|
+
getAll(name: string): Array<string>;
|
|
20
|
+
has(name: string): boolean;
|
|
21
|
+
set(name: string, value: string): void;
|
|
22
|
+
sort(): void;
|
|
21
23
|
@@iterator(): Iterator<[string, string]>;
|
|
22
24
|
toString(): string;
|
|
25
|
+
keys(): Iterator<string>;
|
|
26
|
+
values(): Iterator<string>;
|
|
27
|
+
entries(): Iterator<[string, string]>;
|
|
23
28
|
}
|