react-native-windows 0.0.0-canary.511 → 0.0.0-canary.514

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.
@@ -19,8 +19,8 @@
19
19
  <FollyVersion>2021.06.28.00</FollyVersion>
20
20
  <FollyCommitHash>f434460f8a98e85f3ddb75390ddd1cc330c8f658</FollyCommitHash>
21
21
  <!-- When bumping the fmt version, be sure to bump the git hash of that version's commit too. -->
22
- <FmtVersion>7.1.3</FmtVersion>
23
- <FmtCommitHash>7bdf0628b1276379886c7f6dda2cef2b3b374f0b</FmtCommitHash>
22
+ <FmtVersion>8.0.0</FmtVersion>
23
+ <FmtCommitHash>9e8b86fd2d9806672cc73133d21780dd182bfd24</FmtCommitHash>
24
24
  </PropertyGroup>
25
25
 
26
26
  <PropertyGroup Label="Configuration">
@@ -55,6 +55,7 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
55
55
  _prevComponent: any;
56
56
  _propsAnimated: AnimatedProps;
57
57
  _eventDetachers: Array<Function> = [];
58
+ _initialAnimatedProps: Object;
58
59
 
59
60
  // Only to be used in this file, and only in Fabric.
60
61
  _animatedComponentId: string = `${animatedComponentNextId++}:animatedComponent`;
@@ -200,11 +201,17 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
200
201
  });
201
202
 
202
203
  render() {
203
- const {style = {}, ...props} = this._propsAnimated.__getValue() || {};
204
+ const animatedProps =
205
+ this._propsAnimated.__getValue(this._initialAnimatedProps) || {};
206
+ const {style = {}, ...props} = animatedProps;
204
207
  const {style: passthruStyle = {}, ...passthruProps} =
205
208
  this.props.passthroughAnimatedPropExplicitValues || {};
206
209
  const mergedStyle = {...style, ...passthruStyle};
207
210
 
211
+ if (!this._initialAnimatedProps) {
212
+ this._initialAnimatedProps = animatedProps;
213
+ }
214
+
208
215
  // Force `collapsable` to be false so that native view is not flattened.
209
216
  // Flattened views cannot be accurately referenced by a native driver.
210
217
  return (
@@ -36,18 +36,31 @@ class AnimatedProps extends AnimatedNode {
36
36
  this._callback = callback;
37
37
  }
38
38
 
39
- __getValue(): Object {
39
+ __getValue(initialProps: ?Object): Object {
40
40
  const props: {[string]: any | ((...args: any) => void)} = {};
41
41
  for (const key in this._props) {
42
42
  const value = this._props[key];
43
43
  if (value instanceof AnimatedNode) {
44
- props[key] = value.__getValue();
44
+ // During initial render we want to use the initial value of both natively and non-natively
45
+ // driven nodes. On subsequent renders, we cannot use the value of natively driven nodes
46
+ // as they may not be up to date, so we use the initial value to ensure that values of
47
+ // native animated nodes do not impact rerenders.
48
+ if (value instanceof AnimatedStyle) {
49
+ props[key] = value.__getValue(
50
+ initialProps ? initialProps.style : null,
51
+ );
52
+ } else if (!initialProps || !value.__isNative) {
53
+ props[key] = value.__getValue();
54
+ } else if (initialProps.hasOwnProperty(key)) {
55
+ props[key] = initialProps[key];
56
+ }
45
57
  } else if (value instanceof AnimatedEvent) {
46
58
  props[key] = value.__getHandler();
47
59
  } else {
48
60
  props[key] = value;
49
61
  }
50
62
  }
63
+
51
64
  return props;
52
65
  }
53
66
 
@@ -34,15 +34,23 @@ class AnimatedStyle extends AnimatedWithChildren {
34
34
  }
35
35
 
36
36
  // Recursively get values for nested styles (like iOS's shadowOffset)
37
- _walkStyleAndGetValues(style: any) {
37
+ _walkStyleAndGetValues(style: any, initialStyle: ?Object) {
38
38
  const updatedStyle: {[string]: any | {...}} = {};
39
39
  for (const key in style) {
40
40
  const value = style[key];
41
41
  if (value instanceof AnimatedNode) {
42
- updatedStyle[key] = value.__getValue();
42
+ // During initial render we want to use the initial value of both natively and non-natively
43
+ // driven nodes. On subsequent renders, we cannot use the value of natively driven nodes
44
+ // as they may not be up to date, so we use the initial value to ensure that values of
45
+ // native animated nodes do not impact rerenders.
46
+ if (!initialStyle || !value.__isNative) {
47
+ updatedStyle[key] = value.__getValue();
48
+ } else if (initialStyle.hasOwnProperty(key)) {
49
+ updatedStyle[key] = initialStyle[key];
50
+ }
43
51
  } else if (value && !Array.isArray(value) && typeof value === 'object') {
44
52
  // Support animating nested values (for example: shadowOffset.height)
45
- updatedStyle[key] = this._walkStyleAndGetValues(value);
53
+ updatedStyle[key] = this._walkStyleAndGetValues(value, initialStyle);
46
54
  } else {
47
55
  updatedStyle[key] = value;
48
56
  }
@@ -50,8 +58,8 @@ class AnimatedStyle extends AnimatedWithChildren {
50
58
  return updatedStyle;
51
59
  }
52
60
 
53
- __getValue(): Object {
54
- return this._walkStyleAndGetValues(this._style);
61
+ __getValue(initialStyle: ?Object): Object {
62
+ return this._walkStyleAndGetValues(this._style, initialStyle);
55
63
  }
56
64
 
57
65
  // Recursively get animated values for nested styles (like iOS's shadowOffset)
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 0,
15
15
  patch: 0,
16
- prerelease: '20220603-2051-11141b8b3',
16
+ prerelease: '20220608-2049-77e6bff62',
17
17
  };
@@ -42,6 +42,8 @@ const FillRateHelper = require('./FillRateHelper');
42
42
  const ViewabilityHelper = require('./ViewabilityHelper');
43
43
  const invariant = require('invariant');
44
44
 
45
+ const ON_END_REACHED_EPSILON = 0.001;
46
+
45
47
  type Item = any;
46
48
 
47
49
  export type Separators = {
@@ -218,7 +220,8 @@ type OptionalProps = {|
218
220
  * How far from the end (in units of visible length of the list) the bottom edge of the
219
221
  * list must be from the end of the content to trigger the `onEndReached` callback.
220
222
  * Thus a value of 0.5 will trigger `onEndReached` when the end of the content is
221
- * within half the visible length of the list.
223
+ * within half the visible length of the list. A value of 0 will not trigger until scrolling
224
+ * to the very end of the list.
222
225
  */
223
226
  onEndReachedThreshold?: ?number,
224
227
  /**
@@ -1516,13 +1519,22 @@ class VirtualizedList extends React.PureComponent<Props, State> {
1516
1519
  const {data, getItemCount, onEndReached, onEndReachedThreshold} =
1517
1520
  this.props;
1518
1521
  const {contentLength, visibleLength, offset} = this._scrollMetrics;
1519
- const distanceFromEnd = contentLength - visibleLength - offset;
1522
+ let distanceFromEnd = contentLength - visibleLength - offset;
1523
+
1524
+ // Especially when oERT is zero it's necessary to 'floor' very small distanceFromEnd values to be 0
1525
+ // since debouncing causes us to not fire this event for every single "pixel" we scroll and can thus
1526
+ // be at the "end" of the list with a distanceFromEnd approximating 0 but not quite there.
1527
+ if (distanceFromEnd < ON_END_REACHED_EPSILON) {
1528
+ distanceFromEnd = 0;
1529
+ }
1530
+
1531
+ // TODO: T121172172 Look into why we're "defaulting" to a threshold of 2 when oERT is not present
1520
1532
  const threshold =
1521
1533
  onEndReachedThreshold != null ? onEndReachedThreshold * visibleLength : 2;
1522
1534
  if (
1523
1535
  onEndReached &&
1524
1536
  this.state.last === getItemCount(data) - 1 &&
1525
- distanceFromEnd < threshold &&
1537
+ distanceFromEnd <= threshold &&
1526
1538
  this._scrollMetrics.contentLength !== this._sentEndForContentLength
1527
1539
  ) {
1528
1540
  // Only call onEndReached once for a given content length
@@ -125,6 +125,18 @@ const bubblingEventTypes = {
125
125
  skipBubbling: true,
126
126
  },
127
127
  },
128
+ topPointerOver: {
129
+ phasedRegistrationNames: {
130
+ captured: 'onPointerOverCapture',
131
+ bubbled: 'onPointerOver',
132
+ },
133
+ },
134
+ topPointerOut: {
135
+ phasedRegistrationNames: {
136
+ captured: 'onPointerOutCapture',
137
+ bubbled: 'onPointerOut',
138
+ },
139
+ },
128
140
  };
129
141
 
130
142
  const directEventTypes = {
@@ -315,6 +327,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({
315
327
  onPointerEnter2: true,
316
328
  onPointerMove2: true,
317
329
  onPointerLeave2: true,
330
+ onPointerOver: true,
331
+ onPointerOut: true,
318
332
  });
319
333
 
320
334
  /**
@@ -125,6 +125,18 @@ const bubblingEventTypes = {
125
125
  skipBubbling: true,
126
126
  },
127
127
  },
128
+ topPointerOver: {
129
+ phasedRegistrationNames: {
130
+ captured: 'onPointerOverCapture',
131
+ bubbled: 'onPointerOver',
132
+ },
133
+ },
134
+ topPointerOut: {
135
+ phasedRegistrationNames: {
136
+ captured: 'onPointerOutCapture',
137
+ bubbled: 'onPointerOut',
138
+ },
139
+ },
128
140
  };
129
141
 
130
142
  const directEventTypes = {
@@ -315,6 +327,8 @@ const validAttributesForEventProps = ConditionallyIgnoredEventHandlers({
315
327
  onPointerEnter2: true,
316
328
  onPointerMove2: true,
317
329
  onPointerLeave2: true,
330
+ onPointerOver: true,
331
+ onPointerOut: true,
318
332
  });
319
333
 
320
334
  /**
@@ -32,6 +32,8 @@ export type PermissionType =
32
32
  | 'android.permission.READ_CALL_LOG'
33
33
  | 'android.permission.WRITE_CALL_LOG'
34
34
  | 'com.android.voicemail.permission.ADD_VOICEMAIL'
35
+ | 'com.android.voicemail.permission.READ_VOICEMAIL'
36
+ | 'com.android.voicemail.permission.WRITE_VOICEMAIL'
35
37
  | 'android.permission.USE_SIP'
36
38
  | 'android.permission.PROCESS_OUTGOING_CALLS'
37
39
  | 'android.permission.BODY_SENSORS'
@@ -49,6 +49,8 @@ const PERMISSIONS = Object.freeze({
49
49
  READ_CALL_LOG: 'android.permission.READ_CALL_LOG',
50
50
  WRITE_CALL_LOG: 'android.permission.WRITE_CALL_LOG',
51
51
  ADD_VOICEMAIL: 'com.android.voicemail.permission.ADD_VOICEMAIL',
52
+ READ_VOICEMAIL: 'com.android.voicemail.permission.READ_VOICEMAIL',
53
+ WRITE_VOICEMAIL: 'com.android.voicemail.permission.WRITE_VOICEMAIL',
52
54
  USE_SIP: 'android.permission.USE_SIP',
53
55
  PROCESS_OUTGOING_CALLS: 'android.permission.PROCESS_OUTGOING_CALLS',
54
56
  BODY_SENSORS: 'android.permission.BODY_SENSORS',
@@ -91,6 +93,8 @@ class PermissionsAndroid {
91
93
  ACCESS_MEDIA_LOCATION: string,
92
94
  ACTIVITY_RECOGNITION: string,
93
95
  ADD_VOICEMAIL: string,
96
+ READ_VOICEMAIL: string,
97
+ WRITE_VOICEMAIL: string,
94
98
  ANSWER_PHONE_CALLS: string,
95
99
  BLUETOOTH_ADVERTISE: string,
96
100
  BLUETOOTH_CONNECT: string,