@office-iss/react-native-win32 0.0.0-canary.259 → 0.0.0-canary.261

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.
Files changed (125) hide show
  1. package/.flowconfig +4 -3
  2. package/CHANGELOG.json +31 -1
  3. package/CHANGELOG.md +20 -4
  4. package/Libraries/Animated/AnimatedImplementation.js +7 -7
  5. package/Libraries/Animated/animations/Animation.js +10 -0
  6. package/Libraries/Animated/animations/TimingAnimation.js +1 -0
  7. package/Libraries/Animated/components/AnimatedScrollView.js +2 -2
  8. package/Libraries/Animated/createAnimatedComponent.js +1 -1
  9. package/Libraries/Animated/useAnimatedProps.js +71 -4
  10. package/Libraries/Blob/FileReader.js +1 -1
  11. package/Libraries/Blob/URL.js +2 -62
  12. package/Libraries/Blob/URLSearchParams.js +71 -0
  13. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +1 -1
  14. package/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js +1 -1
  15. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +3 -0
  16. package/Libraries/Components/ScrollView/ScrollView.js +5 -5
  17. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -3
  18. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +1 -1
  19. package/Libraries/Components/StatusBar/StatusBar.js +3 -1
  20. package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +3 -0
  21. package/Libraries/Components/TextInput/TextInput.d.ts +32 -2
  22. package/Libraries/Components/TextInput/TextInput.js +19 -10
  23. package/Libraries/Components/TextInput/TextInput.win32.js +19 -10
  24. package/Libraries/Components/View/ReactNativeStyleAttributes.js +11 -0
  25. package/Libraries/Components/View/ReactNativeViewAttributes.js +2 -0
  26. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +2 -0
  27. package/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  28. package/Libraries/Components/View/ViewNativeComponent.js +6 -0
  29. package/Libraries/Components/View/ViewPropTypes.js +14 -0
  30. package/Libraries/Components/View/ViewPropTypes.win32.js +14 -0
  31. package/Libraries/Core/InitializeCore.js +1 -1
  32. package/Libraries/Core/ReactNativeVersion.js +1 -1
  33. package/Libraries/Core/setUpErrorHandling.js +7 -1
  34. package/Libraries/Image/AssetSourceResolver.js +28 -1
  35. package/Libraries/Image/Image.android.js +9 -14
  36. package/Libraries/Image/Image.ios.js +11 -22
  37. package/Libraries/Image/Image.win32.js +10 -21
  38. package/Libraries/Image/ImageBackground.js +1 -8
  39. package/Libraries/Image/ImageUtils.js +9 -9
  40. package/Libraries/Image/ImageViewNativeComponent.js +3 -0
  41. package/Libraries/Inspector/NetworkOverlay.js +1 -1
  42. package/Libraries/Lists/FlatList.js +1 -1
  43. package/Libraries/Lists/SectionList.js +1 -1
  44. package/Libraries/Lists/SectionListModern.js +3 -3
  45. package/Libraries/LogBox/Data/LogBoxData.js +30 -4
  46. package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
  47. package/Libraries/NativeComponent/BaseViewConfig.ios.js +4 -0
  48. package/Libraries/NativeComponent/BaseViewConfig.win32.js +4 -0
  49. package/Libraries/NativeComponent/NativeComponentRegistry.js +13 -20
  50. package/Libraries/NativeComponent/StaticViewConfigValidator.js +0 -21
  51. package/Libraries/Network/XMLHttpRequest.js +4 -2
  52. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricHostComponent.js +1 -1
  53. package/Libraries/ReactNative/ReactFabricPublicInstance/ReactFabricPublicInstance.js +5 -5
  54. package/Libraries/ReactNative/RendererImplementation.js +26 -4
  55. package/Libraries/ReactNative/getNativeComponentAttributes.js +8 -0
  56. package/Libraries/Renderer/shims/ReactNativeTypes.js +9 -4
  57. package/Libraries/StyleSheet/StyleSheet.js +1 -1
  58. package/Libraries/StyleSheet/StyleSheet.win32.js +1 -1
  59. package/Libraries/StyleSheet/StyleSheetTypes.d.ts +11 -0
  60. package/Libraries/StyleSheet/StyleSheetTypes.js +14 -2
  61. package/Libraries/StyleSheet/processBackgroundImage.js +384 -0
  62. package/Libraries/StyleSheet/processFilter.js +4 -4
  63. package/Libraries/Text/Text.js +7 -6
  64. package/Libraries/Text/Text.win32.js +7 -6
  65. package/Libraries/Text/TextNativeComponent.js +7 -0
  66. package/Libraries/Text/TextNativeComponent.win32.js +7 -0
  67. package/Libraries/Utilities/Appearance.js +65 -73
  68. package/Libraries/Utilities/DevLoadingView.js +2 -4
  69. package/Libraries/Utilities/ReactNativeTestTools.js +1 -1
  70. package/Libraries/Utilities/stringifyViewConfig.js +22 -0
  71. package/Libraries/Utilities/useColorScheme.js +3 -3
  72. package/Libraries/WebSocket/WebSocket.js +1 -1
  73. package/flow/jest.js +2 -2
  74. package/index.js +2 -1
  75. package/index.win32.js +2 -1
  76. package/jest/mockModal.js +1 -3
  77. package/jest/mockScrollView.js +1 -1
  78. package/jest/renderer.js +2 -2
  79. package/jest/setup.js +8 -12
  80. package/overrides.json +12 -12
  81. package/package.json +14 -14
  82. package/src/private/{core/components → components}/HScrollViewNativeComponents.js +8 -8
  83. package/src/private/{core/components → components}/VScrollViewNativeComponents.js +7 -7
  84. package/src/private/{core/components → components}/useSyncOnScroll.js +2 -2
  85. package/src/private/featureflags/ReactNativeFeatureFlags.js +93 -10
  86. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +16 -3
  87. package/src/private/hooks/DebouncedEffectImplementation.js +148 -0
  88. package/src/private/hooks/useDebouncedEffect.js +23 -0
  89. package/{Libraries/Core → src/private/renderer/errorhandling}/ErrorHandlers.js +5 -4
  90. package/src/private/setup/setUpDOM.js +28 -0
  91. package/src/private/setup/setUpIntersectionObserver.js +27 -0
  92. package/src/private/setup/setUpMutationObserver.js +26 -0
  93. package/src/private/setup/setUpPerformanceObserver.js +64 -0
  94. package/src/private/specs/modules/NativeAppearance.js +3 -3
  95. package/src/private/specs/modules/NativeDebuggerSessionObserver.js +23 -0
  96. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +6 -4
  97. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserver.js +5 -3
  98. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverEntry.js +3 -3
  99. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver}/IntersectionObserverManager.js +14 -17
  100. package/src/private/{specs/modules → webapis/intersectionobserver/specs}/NativeIntersectionObserver.js +2 -2
  101. package/{Libraries/IntersectionObserver → src/private/webapis/intersectionobserver/specs}/__mocks__/NativeIntersectionObserver.js +4 -4
  102. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserver.js +5 -3
  103. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationObserverManager.js +24 -15
  104. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver}/MutationRecord.js +4 -6
  105. package/src/private/{specs/modules → webapis/mutationobserver/specs}/NativeMutationObserver.js +2 -2
  106. package/{Libraries/MutationObserver → src/private/webapis/mutationobserver/specs}/__mocks__/NativeMutationObserver.js +5 -5
  107. package/src/private/webapis/performance/{EventCounts.js → EventTiming.js} +65 -3
  108. package/src/private/webapis/performance/LongTasks.js +39 -0
  109. package/src/private/webapis/performance/Performance.js +22 -9
  110. package/src/private/webapis/performance/PerformanceEntry.js +35 -17
  111. package/src/private/webapis/performance/PerformanceObserver.js +29 -43
  112. package/src/private/webapis/performance/RawPerformanceEntry.js +19 -1
  113. package/src/private/webapis/performance/UserTiming.js +17 -12
  114. package/src/private/webapis/performance/specs/NativePerformanceObserver.js +1 -1
  115. package/src-win/Libraries/Components/View/ViewAccessibility.d.ts +15 -0
  116. package/types/experimental.d.ts +10 -2
  117. package/Libraries/Core/setUpIntersectionObserver.js +0 -16
  118. package/Libraries/Core/setUpMutationObserver.js +0 -16
  119. package/Libraries/Core/setUpPerformanceObserver.js +0 -18
  120. package/Libraries/IntersectionObserver/NativeIntersectionObserver.js +0 -13
  121. package/Libraries/MutationObserver/NativeMutationObserver.js +0 -13
  122. package/Libraries/Utilities/verifyComponentAttributeEquivalence.js +0 -135
  123. package/src/private/core/setUpDOM.js +0 -18
  124. package/src/private/webapis/performance/PerformanceEventTiming.js +0 -55
  125. /package/src/private/{core → styles}/composeStyles.js +0 -0
package/.flowconfig CHANGED
@@ -54,8 +54,6 @@
54
54
  .*/node_modules/sample-apps/.*
55
55
  .*/node_modules/playground/.*
56
56
 
57
- ; Ignore templates for 'npx @react-native-community/cli init'
58
- <PROJECT_ROOT>/packages/react-native/template/.*
59
57
  <PROJECT_ROOT>/packages/react-native/sdks/.*
60
58
 
61
59
  ; Ignore the codegen e2e tests
@@ -67,6 +65,9 @@
67
65
  ; Ignore "BUCK" generated dirs
68
66
  <PROJECT_ROOT>/\.buckd/
69
67
 
68
+ ; Ignore cache files
69
+ .*/node_modules/.cache*
70
+
70
71
  ; Ignore the src-win folder - flow files are combined with ones from react-native into the root Libraries folder
71
72
  .*/react-native-win32/src-win/.*
72
73
 
@@ -159,4 +160,4 @@ untyped-import
159
160
  untyped-type-import
160
161
 
161
162
  [version]
162
- ^0.241.0
163
+ ^0.244.0
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 22 Aug 2024 05:23:05 GMT",
5
+ "date": "Thu, 05 Sep 2024 05:13:08 GMT",
6
+ "version": "0.0.0-canary.261",
7
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.261",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "34109996+chiaramooney@users.noreply.github.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "277d6f06a3e1bf1650cd9d1e7b4f22e0619968e9",
14
+ "comment": "Integrate 8/20"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 28 Aug 2024 05:14:44 GMT",
21
+ "version": "0.0.0-canary.260",
22
+ "tag": "@office-iss/react-native-win32_v0.0.0-canary.260",
23
+ "comments": {
24
+ "prerelease": [
25
+ {
26
+ "author": "tatianakapos@microsoft.com",
27
+ "package": "@office-iss/react-native-win32",
28
+ "commit": "98197a259f5e7c97c877e361dd70b048343e65a8",
29
+ "comment": "integrate 0.76.0-nightly-20240816-17017d2b8"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Thu, 22 Aug 2024 05:24:27 GMT",
6
36
  "version": "0.0.0-canary.259",
7
37
  "tag": "@office-iss/react-native-win32_v0.0.0-canary.259",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,33 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Thu, 22 Aug 2024 05:23:05 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Sep 2024 05:13:08 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.0.0-canary.259
7
+ ## 0.0.0-canary.261
8
8
 
9
- Thu, 22 Aug 2024 05:23:05 GMT
9
+ Thu, 05 Sep 2024 05:13:08 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - integrate react native nightly 7-19 (tatianakapos@microsoft.com)
13
+ - Integrate 8/20 (34109996+chiaramooney@users.noreply.github.com)
14
14
 
15
+ ## 0.0.0-canary.260
16
+
17
+ Wed, 28 Aug 2024 05:14:44 GMT
18
+
19
+ ### Changes
20
+
21
+ - integrate 0.76.0-nightly-20240816-17017d2b8 (tatianakapos@microsoft.com)
22
+
23
+ ## 0.0.0-canary.259
24
+
25
+ Thu, 22 Aug 2024 05:24:27 GMT
26
+
27
+ ### Changes
28
+
29
+ - integrate react native nightly 7-19 (tatianakapos@microsoft.com)
30
+
15
31
  ## 0.0.0-canary.258
16
32
 
17
33
  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: React.Element<any>,
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: React.Element<typeof 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/core/composeStyles';
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
- useEffect(() => {
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): any) {
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;
@@ -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
- // Small subset from whatwg-url: https://github.com/jsdom/whatwg-url/tree/master/src
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.Element<any>,
108
+ renderNavigationView: () => React.MixedElement,
109
109
 
110
110
  /**
111
111
  * Make the drawer take the entire screen and draw the background of the
@@ -22,7 +22,7 @@ class RefreshControlMock extends React.Component<{...}> {
22
22
  componentDidMount() {
23
23
  RefreshControlMock.latestRef = this;
24
24
  }
25
- render(): React.Element<typeof RCTRefreshControl> {
25
+ render(): React.MixedElement {
26
26
  return <RCTRefreshControl />;
27
27
  }
28
28
  }
@@ -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/core/components/useSyncOnScroll';
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/core/components/HScrollViewNativeComponents';
34
+ } from '../../../src/private/components/HScrollViewNativeComponents';
35
35
  import {
36
36
  VScrollContentViewNativeComponent,
37
37
  VScrollViewNativeComponent,
38
- } from '../../../src/private/core/components/VScrollViewNativeComponents';
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?: ?React.Element<any>,
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 | React.Element<string> {
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?: React.Element<$FlowFixMe>,
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
- * Control the visibility of the network activity indicator
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