@office-iss/react-native-win32 0.0.0-canary.259 → 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 +1 -1
- package/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- 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/useAnimatedProps.js +71 -4
- 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 -3
- 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 +19 -10
- package/Libraries/Components/TextInput/TextInput.win32.js +19 -10
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +11 -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/InitializeCore.js +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpErrorHandling.js +7 -1
- 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 +3 -0
- package/Libraries/Inspector/NetworkOverlay.js +1 -1
- package/Libraries/Lists/FlatList.js +1 -1
- package/Libraries/Lists/SectionList.js +1 -1
- package/Libraries/Lists/SectionListModern.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +30 -4
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +4 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +4 -0
- package/Libraries/Network/XMLHttpRequest.js +4 -2
- 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/StyleSheet/StyleSheet.js +1 -1
- package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +11 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +14 -2
- package/Libraries/StyleSheet/processBackgroundImage.js +286 -0
- package/Libraries/Text/Text.js +7 -6
- package/Libraries/Text/Text.win32.js +7 -6
- package/Libraries/Text/TextNativeComponent.js +7 -0
- package/Libraries/Text/TextNativeComponent.win32.js +7 -0
- package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
- package/Libraries/WebSocket/WebSocket.js +1 -1
- 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 +8 -8
- package/overrides.json +12 -12
- package/package.json +13 -13
- 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 +84 -7
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +15 -2
- 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 +5 -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/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 +35 -17
- package/src/private/webapis/performance/PerformanceObserver.js +29 -43
- package/src/private/webapis/performance/RawPerformanceEntry.js +19 -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 +10 -2
- 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/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
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": "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",
|
|
6
21
|
"version": "0.0.0-canary.259",
|
|
7
22
|
"tag": "@office-iss/react-native-win32_v0.0.0-canary.259",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
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
|
-
- integrate
|
|
13
|
+
- integrate 0.76.0-nightly-20240816-17017d2b8 (tatianakapos@microsoft.com)
|
|
14
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
|
+
|
|
15
23
|
## 0.0.0-canary.258
|
|
16
24
|
|
|
17
25
|
Thu, 08 Aug 2024 05:16:47 GMT
|
|
@@ -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';
|
|
@@ -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>] {
|
|
@@ -152,6 +162,7 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
152
162
|
|
|
153
163
|
const target = getEventTarget(instance);
|
|
154
164
|
const events = [];
|
|
165
|
+
const animatedValueListeners: AnimatedValueListeners = [];
|
|
155
166
|
|
|
156
167
|
for (const propName in props) {
|
|
157
168
|
// $FlowFixMe[invalid-computed-prop]
|
|
@@ -159,6 +170,8 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
159
170
|
if (propValue instanceof AnimatedEvent && propValue.__isNative) {
|
|
160
171
|
propValue.__attach(target, propName);
|
|
161
172
|
events.push([propName, propValue]);
|
|
173
|
+
// $FlowFixMe[incompatible-call] - the `addListenersToPropsValue` drills down the propValue.
|
|
174
|
+
addListenersToPropsValue(propValue, animatedValueListeners);
|
|
162
175
|
}
|
|
163
176
|
}
|
|
164
177
|
|
|
@@ -168,6 +181,10 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
168
181
|
for (const [propName, propValue] of events) {
|
|
169
182
|
propValue.__detach(target, propName);
|
|
170
183
|
}
|
|
184
|
+
|
|
185
|
+
for (const {propValue, listenerId} of animatedValueListeners) {
|
|
186
|
+
propValue.removeListener(listenerId);
|
|
187
|
+
}
|
|
171
188
|
};
|
|
172
189
|
},
|
|
173
190
|
[
|
|
@@ -182,9 +199,7 @@ export default function useAnimatedProps<TProps: {...}, TInstance>(
|
|
|
182
199
|
return [reduceAnimatedProps<TProps>(node), callbackRef];
|
|
183
200
|
}
|
|
184
201
|
|
|
185
|
-
function reduceAnimatedProps<TProps>(
|
|
186
|
-
node: AnimatedProps,
|
|
187
|
-
): ReducedProps<TProps> {
|
|
202
|
+
function reduceAnimatedProps<TProps>(node: AnimatedNode): ReducedProps<TProps> {
|
|
188
203
|
// Force `collapsable` to be false so that the native view is not flattened.
|
|
189
204
|
// Flattened views cannot be accurately referenced by the native driver.
|
|
190
205
|
return {
|
|
@@ -193,6 +208,35 @@ function reduceAnimatedProps<TProps>(
|
|
|
193
208
|
};
|
|
194
209
|
}
|
|
195
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
|
+
|
|
196
240
|
/**
|
|
197
241
|
* Manages the lifecycle of the supplied `AnimatedProps` by invoking `__attach`
|
|
198
242
|
* and `__detach`. However, this is more complicated because `AnimatedProps`
|
|
@@ -203,12 +247,30 @@ function reduceAnimatedProps<TProps>(
|
|
|
203
247
|
function useAnimatedPropsLifecycle_layoutEffects(node: AnimatedProps): void {
|
|
204
248
|
const prevNodeRef = useRef<?AnimatedProps>(null);
|
|
205
249
|
const isUnmountingRef = useRef<boolean>(false);
|
|
250
|
+
const userDrivenAnimationEndedListener = useRef<?EventSubscription>(null);
|
|
206
251
|
|
|
207
252
|
useEffect(() => {
|
|
208
253
|
// It is ok for multiple components to call `flushQueue` because it noops
|
|
209
254
|
// if the queue is empty. When multiple animated components are mounted at
|
|
210
255
|
// the same time. Only first component flushes the queue and the others will noop.
|
|
211
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
|
+
};
|
|
212
274
|
});
|
|
213
275
|
|
|
214
276
|
useLayoutEffect(() => {
|
|
@@ -265,7 +327,12 @@ function useAnimatedPropsLifecycle_passiveEffects(node: AnimatedProps): void {
|
|
|
265
327
|
};
|
|
266
328
|
}, []);
|
|
267
329
|
|
|
268
|
-
|
|
330
|
+
const useEffectImpl =
|
|
331
|
+
ReactNativeFeatureFlags.shouldUseDebouncedEffectsForAnimated()
|
|
332
|
+
? useDebouncedEffect
|
|
333
|
+
: useEffect;
|
|
334
|
+
|
|
335
|
+
useEffectImpl(() => {
|
|
269
336
|
node.__attach();
|
|
270
337
|
if (prevNodeRef.current != null) {
|
|
271
338
|
const prevNode = prevNodeRef.current;
|
|
@@ -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
|
|
@@ -25,6 +25,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
25
25
|
disableIntervalMomentum: true,
|
|
26
26
|
maintainVisibleContentPosition: true,
|
|
27
27
|
endFillColor: {process: require('../../StyleSheet/processColor').default},
|
|
28
|
+
experimental_boxShadow: {
|
|
29
|
+
process: require('../../StyleSheet/processBoxShadow').default,
|
|
30
|
+
},
|
|
28
31
|
fadingEdgeLength: true,
|
|
29
32
|
nestedScrollEnabled: true,
|
|
30
33
|
overScrollMode: true,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type {
|
|
12
12
|
TScrollViewNativeComponentInstance,
|
|
13
13
|
TScrollViewNativeImperativeHandle,
|
|
14
|
-
} from '../../../src/private/
|
|
14
|
+
} from '../../../src/private/components/useSyncOnScroll';
|
|
15
15
|
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
16
16
|
import type {EdgeInsetsProp} from '../../StyleSheet/EdgeInsetsPropType';
|
|
17
17
|
import type {PointProp} from '../../StyleSheet/PointPropType';
|
|
@@ -31,11 +31,11 @@ import type {Props as ScrollViewStickyHeaderProps} from './ScrollViewStickyHeade
|
|
|
31
31
|
import {
|
|
32
32
|
HScrollContentViewNativeComponent,
|
|
33
33
|
HScrollViewNativeComponent,
|
|
34
|
-
} from '../../../src/private/
|
|
34
|
+
} from '../../../src/private/components/HScrollViewNativeComponents';
|
|
35
35
|
import {
|
|
36
36
|
VScrollContentViewNativeComponent,
|
|
37
37
|
VScrollViewNativeComponent,
|
|
38
|
-
} from '../../../src/private/
|
|
38
|
+
} from '../../../src/private/components/VScrollViewNativeComponents';
|
|
39
39
|
import AnimatedImplementation from '../../Animated/AnimatedImplementation';
|
|
40
40
|
import FrameRateLogger from '../../Interaction/FrameRateLogger';
|
|
41
41
|
import {findNodeHandle} from '../../ReactNative/RendererProxy';
|
|
@@ -643,7 +643,7 @@ export type Props = $ReadOnly<{|
|
|
|
643
643
|
*/
|
|
644
644
|
/* $FlowFixMe[unclear-type] - how to handle generic type without existential
|
|
645
645
|
* operator? */
|
|
646
|
-
refreshControl?: ?
|
|
646
|
+
refreshControl?: ?ExactReactElement_DEPRECATED<any>,
|
|
647
647
|
children?: React.Node,
|
|
648
648
|
/**
|
|
649
649
|
* A ref to the inner View element of the ScrollView. This should be used
|
|
@@ -1648,7 +1648,7 @@ class ScrollView extends React.Component<Props, State> {
|
|
|
1648
1648
|
this.props.onTouchMove && this.props.onTouchMove(e);
|
|
1649
1649
|
};
|
|
1650
1650
|
|
|
1651
|
-
render(): React.Node
|
|
1651
|
+
render(): React.Node {
|
|
1652
1652
|
const horizontal = this.props.horizontal === true;
|
|
1653
1653
|
|
|
1654
1654
|
const NativeScrollView = horizontal
|
|
@@ -46,6 +46,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
46
46
|
},
|
|
47
47
|
decelerationRate: true,
|
|
48
48
|
enableSyncOnScroll: true, // Fabric only.
|
|
49
|
+
experimental_boxShadow: {
|
|
50
|
+
process: require('../../StyleSheet/processBoxShadow').default,
|
|
51
|
+
},
|
|
49
52
|
disableIntervalMomentum: true,
|
|
50
53
|
maintainVisibleContentPosition: true,
|
|
51
54
|
pagingEnabled: true,
|
|
@@ -62,9 +65,6 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
62
65
|
borderRadius: true,
|
|
63
66
|
nestedScrollEnabled: true,
|
|
64
67
|
scrollEventThrottle: true,
|
|
65
|
-
scrollIndicatorInsets: {
|
|
66
|
-
diff: require('../../Utilities/differ/insetsDiffer'),
|
|
67
|
-
},
|
|
68
68
|
borderStyle: true,
|
|
69
69
|
borderRightColor: {
|
|
70
70
|
process: require('../../StyleSheet/processColor').default,
|
|
@@ -19,7 +19,7 @@ import * as React from 'react';
|
|
|
19
19
|
import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
|
20
20
|
|
|
21
21
|
export type Props = $ReadOnly<{
|
|
22
|
-
children?:
|
|
22
|
+
children?: ExactReactElement_DEPRECATED<$FlowFixMe>,
|
|
23
23
|
nextHeaderLayoutY: ?number,
|
|
24
24
|
onLayout: (event: LayoutEvent) => void,
|
|
25
25
|
scrollAnimatedValue: Animated.Value,
|
|
@@ -272,8 +272,10 @@ class StatusBar extends React.Component<Props> {
|
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
|
-
*
|
|
275
|
+
* DEPRECATED - The status bar network activity indicator is not supported in iOS 13 and later. This will be removed in a future release.
|
|
276
276
|
* @param visible Show the indicator.
|
|
277
|
+
*
|
|
278
|
+
* @deprecated
|
|
277
279
|
*/
|
|
278
280
|
static setNetworkActivityIndicatorVisible(visible: boolean) {
|
|
279
281
|
if (Platform.OS !== 'ios') {
|
|
@@ -739,6 +739,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig = {
|
|
|
739
739
|
},
|
|
740
740
|
borderTopLeftRadius: true,
|
|
741
741
|
borderTopColor: {process: require('../../StyleSheet/processColor').default},
|
|
742
|
+
experimental_boxShadow: {
|
|
743
|
+
process: require('../../StyleSheet/processBoxShadow').default,
|
|
744
|
+
},
|
|
742
745
|
},
|
|
743
746
|
};
|
|
744
747
|
|
|
@@ -90,6 +90,8 @@ type DataDetectorTypes =
|
|
|
90
90
|
| 'none'
|
|
91
91
|
| 'all';
|
|
92
92
|
|
|
93
|
+
export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
|
|
94
|
+
|
|
93
95
|
/**
|
|
94
96
|
* DocumentSelectionState is responsible for maintaining selection information
|
|
95
97
|
* for a document.
|
|
@@ -649,11 +651,39 @@ export interface TextInputProps
|
|
|
649
651
|
autoFocus?: boolean | undefined;
|
|
650
652
|
|
|
651
653
|
/**
|
|
652
|
-
* If true
|
|
653
|
-
* The default value is true
|
|
654
|
+
* If `true`, the text field will blur when submitted.
|
|
655
|
+
* The default value is true for single-line fields and false for
|
|
656
|
+
* multiline fields. Note that for multiline fields, setting `blurOnSubmit`
|
|
657
|
+
* to `true` means that pressing return will blur the field and trigger the
|
|
658
|
+
* `onSubmitEditing` event instead of inserting a newline into the field.
|
|
659
|
+
*
|
|
660
|
+
* @deprecated
|
|
661
|
+
* Note that `submitBehavior` now takes the place of `blurOnSubmit` and will
|
|
662
|
+
* override any behavior defined by `blurOnSubmit`.
|
|
663
|
+
* @see submitBehavior
|
|
654
664
|
*/
|
|
655
665
|
blurOnSubmit?: boolean | undefined;
|
|
656
666
|
|
|
667
|
+
/**
|
|
668
|
+
* When the return key is pressed,
|
|
669
|
+
*
|
|
670
|
+
* For single line inputs:
|
|
671
|
+
*
|
|
672
|
+
* - `'newline`' defaults to `'blurAndSubmit'`
|
|
673
|
+
* - `undefined` defaults to `'blurAndSubmit'`
|
|
674
|
+
*
|
|
675
|
+
* For multiline inputs:
|
|
676
|
+
*
|
|
677
|
+
* - `'newline'` adds a newline
|
|
678
|
+
* - `undefined` defaults to `'newline'`
|
|
679
|
+
*
|
|
680
|
+
* For both single line and multiline inputs:
|
|
681
|
+
*
|
|
682
|
+
* - `'submit'` will only send a submit event and not blur the input
|
|
683
|
+
* - `'blurAndSubmit`' will both blur the input and send a submit event
|
|
684
|
+
*/
|
|
685
|
+
submitBehavior?: SubmitBehavior | undefined;
|
|
686
|
+
|
|
657
687
|
/**
|
|
658
688
|
* If true, caret is hidden. The default value is false.
|
|
659
689
|
*/
|