@office-iss/react-native-win32 0.0.0-canary.258 → 0.0.0-canary.260
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 +2 -4
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +24 -8
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Animated/AnimatedImplementation.js +7 -7
- package/Libraries/Animated/animations/Animation.js +10 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/components/AnimatedScrollView.js +2 -2
- package/Libraries/Animated/createAnimatedComponent.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -0
- package/Libraries/Animated/useAnimatedProps.js +138 -6
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Blob/FileReader.js +1 -1
- package/Libraries/Blob/URL.js +2 -62
- package/Libraries/Blob/URLSearchParams.js +71 -0
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
- package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollView.js +5 -5
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
- package/Libraries/Components/StatusBar/StatusBar.js +3 -1
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +3 -0
- package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
- package/Libraries/Components/TextInput/TextInput.js +220 -80
- package/Libraries/Components/TextInput/TextInput.win32.js +220 -86
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +22 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
- package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/Libraries/Components/View/ViewNativeComponent.js +6 -0
- package/Libraries/Components/View/ViewPropTypes.js +14 -0
- package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +1 -1
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/AssetSourceResolver.js +28 -1
- package/Libraries/Image/Image.android.js +9 -14
- package/Libraries/Image/Image.ios.js +11 -22
- package/Libraries/Image/Image.win32.js +10 -21
- package/Libraries/Image/ImageBackground.js +1 -8
- package/Libraries/Image/ImageUtils.js +9 -9
- package/Libraries/Image/ImageViewNativeComponent.js +4 -0
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +2 -2
- package/Libraries/Lists/SectionListModern.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +31 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +7 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +7 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +9 -2
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
- package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
- package/Libraries/ReactNative/RendererImplementation.js +24 -2
- package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +57 -19
- package/Libraries/StyleSheet/StyleSheetTypes.js +60 -23
- package/Libraries/StyleSheet/processBackgroundImage.js +286 -0
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +24 -14
- package/Libraries/Text/Text.js +395 -212
- package/Libraries/Text/Text.win32.js +443 -245
- package/Libraries/Text/TextNativeComponent.js +7 -0
- package/Libraries/Text/TextNativeComponent.win32.js +7 -0
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/HMRClient.js +1 -0
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.d.ts +1 -1
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +1 -1
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -0
- package/flow/jest.js +2 -2
- package/index.js +1 -0
- package/index.win32.js +1 -0
- package/jest/mockModal.js +1 -3
- package/jest/mockScrollView.js +1 -1
- package/jest/renderer.js +2 -2
- package/jest/setup.js +16 -9
- package/overrides.json +16 -16
- package/package.json +15 -15
- package/src/private/{core/components → components}/HScrollViewNativeComponents.js +8 -8
- package/src/private/{core/components → components}/VScrollViewNativeComponents.js +7 -7
- package/src/private/{core/components → components}/useSyncOnScroll.js +2 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +143 -19
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +25 -5
- package/src/private/hooks/DebouncedEffectImplementation.js +148 -0
- package/src/private/hooks/useDebouncedEffect.js +23 -0
- package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +14 -4
- package/src/private/setup/setUpDOM.js +28 -0
- package/src/private/setup/setUpIntersectionObserver.js +27 -0
- package/src/private/setup/setUpMutationObserver.js +26 -0
- package/src/private/setup/setUpPerformanceObserver.js +64 -0
- package/src/private/specs/modules/NativeDebuggerSessionObserver.js +23 -0
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWin.js +8 -1
- package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +1 -1
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +5 -8
- package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
- package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +1 -1
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +5 -5
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
- package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
- package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
- package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
- package/src/private/webapis/performance/LongTasks.js +39 -0
- package/src/private/webapis/performance/Performance.js +22 -9
- package/src/private/webapis/performance/PerformanceEntry.js +36 -18
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +24 -1
- package/src/private/webapis/performance/UserTiming.js +17 -12
- package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
- package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
- package/types/experimental.d.ts +20 -1
- package/Libraries/Core/setUpIntersectionObserver.js +0 -16
- package/Libraries/Core/setUpMutationObserver.js +0 -16
- package/Libraries/Core/setUpPerformanceObserver.js +0 -18
- package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
- package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
- package/Libraries/Text/TextOptimized.js +0 -538
- package/src/private/core/setUpDOM.js +0 -18
- package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
- /package/src/private/{core → styles}/composeStyles.js +0 -0
package/.flowconfig
CHANGED
|
@@ -127,9 +127,7 @@ module.name_mapper='^@office-iss/react-native-win32$' -> '<PROJECT_ROOT>/index.w
|
|
|
127
127
|
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/\1'
|
|
128
128
|
module.name_mapper='^@office-iss/react-native-win32/\(.*\)$' -> '<PROJECT_ROOT>\/1'
|
|
129
129
|
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/\1'
|
|
130
|
-
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
|
|
131
|
-
|
|
132
|
-
one_sided_type_guards=true
|
|
130
|
+
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/Libraries/Image/RelativeImageStub'
|
|
133
131
|
|
|
134
132
|
suppress_type=$FlowIssue
|
|
135
133
|
suppress_type=$FlowFixMe
|
|
@@ -161,4 +159,4 @@ untyped-import
|
|
|
161
159
|
untyped-type-import
|
|
162
160
|
|
|
163
161
|
[version]
|
|
164
|
-
^0.
|
|
162
|
+
^0.243.0
|
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Wed, 28 Aug 2024 05:14:05 GMT",
|
|
6
|
+
"version": "0.0.0-canary.260",
|
|
7
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.260",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tatianakapos@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "98197a259f5e7c97c877e361dd70b048343e65a8",
|
|
14
|
+
"comment": "integrate 0.76.0-nightly-20240816-17017d2b8"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 22 Aug 2024 05:24:27 GMT",
|
|
21
|
+
"version": "0.0.0-canary.259",
|
|
22
|
+
"tag": "@office-iss/react-native-win32_v0.0.0-canary.259",
|
|
23
|
+
"comments": {
|
|
24
|
+
"prerelease": [
|
|
25
|
+
{
|
|
26
|
+
"author": "tatianakapos@microsoft.com",
|
|
27
|
+
"package": "@office-iss/react-native-win32",
|
|
28
|
+
"commit": "bccbec07eeeda80b870765f2b207a6616b69732b",
|
|
29
|
+
"comment": "integrate react native nightly 7-19"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Thu, 08 Aug 2024 05:16:47 GMT",
|
|
6
36
|
"version": "0.0.0-canary.258",
|
|
7
37
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.258",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
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 Wed, 28 Aug 2024 05:14:05 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.260
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Wed, 28 Aug 2024 05:14:05 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
- Bump @rnw-scripts/eslint-config to v1.2.26
|
|
15
|
-
- Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.30
|
|
16
|
-
- Bump @rnw-scripts/just-task to v2.3.43
|
|
17
|
-
- Bump react-native-platform-override to v1.9.45
|
|
13
|
+
- integrate 0.76.0-nightly-20240816-17017d2b8 (tatianakapos@microsoft.com)
|
|
18
14
|
|
|
15
|
+
## 0.0.0-canary.259
|
|
16
|
+
|
|
17
|
+
Thu, 22 Aug 2024 05:24:27 GMT
|
|
18
|
+
|
|
19
|
+
### Changes
|
|
20
|
+
|
|
21
|
+
- integrate react native nightly 7-19 (tatianakapos@microsoft.com)
|
|
22
|
+
|
|
23
|
+
## 0.0.0-canary.258
|
|
24
|
+
|
|
25
|
+
Thu, 08 Aug 2024 05:16:47 GMT
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- Integrate 7/1 (jthysell@microsoft.com)
|
|
30
|
+
- Bump @rnw-scripts/eslint-config to v1.2.26
|
|
31
|
+
- Bump @rnw-scripts/jest-out-of-tree-snapshot-resolver to v1.1.30
|
|
32
|
+
- Bump @rnw-scripts/just-task to v2.3.43
|
|
33
|
+
- Bump react-native-platform-override to v1.9.45
|
|
34
|
+
|
|
19
35
|
## 0.0.0-canary.257
|
|
20
36
|
|
|
21
37
|
Wed, 24 Jul 2024 05:24:34 GMT
|
package/Libraries/Alert/Alert.js
CHANGED
|
@@ -98,10 +98,13 @@ class Alert {
|
|
|
98
98
|
const onAction = (action, buttonKey) => {
|
|
99
99
|
if (action === constants.buttonClicked) {
|
|
100
100
|
if (buttonKey === constants.buttonNeutral) {
|
|
101
|
+
// $FlowFixMe[incompatible-type]
|
|
101
102
|
buttonNeutral.onPress && buttonNeutral.onPress();
|
|
102
103
|
} else if (buttonKey === constants.buttonNegative) {
|
|
104
|
+
// $FlowFixMe[incompatible-type]
|
|
103
105
|
buttonNegative.onPress && buttonNegative.onPress();
|
|
104
106
|
} else if (buttonKey === constants.buttonPositive) {
|
|
107
|
+
// $FlowFixMe[incompatible-type]
|
|
105
108
|
buttonPositive.onPress && buttonPositive.onPress();
|
|
106
109
|
}
|
|
107
110
|
} else if (action === constants.dismissed) {
|
|
@@ -39,7 +39,7 @@ import AnimatedValue from './nodes/AnimatedValue';
|
|
|
39
39
|
import AnimatedValueXY from './nodes/AnimatedValueXY';
|
|
40
40
|
|
|
41
41
|
export type CompositeAnimation = {
|
|
42
|
-
start: (callback?: ?EndCallback) => void,
|
|
42
|
+
start: (callback?: ?EndCallback, isLooping?: boolean) => void,
|
|
43
43
|
stop: () => void,
|
|
44
44
|
reset: () => void,
|
|
45
45
|
_startNativeLoop: (iterations?: number) => void,
|
|
@@ -234,8 +234,8 @@ const timing = function (
|
|
|
234
234
|
|
|
235
235
|
return (
|
|
236
236
|
maybeVectorAnim(value, config, timing) || {
|
|
237
|
-
start: function (callback?: ?EndCallback): void {
|
|
238
|
-
start(value, config, callback);
|
|
237
|
+
start: function (callback?: ?EndCallback, isLooping?: boolean): void {
|
|
238
|
+
start(value, {...config, isLooping}, callback);
|
|
239
239
|
},
|
|
240
240
|
|
|
241
241
|
stop: function (): void {
|
|
@@ -305,7 +305,7 @@ const sequence = function (
|
|
|
305
305
|
): CompositeAnimation {
|
|
306
306
|
let current = 0;
|
|
307
307
|
return {
|
|
308
|
-
start: function (callback?: ?EndCallback) {
|
|
308
|
+
start: function (callback?: ?EndCallback, isLooping?: boolean) {
|
|
309
309
|
const onComplete = function (result: EndResult) {
|
|
310
310
|
if (!result.finished) {
|
|
311
311
|
callback && callback(result);
|
|
@@ -321,13 +321,13 @@ const sequence = function (
|
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
animations[current].start(onComplete);
|
|
324
|
+
animations[current].start(onComplete, isLooping);
|
|
325
325
|
};
|
|
326
326
|
|
|
327
327
|
if (animations.length === 0) {
|
|
328
328
|
callback && callback({finished: true});
|
|
329
329
|
} else {
|
|
330
|
-
animations[current].start(onComplete);
|
|
330
|
+
animations[current].start(onComplete, isLooping);
|
|
331
331
|
}
|
|
332
332
|
},
|
|
333
333
|
|
|
@@ -477,7 +477,7 @@ const loop = function (
|
|
|
477
477
|
} else {
|
|
478
478
|
iterationsSoFar++;
|
|
479
479
|
resetBeforeIteration && animation.reset();
|
|
480
|
-
animation.start(restart);
|
|
480
|
+
animation.start(restart, iterations === -1);
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
483
|
if (!animation || iterations === 0) {
|
|
@@ -14,6 +14,7 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
|
|
14
14
|
import type AnimatedNode from '../nodes/AnimatedNode';
|
|
15
15
|
import type AnimatedValue from '../nodes/AnimatedValue';
|
|
16
16
|
|
|
17
|
+
import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
17
18
|
import NativeAnimatedHelper from '../NativeAnimatedHelper';
|
|
18
19
|
import AnimatedProps from '../nodes/AnimatedProps';
|
|
19
20
|
|
|
@@ -26,6 +27,7 @@ export type AnimationConfig = {
|
|
|
26
27
|
platformConfig?: PlatformConfig,
|
|
27
28
|
onComplete?: ?EndCallback,
|
|
28
29
|
iterations?: number,
|
|
30
|
+
isLooping?: boolean,
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
let startNativeAnimationNextId = 1;
|
|
@@ -38,6 +40,7 @@ export default class Animation {
|
|
|
38
40
|
__isInteraction: boolean;
|
|
39
41
|
__onEnd: ?EndCallback;
|
|
40
42
|
__iterations: number;
|
|
43
|
+
__isLooping: ?boolean;
|
|
41
44
|
|
|
42
45
|
_nativeId: number;
|
|
43
46
|
|
|
@@ -107,6 +110,13 @@ export default class Animation {
|
|
|
107
110
|
if (value != null) {
|
|
108
111
|
animatedValue.__onAnimatedValueUpdateReceived(value);
|
|
109
112
|
|
|
113
|
+
if (
|
|
114
|
+
ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() &&
|
|
115
|
+
this.__isLooping
|
|
116
|
+
) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
// Once the JS side node is synced with the updated values, trigger an
|
|
111
121
|
// update on the AnimatedProps nodes to call any registered callbacks.
|
|
112
122
|
this.__findAnimatedPropsNodes(animatedValue).forEach(node =>
|
|
@@ -80,6 +80,7 @@ export default class TimingAnimation extends Animation {
|
|
|
80
80
|
this._useNativeDriver = NativeAnimatedHelper.shouldUseNativeDriver(config);
|
|
81
81
|
this._platformConfig = config.platformConfig;
|
|
82
82
|
this.__isInteraction = config.isInteraction ?? !this._useNativeDriver;
|
|
83
|
+
this.__isLooping = config.isLooping;
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
__getNativeAnimationConfig(): any {
|
|
@@ -71,7 +71,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
71
71
|
props: {
|
|
72
72
|
...React.ElementConfig<typeof ScrollView>,
|
|
73
73
|
// $FlowFixMe[unclear-type] Same Flow type as `refreshControl` in ScrollView
|
|
74
|
-
refreshControl:
|
|
74
|
+
refreshControl: ExactReactElement_DEPRECATED<any>,
|
|
75
75
|
},
|
|
76
76
|
forwardedRef:
|
|
77
77
|
| {current: Instance | null, ...}
|
|
@@ -97,7 +97,7 @@ const AnimatedScrollViewWithInvertedRefreshControl = React.forwardRef(
|
|
|
97
97
|
>(intermediatePropsForRefreshControl);
|
|
98
98
|
// NOTE: Assumes that refreshControl.ref` and `refreshControl.style` can be
|
|
99
99
|
// safely clobbered.
|
|
100
|
-
const refreshControl:
|
|
100
|
+
const refreshControl: ExactReactElement_DEPRECATED<typeof RefreshControl> =
|
|
101
101
|
React.cloneElement(props.refreshControl, {
|
|
102
102
|
...refreshControlAnimatedProps,
|
|
103
103
|
ref: refreshControlRef,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @format
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import composeStyles from '../../src/private/
|
|
11
|
+
import composeStyles from '../../src/private/styles/composeStyles';
|
|
12
12
|
import View from '../Components/View/View';
|
|
13
13
|
import useMergeRefs from '../Utilities/useMergeRefs';
|
|
14
14
|
import useAnimatedProps from './useAnimatedProps';
|
|
@@ -49,6 +49,7 @@ const NativeAnimatedAPI = NativeAnimatedHelper.API;
|
|
|
49
49
|
* transform which can receive values from multiple parents.
|
|
50
50
|
*/
|
|
51
51
|
export function flushValue(rootNode: AnimatedNode): void {
|
|
52
|
+
// eslint-disable-next-line func-call-spacing
|
|
52
53
|
const leaves = new Set<{update: () => void, ...}>();
|
|
53
54
|
function findAnimatedStyles(node: AnimatedNode) {
|
|
54
55
|
// $FlowFixMe[prop-missing]
|
|
@@ -10,12 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
+
import type {EventSubscription} from '../EventEmitter/NativeEventEmitter';
|
|
14
|
+
|
|
13
15
|
import * as ReactNativeFeatureFlags from '../../src/private/featureflags/ReactNativeFeatureFlags';
|
|
16
|
+
import useDebouncedEffect from '../../src/private/hooks/useDebouncedEffect';
|
|
14
17
|
import {isPublicInstance as isFabricPublicInstance} from '../ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstanceUtils';
|
|
15
18
|
import useRefEffect from '../Utilities/useRefEffect';
|
|
16
19
|
import {AnimatedEvent} from './AnimatedEvent';
|
|
17
20
|
import NativeAnimatedHelper from './NativeAnimatedHelper';
|
|
21
|
+
import AnimatedNode from './nodes/AnimatedNode';
|
|
18
22
|
import AnimatedProps from './nodes/AnimatedProps';
|
|
23
|
+
import AnimatedValue from './nodes/AnimatedValue';
|
|
19
24
|
import {
|
|
20
25
|
useCallback,
|
|
21
26
|
useEffect,
|
|
@@ -32,6 +37,11 @@ type ReducedProps<TProps> = {
|
|
|
32
37
|
};
|
|
33
38
|
type CallbackRef<T> = T => mixed;
|
|
34
39
|
|
|
40
|
+
type AnimatedValueListeners = Array<{
|
|
41
|
+
propValue: AnimatedValue,
|
|
42
|
+
listenerId: string,
|
|
43
|
+
}>;
|
|
44
|
+
|
|
35
45
|
export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
36
46
|
props: TProps,
|
|
37
47
|
): [ReducedProps<TProps>, CallbackRef<TInstance | null>] {
|
|
@@ -49,6 +59,14 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
49
59
|
);
|
|
50
60
|
const useNativePropsInFabric =
|
|
51
61
|
ReactNativeFeatureFlags.shouldUseSetNativePropsInFabric();
|
|
62
|
+
const useSetNativePropsInNativeAnimationsInFabric =
|
|
63
|
+
ReactNativeFeatureFlags.shouldUseSetNativePropsInNativeAnimationsInFabric();
|
|
64
|
+
|
|
65
|
+
const useAnimatedPropsLifecycle =
|
|
66
|
+
ReactNativeFeatureFlags.usePassiveEffectsForAnimations()
|
|
67
|
+
? useAnimatedPropsLifecycle_passiveEffects
|
|
68
|
+
: useAnimatedPropsLifecycle_layoutEffects;
|
|
69
|
+
|
|
52
70
|
useAnimatedPropsLifecycle(node);
|
|
53
71
|
|
|
54
72
|
// TODO: This "effect" does three things:
|
|
@@ -87,7 +105,12 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
87
105
|
if (isFabricNode) {
|
|
88
106
|
// Call `scheduleUpdate` to synchronise Fiber and Shadow tree.
|
|
89
107
|
// Must not be called in Paper.
|
|
90
|
-
|
|
108
|
+
if (useSetNativePropsInNativeAnimationsInFabric) {
|
|
109
|
+
// $FlowFixMe[incompatible-use]
|
|
110
|
+
instance.setNativeProps(node.__getAnimatedValue());
|
|
111
|
+
} else {
|
|
112
|
+
scheduleUpdate();
|
|
113
|
+
}
|
|
91
114
|
}
|
|
92
115
|
return;
|
|
93
116
|
}
|
|
@@ -139,6 +162,7 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
139
162
|
|
|
140
163
|
const target = getEventTarget(instance);
|
|
141
164
|
const events = [];
|
|
165
|
+
const animatedValueListeners: AnimatedValueListeners = [];
|
|
142
166
|
|
|
143
167
|
for (const propName in props) {
|
|
144
168
|
// $FlowFixMe[invalid-computed-prop]
|
|
@@ -146,6 +170,8 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
146
170
|
if (propValue instanceof AnimatedEvent && propValue.__isNative) {
|
|
147
171
|
propValue.__attach(target, propName);
|
|
148
172
|
events.push([propName, propValue]);
|
|
173
|
+
// $FlowFixMe[incompatible-call] - the `addListenersToPropsValue` drills down the propValue.
|
|
174
|
+
addListenersToPropsValue(propValue, animatedValueListeners);
|
|
149
175
|
}
|
|
150
176
|
}
|
|
151
177
|
|
|
@@ -155,18 +181,25 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
155
181
|
for (const [propName, propValue] of events) {
|
|
156
182
|
propValue.__detach(target, propName);
|
|
157
183
|
}
|
|
184
|
+
|
|
185
|
+
for (const {propValue, listenerId} of animatedValueListeners) {
|
|
186
|
+
propValue.removeListener(listenerId);
|
|
187
|
+
}
|
|
158
188
|
};
|
|
159
189
|
},
|
|
160
|
-
[
|
|
190
|
+
[
|
|
191
|
+
node,
|
|
192
|
+
useNativePropsInFabric,
|
|
193
|
+
useSetNativePropsInNativeAnimationsInFabric,
|
|
194
|
+
props,
|
|
195
|
+
],
|
|
161
196
|
);
|
|
162
197
|
const callbackRef = useRefEffect<TInstance>(refEffect);
|
|
163
198
|
|
|
164
199
|
return [reduceAnimatedProps<TProps>(node), callbackRef];
|
|
165
200
|
}
|
|
166
201
|
|
|
167
|
-
function reduceAnimatedProps<TProps>(
|
|
168
|
-
node: AnimatedProps,
|
|
169
|
-
): ReducedProps<TProps> {
|
|
202
|
+
function reduceAnimatedProps<TProps>(node: AnimatedNode): ReducedProps<TProps> {
|
|
170
203
|
// Force `collapsable` to be false so that the native view is not flattened.
|
|
171
204
|
// Flattened views cannot be accurately referenced by the native driver.
|
|
172
205
|
return {
|
|
@@ -175,6 +208,35 @@ function reduceAnimatedProps<TProps>(
|
|
|
175
208
|
};
|
|
176
209
|
}
|
|
177
210
|
|
|
211
|
+
function addListenersToPropsValue(
|
|
212
|
+
propValue: AnimatedValue,
|
|
213
|
+
accumulator: AnimatedValueListeners,
|
|
214
|
+
) {
|
|
215
|
+
// propValue can be a scalar value, an array or an object.
|
|
216
|
+
if (propValue instanceof AnimatedValue) {
|
|
217
|
+
const listenerId = propValue.addListener(() => {});
|
|
218
|
+
accumulator.push({propValue, listenerId});
|
|
219
|
+
} else if (Array.isArray(propValue)) {
|
|
220
|
+
// An array can be an array of scalar values, arrays of arrays, or arrays of objects
|
|
221
|
+
for (const prop of propValue) {
|
|
222
|
+
addListenersToPropsValue(prop, accumulator);
|
|
223
|
+
}
|
|
224
|
+
} else if (propValue instanceof Object) {
|
|
225
|
+
addAnimatedValuesListenersToProps(propValue, accumulator);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function addAnimatedValuesListenersToProps(
|
|
230
|
+
props: AnimatedNode,
|
|
231
|
+
accumulator: AnimatedValueListeners,
|
|
232
|
+
) {
|
|
233
|
+
for (const propName in props) {
|
|
234
|
+
// $FlowFixMe[prop-missing] - This is an object contained in a prop, but we don't know the exact type.
|
|
235
|
+
const propValue = props[propName];
|
|
236
|
+
addListenersToPropsValue(propValue, accumulator);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
178
240
|
/**
|
|
179
241
|
* Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`
|
|
180
242
|
* and `__detach`. However, this is more complicated because `AnimatedProps`
|
|
@@ -182,15 +244,33 @@ function reduceAnimatedProps<TProps>(
|
|
|
182
244
|
* nodes. So in order to optimize this, we avoid detaching until the next attach
|
|
183
245
|
* unless we are unmounting.
|
|
184
246
|
*/
|
|
185
|
-
function
|
|
247
|
+
function useAnimatedPropsLifecycle_layoutEffects(node: AnimatedProps): void {
|
|
186
248
|
const prevNodeRef = useRef<?AnimatedProps>(null);
|
|
187
249
|
const isUnmountingRef = useRef<boolean>(false);
|
|
250
|
+
const userDrivenAnimationEndedListener = useRef<?EventSubscription>(null);
|
|
188
251
|
|
|
189
252
|
useEffect(() => {
|
|
190
253
|
// It is ok for multiple components to call `flushQueue` because it noops
|
|
191
254
|
// if the queue is empty. When multiple animated components are mounted at
|
|
192
255
|
// the same time. Only first component flushes the queue and the others will noop.
|
|
193
256
|
NativeAnimatedHelper.API.flushQueue();
|
|
257
|
+
|
|
258
|
+
if (node.__isNative) {
|
|
259
|
+
userDrivenAnimationEndedListener.current =
|
|
260
|
+
NativeAnimatedHelper.nativeEventEmitter.addListener(
|
|
261
|
+
'onUserDrivenAnimationEnded',
|
|
262
|
+
data => {
|
|
263
|
+
node.update();
|
|
264
|
+
},
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return () => {
|
|
269
|
+
if (userDrivenAnimationEndedListener.current) {
|
|
270
|
+
userDrivenAnimationEndedListener.current?.remove();
|
|
271
|
+
userDrivenAnimationEndedListener.current = null;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
194
274
|
});
|
|
195
275
|
|
|
196
276
|
useLayoutEffect(() => {
|
|
@@ -220,6 +300,58 @@ function useAnimatedPropsLifecycle(node: AnimatedProps): void {
|
|
|
220
300
|
}, [node]);
|
|
221
301
|
}
|
|
222
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`
|
|
305
|
+
* and `__detach`. However, this is more complicated because `AnimatedProps`
|
|
306
|
+
* uses reference counting to determine when to recursively detach its children
|
|
307
|
+
* nodes. So in order to optimize this, we avoid detaching until the next attach
|
|
308
|
+
* unless we are unmounting.
|
|
309
|
+
*
|
|
310
|
+
* NOTE: unlike `useAnimatedPropsLifecycle_layoutEffects`, this version uses passive effects to setup animation graph.
|
|
311
|
+
*/
|
|
312
|
+
function useAnimatedPropsLifecycle_passiveEffects(node: AnimatedProps): void {
|
|
313
|
+
const prevNodeRef = useRef<?AnimatedProps>(null);
|
|
314
|
+
const isUnmountingRef = useRef<boolean>(false);
|
|
315
|
+
|
|
316
|
+
useEffect(() => {
|
|
317
|
+
// It is ok for multiple components to call `flushQueue` because it noops
|
|
318
|
+
// if the queue is empty. When multiple animated components are mounted at
|
|
319
|
+
// the same time. Only first component flushes the queue and the others will noop.
|
|
320
|
+
NativeAnimatedHelper.API.flushQueue();
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
useEffect(() => {
|
|
324
|
+
isUnmountingRef.current = false;
|
|
325
|
+
return () => {
|
|
326
|
+
isUnmountingRef.current = true;
|
|
327
|
+
};
|
|
328
|
+
}, []);
|
|
329
|
+
|
|
330
|
+
const useEffectImpl =
|
|
331
|
+
ReactNativeFeatureFlags.shouldUseDebouncedEffectsForAnimated()
|
|
332
|
+
? useDebouncedEffect
|
|
333
|
+
: useEffect;
|
|
334
|
+
|
|
335
|
+
useEffectImpl(() => {
|
|
336
|
+
node.__attach();
|
|
337
|
+
if (prevNodeRef.current != null) {
|
|
338
|
+
const prevNode = prevNodeRef.current;
|
|
339
|
+
// TODO: Stop restoring default values (unless `reset` is called).
|
|
340
|
+
prevNode.__restoreDefaultValues();
|
|
341
|
+
prevNode.__detach();
|
|
342
|
+
prevNodeRef.current = null;
|
|
343
|
+
}
|
|
344
|
+
return () => {
|
|
345
|
+
if (isUnmountingRef.current) {
|
|
346
|
+
// NOTE: Do not restore default values on unmount, see D18197735.
|
|
347
|
+
node.__detach();
|
|
348
|
+
} else {
|
|
349
|
+
prevNodeRef.current = node;
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
}, [node]);
|
|
353
|
+
}
|
|
354
|
+
|
|
223
355
|
function getEventTarget<TInstance>(instance: TInstance): TInstance {
|
|
224
356
|
return typeof instance === 'object' &&
|
|
225
357
|
typeof instance?.getScrollableNode === 'function'
|
|
@@ -102,6 +102,7 @@ function genMethod(moduleID: number, methodID: number, type: MethodType) {
|
|
|
102
102
|
// In case we reject, capture a useful stack trace here.
|
|
103
103
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for
|
|
104
104
|
* this parameters */
|
|
105
|
+
// $FlowFixMe[incompatible-type]
|
|
105
106
|
const enqueueingFrameError: ExtendedError = new Error();
|
|
106
107
|
return new Promise((resolve, reject) => {
|
|
107
108
|
BatchedBridge.enqueueNativeCall(
|
|
@@ -171,6 +172,7 @@ function updateErrorWithErrorData(
|
|
|
171
172
|
): ExtendedError {
|
|
172
173
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
173
174
|
* parameters */
|
|
175
|
+
// $FlowFixMe[incompatible-return]
|
|
174
176
|
return Object.assign(error, errorData || {});
|
|
175
177
|
}
|
|
176
178
|
|
|
@@ -34,7 +34,7 @@ const EMPTY = 0;
|
|
|
34
34
|
const LOADING = 1;
|
|
35
35
|
const DONE = 2;
|
|
36
36
|
|
|
37
|
-
class FileReader extends (EventTarget(...READER_EVENTS):
|
|
37
|
+
class FileReader extends (EventTarget(...READER_EVENTS): typeof EventTarget) {
|
|
38
38
|
static EMPTY: number = EMPTY;
|
|
39
39
|
static LOADING: number = LOADING;
|
|
40
40
|
static DONE: number = DONE;
|
package/Libraries/Blob/URL.js
CHANGED
|
@@ -27,7 +27,7 @@ if (
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/*
|
|
31
31
|
* To allow Blobs be accessed via `content://` URIs,
|
|
32
32
|
* you need to register `BlobProvider` as a ContentProvider in your app's `AndroidManifest.xml`:
|
|
33
33
|
*
|
|
@@ -52,67 +52,7 @@ if (
|
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
// The reference code bloat comes from Unicode issues with URLs, so those won't work here.
|
|
57
|
-
export class URLSearchParams {
|
|
58
|
-
_searchParams: Array<Array<string>> = [];
|
|
59
|
-
|
|
60
|
-
constructor(params: any) {
|
|
61
|
-
if (typeof params === 'object') {
|
|
62
|
-
Object.keys(params).forEach(key => this.append(key, params[key]));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
append(key: string, value: string): void {
|
|
67
|
-
this._searchParams.push([key, value]);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
delete(name: string): void {
|
|
71
|
-
throw new Error('URLSearchParams.delete is not implemented');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get(name: string): void {
|
|
75
|
-
throw new Error('URLSearchParams.get is not implemented');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
getAll(name: string): void {
|
|
79
|
-
throw new Error('URLSearchParams.getAll is not implemented');
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
has(name: string): void {
|
|
83
|
-
throw new Error('URLSearchParams.has is not implemented');
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
set(name: string, value: string): void {
|
|
87
|
-
throw new Error('URLSearchParams.set is not implemented');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
sort(): void {
|
|
91
|
-
throw new Error('URLSearchParams.sort is not implemented');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// $FlowFixMe[unsupported-syntax]
|
|
95
|
-
// $FlowFixMe[missing-local-annot]
|
|
96
|
-
[Symbol.iterator]() {
|
|
97
|
-
return this._searchParams[Symbol.iterator]();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
toString(): string {
|
|
101
|
-
if (this._searchParams.length === 0) {
|
|
102
|
-
return '';
|
|
103
|
-
}
|
|
104
|
-
const last = this._searchParams.length - 1;
|
|
105
|
-
return this._searchParams.reduce((acc, curr, index) => {
|
|
106
|
-
return (
|
|
107
|
-
acc +
|
|
108
|
-
encodeURIComponent(curr[0]) +
|
|
109
|
-
'=' +
|
|
110
|
-
encodeURIComponent(curr[1]) +
|
|
111
|
-
(index === last ? '' : '&')
|
|
112
|
-
);
|
|
113
|
-
}, '');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
55
|
+
export {URLSearchParams} from './URLSearchParams';
|
|
116
56
|
|
|
117
57
|
function validateBaseUrl(url: string) {
|
|
118
58
|
// from this MIT-licensed gist: https://gist.github.com/dperini/729294
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
* @flow
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Small subset from whatwg-url: https://github.com/jsdom/whatwg-url/tree/master/src
|
|
12
|
+
// The reference code bloat comes from Unicode issues with URLs, so those won't work here.
|
|
13
|
+
export class URLSearchParams {
|
|
14
|
+
_searchParams: Array<Array<string>> = [];
|
|
15
|
+
|
|
16
|
+
constructor(params: any) {
|
|
17
|
+
if (typeof params === 'object') {
|
|
18
|
+
Object.keys(params).forEach(key => this.append(key, params[key]));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
append(key: string, value: string): void {
|
|
23
|
+
this._searchParams.push([key, value]);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
delete(name: string): void {
|
|
27
|
+
throw new Error('URLSearchParams.delete is not implemented');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
get(name: string): void {
|
|
31
|
+
throw new Error('URLSearchParams.get is not implemented');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getAll(name: string): void {
|
|
35
|
+
throw new Error('URLSearchParams.getAll is not implemented');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
has(name: string): void {
|
|
39
|
+
throw new Error('URLSearchParams.has is not implemented');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
set(name: string, value: string): void {
|
|
43
|
+
throw new Error('URLSearchParams.set is not implemented');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
sort(): void {
|
|
47
|
+
throw new Error('URLSearchParams.sort is not implemented');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// $FlowFixMe[unsupported-syntax]
|
|
51
|
+
// $FlowFixMe[missing-local-annot]
|
|
52
|
+
[Symbol.iterator]() {
|
|
53
|
+
return this._searchParams[Symbol.iterator]();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
toString(): string {
|
|
57
|
+
if (this._searchParams.length === 0) {
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
const last = this._searchParams.length - 1;
|
|
61
|
+
return this._searchParams.reduce((acc, curr, index) => {
|
|
62
|
+
return (
|
|
63
|
+
acc +
|
|
64
|
+
encodeURIComponent(curr[0]) +
|
|
65
|
+
'=' +
|
|
66
|
+
encodeURIComponent(curr[1]) +
|
|
67
|
+
(index === last ? '' : '&')
|
|
68
|
+
);
|
|
69
|
+
}, '');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -105,7 +105,7 @@ type Props = $ReadOnly<{|
|
|
|
105
105
|
/**
|
|
106
106
|
* The navigation view that will be rendered to the side of the screen and can be pulled in.
|
|
107
107
|
*/
|
|
108
|
-
renderNavigationView: () => React.
|
|
108
|
+
renderNavigationView: () => React.MixedElement,
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
111
|
* Make the drawer take the entire screen and draw the background of the
|