@office-iss/react-native-win32 0.0.0-canary.277 → 0.0.0-canary.278
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/CHANGELOG.json +16 -1
- package/CHANGELOG.md +12 -4
- package/Libraries/Animated/NativeAnimatedAllowlist.js +4 -4
- package/Libraries/Animated/animations/Animation.js +13 -1
- package/Libraries/Animated/animations/DecayAnimation.js +1 -0
- package/Libraries/Animated/animations/SpringAnimation.js +1 -0
- package/Libraries/Animated/animations/TimingAnimation.js +1 -0
- package/Libraries/Animated/nodes/AnimatedAddition.js +8 -2
- package/Libraries/Animated/nodes/AnimatedColor.js +4 -1
- package/Libraries/Animated/nodes/AnimatedDiffClamp.js +9 -2
- package/Libraries/Animated/nodes/AnimatedDivision.js +8 -2
- package/Libraries/Animated/nodes/AnimatedInterpolation.js +4 -1
- package/Libraries/Animated/nodes/AnimatedModulo.js +4 -2
- package/Libraries/Animated/nodes/AnimatedMultiplication.js +8 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +25 -0
- package/Libraries/Animated/nodes/AnimatedObject.js +8 -2
- package/Libraries/Animated/nodes/AnimatedProps.js +13 -2
- package/Libraries/Animated/nodes/AnimatedStyle.js +13 -2
- package/Libraries/Animated/nodes/AnimatedSubtraction.js +8 -2
- package/Libraries/Animated/nodes/AnimatedTracking.js +4 -1
- package/Libraries/Animated/nodes/AnimatedTransform.js +4 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +4 -1
- package/Libraries/Animated/nodes/AnimatedValueXY.js +3 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Network/FormData.js +11 -3
- package/Libraries/Text/Text.d.ts +6 -1
- package/Libraries/Text/TextProps.js +2 -2
- package/Libraries/Text/TextProps.win32.js +2 -2
- package/overrides.json +3 -3
- package/package.json +10 -11
- package/src/private/animated/useAnimatedPropsMemo.js +12 -4
- package/src/private/featureflags/ReactNativeFeatureFlags.js +7 -7
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +2 -2
- package/src/private/webapis/intersectionobserver/IntersectionObserver.js +11 -11
- package/src/private/webapis/intersectionobserver/IntersectionObserverEntry.js +1 -1
- package/src/private/webapis/intersectionobserver/IntersectionObserverManager.js +1 -1
- package/src/private/webapis/intersectionobserver/specs/NativeIntersectionObserver.js +1 -0
- package/src/private/webapis/performance/Performance.js +0 -12
- package/src/private/webapis/performance/specs/NativePerformance.js +0 -11
- package/src-win/Libraries/Text/Text.d.ts +6 -1
- package/Libraries/ReactNative/__mocks__/FabricUIManager.js +0 -334
- package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +0 -413
- package/src/private/webapis/intersectionobserver/specs/__mocks__/NativeIntersectionObserver.js +0 -181
- package/src/private/webapis/mutationobserver/specs/__mocks__/NativeMutationObserver.js +0 -327
|
@@ -28,6 +28,15 @@ type FormDataPart =
|
|
|
28
28
|
...
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Encode a FormData filename compliant with RFC 2183
|
|
33
|
+
*
|
|
34
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition#directives
|
|
35
|
+
*/
|
|
36
|
+
function encodeFilename(filename: string): string {
|
|
37
|
+
return encodeURIComponent(filename.replace(/\//g, '_'));
|
|
38
|
+
}
|
|
39
|
+
|
|
31
40
|
/**
|
|
32
41
|
* Polyfill for XMLHttpRequest2 FormData API, allowing multipart POST requests
|
|
33
42
|
* with mixed data (string, native files) to be submitted via XMLHttpRequest.
|
|
@@ -82,9 +91,8 @@ class FormData {
|
|
|
82
91
|
// content type (cf. web Blob interface.)
|
|
83
92
|
if (typeof value === 'object' && !Array.isArray(value) && value) {
|
|
84
93
|
if (typeof value.name === 'string') {
|
|
85
|
-
headers['content-disposition'] +=
|
|
86
|
-
value.name
|
|
87
|
-
}"; filename*=utf-8''${encodeURI(value.name)}`;
|
|
94
|
+
headers['content-disposition'] +=
|
|
95
|
+
`; filename="${encodeFilename(value.name)}"`;
|
|
88
96
|
}
|
|
89
97
|
if (typeof value.type === 'string') {
|
|
90
98
|
headers['content-type'] = value.type;
|
package/Libraries/Text/Text.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {Constructor} from '../../types/private/Utilities';
|
|
|
12
12
|
import {AccessibilityProps} from '../Components/View/ViewAccessibility';
|
|
13
13
|
import {NativeMethods} from '../../types/public/ReactNativeTypes';
|
|
14
14
|
import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet';
|
|
15
|
-
import {TextStyle} from '../StyleSheet/StyleSheetTypes';
|
|
15
|
+
import {TextStyle, ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
|
16
16
|
import {
|
|
17
17
|
GestureResponderEvent,
|
|
18
18
|
LayoutChangeEvent,
|
|
@@ -294,6 +294,11 @@ export interface TextProps
|
|
|
294
294
|
* Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
|
|
295
295
|
*/
|
|
296
296
|
minimumFontScale?: number | undefined;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Controls how touch events are handled. Similar to `View`'s `pointerEvents`.
|
|
300
|
+
*/
|
|
301
|
+
pointerEvents?: ViewStyle['pointerEvents'] | undefined;
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
/**
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
AccessibilityState,
|
|
18
18
|
Role,
|
|
19
19
|
} from '../Components/View/ViewAccessibility';
|
|
20
|
-
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
20
|
+
import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
21
21
|
import type {
|
|
22
22
|
LayoutEvent,
|
|
23
23
|
PointerEvent,
|
|
@@ -212,7 +212,7 @@ export type TextProps = $ReadOnly<{
|
|
|
212
212
|
*
|
|
213
213
|
* See https://reactnative.dev/docs/text#selectioncolor
|
|
214
214
|
*/
|
|
215
|
-
selectionColor?: ?
|
|
215
|
+
selectionColor?: ?ColorValue,
|
|
216
216
|
|
|
217
217
|
dataDetectorType?: ?('phoneNumber' | 'link' | 'email' | 'none' | 'all'),
|
|
218
218
|
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
AccessibilityState,
|
|
18
18
|
Role,
|
|
19
19
|
} from '../Components/View/ViewAccessibility';
|
|
20
|
-
import type {TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
20
|
+
import type {ColorValue, TextStyleProp} from '../StyleSheet/StyleSheet';
|
|
21
21
|
import type {
|
|
22
22
|
LayoutEvent,
|
|
23
23
|
PointerEvent,
|
|
@@ -225,7 +225,7 @@ export type TextProps = $ReadOnly<{
|
|
|
225
225
|
*
|
|
226
226
|
* See https://reactnative.dev/docs/text#selectioncolor
|
|
227
227
|
*/
|
|
228
|
-
selectionColor?: ?
|
|
228
|
+
selectionColor?: ?ColorValue,
|
|
229
229
|
|
|
230
230
|
dataDetectorType?: ?('phoneNumber' | 'link' | 'email' | 'none' | 'all'),
|
|
231
231
|
|
package/overrides.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src-win/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.78.0-nightly-
|
|
10
|
+
"baseVersion": "0.78.0-nightly-20241210-6d235853f",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
"type": "derived",
|
|
421
421
|
"file": "src-win/Libraries/Text/Text.d.ts",
|
|
422
422
|
"baseFile": "packages/react-native/Libraries/Text/Text.d.ts",
|
|
423
|
-
"baseHash": "
|
|
423
|
+
"baseHash": "21dab7f71254c429d592827ab313f77c18baeda1"
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
"type": "derived",
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
"type": "derived",
|
|
440
440
|
"file": "src-win/Libraries/Text/TextProps.win32.js",
|
|
441
441
|
"baseFile": "packages/react-native/Libraries/Text/TextProps.js",
|
|
442
|
-
"baseHash": "
|
|
442
|
+
"baseHash": "ef1efdc0fb302273cd98be71aef2986677dda184"
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
"type": "patch",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.278",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"@react-native-community/cli-platform-android": "15.0.0-alpha.2",
|
|
31
31
|
"@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
|
|
32
32
|
"@react-native/assets": "1.0.0",
|
|
33
|
-
"@react-native/assets-registry": "0.78.0-nightly-
|
|
34
|
-
"@react-native/codegen": "0.78.0-nightly-
|
|
35
|
-
"@react-native/community-cli-plugin": "0.78.0-nightly-
|
|
36
|
-
"@react-native/gradle-plugin": "0.78.0-nightly-
|
|
37
|
-
"@react-native/js-polyfills": "0.78.0-nightly-
|
|
38
|
-
"@react-native/normalize-colors": "0.78.0-nightly-
|
|
39
|
-
"@react-native/virtualized-lists": "0.78.0-nightly-
|
|
33
|
+
"@react-native/assets-registry": "0.78.0-nightly-20241210-6d235853f",
|
|
34
|
+
"@react-native/codegen": "0.78.0-nightly-20241210-6d235853f",
|
|
35
|
+
"@react-native/community-cli-plugin": "0.78.0-nightly-20241210-6d235853f",
|
|
36
|
+
"@react-native/gradle-plugin": "0.78.0-nightly-20241210-6d235853f",
|
|
37
|
+
"@react-native/js-polyfills": "0.78.0-nightly-20241210-6d235853f",
|
|
38
|
+
"@react-native/normalize-colors": "0.78.0-nightly-20241210-6d235853f",
|
|
39
|
+
"@react-native/virtualized-lists": "0.78.0-nightly-20241210-6d235853f",
|
|
40
40
|
"abort-controller": "^3.0.0",
|
|
41
41
|
"anser": "^1.4.9",
|
|
42
42
|
"ansi-regex": "^5.0.0",
|
|
@@ -51,7 +51,6 @@
|
|
|
51
51
|
"glob": "^7.1.1",
|
|
52
52
|
"invariant": "^2.2.4",
|
|
53
53
|
"jest-environment-node": "^29.6.3",
|
|
54
|
-
"jsc-android": "^250231.0.0",
|
|
55
54
|
"memoize-one": "^5.0.0",
|
|
56
55
|
"metro-runtime": "^0.81.0",
|
|
57
56
|
"metro-source-map": "^0.81.0",
|
|
@@ -90,14 +89,14 @@
|
|
|
90
89
|
"just-scripts": "^1.3.3",
|
|
91
90
|
"prettier": "2.8.8",
|
|
92
91
|
"react": "18.3.1",
|
|
93
|
-
"react-native": "0.78.0-nightly-
|
|
92
|
+
"react-native": "0.78.0-nightly-20241210-6d235853f",
|
|
94
93
|
"react-native-platform-override": "^1.9.49",
|
|
95
94
|
"typescript": "5.0.4"
|
|
96
95
|
},
|
|
97
96
|
"peerDependencies": {
|
|
98
97
|
"@types/react": "^18.2.6",
|
|
99
98
|
"react": "^18.2.0",
|
|
100
|
-
"react-native": "0.78.0-nightly-
|
|
99
|
+
"react-native": "0.78.0-nightly-20241210-6d235853f"
|
|
101
100
|
},
|
|
102
101
|
"beachball": {
|
|
103
102
|
"defaultNpmTag": "canary",
|
|
@@ -113,7 +113,7 @@ export function createCompositeKeyForProps(
|
|
|
113
113
|
const key = keys[ii];
|
|
114
114
|
const value = props[key];
|
|
115
115
|
|
|
116
|
-
if (allowlist == null ||
|
|
116
|
+
if (allowlist == null || hasOwn(allowlist, key)) {
|
|
117
117
|
let compositeKeyComponent;
|
|
118
118
|
if (key === 'style') {
|
|
119
119
|
// $FlowFixMe[incompatible-call] - `style` is a valid argument.
|
|
@@ -205,7 +205,7 @@ function createCompositeKeyForObject(
|
|
|
205
205
|
for (let ii = 0, length = keys.length; ii < length; ii++) {
|
|
206
206
|
const key = keys[ii];
|
|
207
207
|
|
|
208
|
-
if (allowlist == null ||
|
|
208
|
+
if (allowlist == null || hasOwn(allowlist, key)) {
|
|
209
209
|
const value = object[key];
|
|
210
210
|
|
|
211
211
|
let compositeKeyComponent;
|
|
@@ -250,7 +250,7 @@ export function areCompositeKeysEqual(
|
|
|
250
250
|
}
|
|
251
251
|
for (let ii = 0; ii < length; ii++) {
|
|
252
252
|
const key = keys[ii];
|
|
253
|
-
if (!
|
|
253
|
+
if (!hasOwn(next, key)) {
|
|
254
254
|
return false;
|
|
255
255
|
}
|
|
256
256
|
const prevComponent = prev[key];
|
|
@@ -336,7 +336,7 @@ function areCompositeKeyComponentsEqual(
|
|
|
336
336
|
for (let ii = 0; ii < length; ii++) {
|
|
337
337
|
const key = keys[ii];
|
|
338
338
|
if (
|
|
339
|
-
!
|
|
339
|
+
!hasOwn(nullthrows(next), key) ||
|
|
340
340
|
!areCompositeKeyComponentsEqual(prev[key], next[key])
|
|
341
341
|
) {
|
|
342
342
|
return false;
|
|
@@ -346,3 +346,11 @@ function areCompositeKeyComponentsEqual(
|
|
|
346
346
|
}
|
|
347
347
|
return false;
|
|
348
348
|
}
|
|
349
|
+
|
|
350
|
+
// Supported versions of JSC do not implement the newer Object.hasOwn. Remove
|
|
351
|
+
// this shim when they do.
|
|
352
|
+
// $FlowIgnore[method-unbinding]
|
|
353
|
+
const _hasOwnProp = Object.prototype.hasOwnProperty;
|
|
354
|
+
const hasOwn: (obj: $ReadOnly<{...}>, prop: string) => boolean =
|
|
355
|
+
// $FlowIgnore[method-unbinding]
|
|
356
|
+
Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<67e1f8c80caedcbf7b28a089a2744b9a>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -64,7 +64,6 @@ export type ReactNativeFeatureFlags = {
|
|
|
64
64
|
enableEventEmitterRetentionDuringGesturesOnAndroid: Getter<boolean>,
|
|
65
65
|
enableFabricLogs: Getter<boolean>,
|
|
66
66
|
enableFabricRenderer: Getter<boolean>,
|
|
67
|
-
enableFabricRendererExclusively: Getter<boolean>,
|
|
68
67
|
enableFixForViewCommandRace: Getter<boolean>,
|
|
69
68
|
enableGranularShadowTreeStateReconciliation: Getter<boolean>,
|
|
70
69
|
enableIOSViewClipToPaddingBox: Getter<boolean>,
|
|
@@ -80,6 +79,7 @@ export type ReactNativeFeatureFlags = {
|
|
|
80
79
|
enableUIConsistency: Getter<boolean>,
|
|
81
80
|
enableViewRecycling: Getter<boolean>,
|
|
82
81
|
excludeYogaFromRawProps: Getter<boolean>,
|
|
82
|
+
fixDifferentiatorEmittingUpdatesWithWrongParentTag: Getter<boolean>,
|
|
83
83
|
fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
|
|
84
84
|
fixMountingCoordinatorReportedPendingTransactionsOnAndroid: Getter<boolean>,
|
|
85
85
|
fuseboxEnabledDebug: Getter<boolean>,
|
|
@@ -240,10 +240,6 @@ export const enableFabricLogs: Getter<boolean> = createNativeFlagGetter('enableF
|
|
|
240
240
|
* Enables the use of the Fabric renderer in the whole app.
|
|
241
241
|
*/
|
|
242
242
|
export const enableFabricRenderer: Getter<boolean> = createNativeFlagGetter('enableFabricRenderer', false);
|
|
243
|
-
/**
|
|
244
|
-
* When the app is completely migrated to Fabric, set this flag to true to disable parts of Paper infrastructure that are not needed anymore but consume memory and CPU. Specifically, UIViewOperationQueue and EventDispatcherImpl will no longer work as they will not subscribe to ReactChoreographer for updates.
|
|
245
|
-
*/
|
|
246
|
-
export const enableFabricRendererExclusively: Getter<boolean> = createNativeFlagGetter('enableFabricRendererExclusively', false);
|
|
247
243
|
/**
|
|
248
244
|
* Synchronise the view command dispatching with mounting of new transaction
|
|
249
245
|
*/
|
|
@@ -304,6 +300,10 @@ export const enableViewRecycling: Getter<boolean> = createNativeFlagGetter('enab
|
|
|
304
300
|
* When enabled, rawProps in Props will not include Yoga specific props.
|
|
305
301
|
*/
|
|
306
302
|
export const excludeYogaFromRawProps: Getter<boolean> = createNativeFlagGetter('excludeYogaFromRawProps', false);
|
|
303
|
+
/**
|
|
304
|
+
* Fixes a bug in Differentiator where parent views may be referenced before they're created
|
|
305
|
+
*/
|
|
306
|
+
export const fixDifferentiatorEmittingUpdatesWithWrongParentTag: Getter<boolean> = createNativeFlagGetter('fixDifferentiatorEmittingUpdatesWithWrongParentTag', true);
|
|
307
307
|
/**
|
|
308
308
|
* Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.
|
|
309
309
|
*/
|
|
@@ -363,7 +363,7 @@ export const useOptimizedEventBatchingOnAndroid: Getter<boolean> = createNativeF
|
|
|
363
363
|
/**
|
|
364
364
|
* When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.
|
|
365
365
|
*/
|
|
366
|
-
export const useRuntimeShadowNodeReferenceUpdate: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdate',
|
|
366
|
+
export const useRuntimeShadowNodeReferenceUpdate: Getter<boolean> = createNativeFlagGetter('useRuntimeShadowNodeReferenceUpdate', true);
|
|
367
367
|
/**
|
|
368
368
|
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
|
369
369
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<fa9dcd18f2e50de520995ce1f26b111e>>
|
|
8
8
|
* @flow strict
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -37,7 +37,6 @@ export interface Spec extends TurboModule {
|
|
|
37
37
|
+enableEventEmitterRetentionDuringGesturesOnAndroid?: () => boolean;
|
|
38
38
|
+enableFabricLogs?: () => boolean;
|
|
39
39
|
+enableFabricRenderer?: () => boolean;
|
|
40
|
-
+enableFabricRendererExclusively?: () => boolean;
|
|
41
40
|
+enableFixForViewCommandRace?: () => boolean;
|
|
42
41
|
+enableGranularShadowTreeStateReconciliation?: () => boolean;
|
|
43
42
|
+enableIOSViewClipToPaddingBox?: () => boolean;
|
|
@@ -53,6 +52,7 @@ export interface Spec extends TurboModule {
|
|
|
53
52
|
+enableUIConsistency?: () => boolean;
|
|
54
53
|
+enableViewRecycling?: () => boolean;
|
|
55
54
|
+excludeYogaFromRawProps?: () => boolean;
|
|
55
|
+
+fixDifferentiatorEmittingUpdatesWithWrongParentTag?: () => boolean;
|
|
56
56
|
+fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
|
|
57
57
|
+fixMountingCoordinatorReportedPendingTransactionsOnAndroid?: () => boolean;
|
|
58
58
|
+fuseboxEnabledDebug?: () => boolean;
|
|
@@ -33,10 +33,10 @@ type IntersectionObserverInit = {
|
|
|
33
33
|
* If set, it will either be a singular ratio value between 0-1 (inclusive)
|
|
34
34
|
* or an array of such ratios.
|
|
35
35
|
*
|
|
36
|
-
* Note: If `
|
|
36
|
+
* Note: If `rnRootThreshold` is set, and `threshold` is not set,
|
|
37
37
|
* `threshold` will not default to [0] (as per spec)
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
rnRootThreshold?: number | $ReadOnlyArray<number>,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -57,7 +57,7 @@ type IntersectionObserverInit = {
|
|
|
57
57
|
*
|
|
58
58
|
* This implementation only supports the `threshold` option at the moment
|
|
59
59
|
* (`root` and `rootMargin` are not supported) and provides a React Native specific
|
|
60
|
-
* option `
|
|
60
|
+
* option `rnRootThreshold`.
|
|
61
61
|
*
|
|
62
62
|
*/
|
|
63
63
|
export default class IntersectionObserver {
|
|
@@ -99,7 +99,7 @@ export default class IntersectionObserver {
|
|
|
99
99
|
|
|
100
100
|
this._callback = callback;
|
|
101
101
|
|
|
102
|
-
this._rootThresholds = normalizeRootThreshold(options?.
|
|
102
|
+
this._rootThresholds = normalizeRootThreshold(options?.rnRootThreshold);
|
|
103
103
|
this._thresholds = normalizeThreshold(
|
|
104
104
|
options?.threshold,
|
|
105
105
|
this._rootThresholds != null, // only provide default if no rootThreshold
|
|
@@ -136,9 +136,9 @@ export default class IntersectionObserver {
|
|
|
136
136
|
* threshold is a ratio of intersection area to bounding box area of an
|
|
137
137
|
* observed target.
|
|
138
138
|
* Notifications for a target are generated when any of the thresholds specified
|
|
139
|
-
* in `
|
|
139
|
+
* in `rnRootThreshold` or `threshold` are crossed for that target.
|
|
140
140
|
*
|
|
141
|
-
* If no value was passed to the constructor, and no `
|
|
141
|
+
* If no value was passed to the constructor, and no `rnRootThreshold`
|
|
142
142
|
* is set, `0` is used.
|
|
143
143
|
*/
|
|
144
144
|
get thresholds(): $ReadOnlyArray<number> {
|
|
@@ -150,9 +150,9 @@ export default class IntersectionObserver {
|
|
|
150
150
|
* threshold is a ratio of intersection area to bounding box area of the specified
|
|
151
151
|
* root view, which defaults to the viewport.
|
|
152
152
|
* Notifications for a target are generated when any of the thresholds specified
|
|
153
|
-
* in `
|
|
153
|
+
* in `rnRootThreshold` or `threshold` are crossed for that target.
|
|
154
154
|
*/
|
|
155
|
-
get
|
|
155
|
+
get rnRootThresholds(): $ReadOnlyArray<number> | null {
|
|
156
156
|
return this._rootThresholds;
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -293,7 +293,7 @@ function normalizeThreshold(
|
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
/**
|
|
296
|
-
* Converts the user defined `
|
|
296
|
+
* Converts the user defined `rnRootThreshold` value into an array of sorted valid
|
|
297
297
|
* threshold options for `IntersectionObserver` (double ∈ [0, 1]).
|
|
298
298
|
*
|
|
299
299
|
* If invalid array or null, returns null.
|
|
@@ -310,13 +310,13 @@ function normalizeRootThreshold(
|
|
|
310
310
|
): null | $ReadOnlyArray<number> {
|
|
311
311
|
if (Array.isArray(rootThreshold)) {
|
|
312
312
|
const normalizedArr = rootThreshold
|
|
313
|
-
.map(rt => normalizeThresholdValue(rt, '
|
|
313
|
+
.map(rt => normalizeThresholdValue(rt, 'rnRootThreshold'))
|
|
314
314
|
.filter((rt): rt is number => rt != null)
|
|
315
315
|
.sort();
|
|
316
316
|
return normalizedArr.length === 0 ? null : normalizedArr;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
const normalized = normalizeThresholdValue(rootThreshold, '
|
|
319
|
+
const normalized = normalizeThresholdValue(rootThreshold, 'rnRootThreshold');
|
|
320
320
|
return normalized == null ? null : [normalized];
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -77,7 +77,7 @@ export default class IntersectionObserverEntry {
|
|
|
77
77
|
/**
|
|
78
78
|
* Returns the ratio of the `intersectionRect` to the `boundingRootRect`.
|
|
79
79
|
*/
|
|
80
|
-
get
|
|
80
|
+
get rnRootIntersectionRatio(): number {
|
|
81
81
|
const intersectionRect = this.intersectionRect;
|
|
82
82
|
|
|
83
83
|
const rootRect = this._nativeEntry.rootRect;
|
|
@@ -162,7 +162,7 @@ export function observe({
|
|
|
162
162
|
intersectionObserverId,
|
|
163
163
|
targetShadowNode,
|
|
164
164
|
thresholds: registeredObserver.observer.thresholds,
|
|
165
|
-
rootThresholds: registeredObserver.observer.
|
|
165
|
+
rootThresholds: registeredObserver.observer.rnRootThresholds,
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
return true;
|
|
@@ -17,6 +17,7 @@ export type NativeIntersectionObserverEntry = {
|
|
|
17
17
|
targetInstanceHandle: mixed,
|
|
18
18
|
targetRect: $ReadOnlyArray<number>, // It's actually a tuple with x, y, width and height
|
|
19
19
|
rootRect: $ReadOnlyArray<number>, // It's actually a tuple with x, y, width and height
|
|
20
|
+
// TODO(T209328432) - Remove optionality of intersectionRect when native changes are released
|
|
20
21
|
intersectionRect: ?$ReadOnlyArray<number>, // It's actually a tuple with x, y, width and height
|
|
21
22
|
isIntersectingAboveThresholds: boolean,
|
|
22
23
|
time: number,
|
|
@@ -115,9 +115,6 @@ export default class Performance {
|
|
|
115
115
|
markName,
|
|
116
116
|
markOptions?.startTime,
|
|
117
117
|
);
|
|
118
|
-
} else if (NativePerformance?.mark) {
|
|
119
|
-
computedStartTime = markOptions?.startTime ?? performance.now();
|
|
120
|
-
NativePerformance?.mark?.(markName, computedStartTime);
|
|
121
118
|
} else {
|
|
122
119
|
warnNoNativePerformance();
|
|
123
120
|
computedStartTime = performance.now();
|
|
@@ -203,15 +200,6 @@ export default class Performance {
|
|
|
203
200
|
startMarkName,
|
|
204
201
|
endMarkName,
|
|
205
202
|
);
|
|
206
|
-
} else if (NativePerformance?.measure) {
|
|
207
|
-
NativePerformance.measure(
|
|
208
|
-
measureName,
|
|
209
|
-
startTime,
|
|
210
|
-
endTime,
|
|
211
|
-
duration,
|
|
212
|
-
startMarkName,
|
|
213
|
-
endMarkName,
|
|
214
|
-
);
|
|
215
203
|
} else {
|
|
216
204
|
warnNoNativePerformance();
|
|
217
205
|
}
|
|
@@ -45,17 +45,6 @@ export type PerformanceObserverInit = {
|
|
|
45
45
|
|
|
46
46
|
export interface Spec extends TurboModule {
|
|
47
47
|
+now?: () => number;
|
|
48
|
-
// TODO: remove when `markWithResult` is fully rolled out.
|
|
49
|
-
+mark?: (name: string, startTime: number) => void;
|
|
50
|
-
// TODO: remove when `measureWithResult` is fully rolled out.
|
|
51
|
-
+measure?: (
|
|
52
|
-
name: string,
|
|
53
|
-
startTime: number,
|
|
54
|
-
endTime: number,
|
|
55
|
-
duration?: number,
|
|
56
|
-
startMark?: string,
|
|
57
|
-
endMark?: string,
|
|
58
|
-
) => void;
|
|
59
48
|
+markWithResult?: (
|
|
60
49
|
name: string,
|
|
61
50
|
startTime?: number,
|
|
@@ -12,7 +12,7 @@ import {Constructor} from '../../types/private/Utilities';
|
|
|
12
12
|
import {AccessibilityProps} from '../Components/View/ViewAccessibility';
|
|
13
13
|
import {NativeMethods} from '../../types/public/ReactNativeTypes';
|
|
14
14
|
import {ColorValue, StyleProp} from '../StyleSheet/StyleSheet';
|
|
15
|
-
import {TextStyle} from '../StyleSheet/StyleSheetTypes';
|
|
15
|
+
import {TextStyle, ViewStyle} from '../StyleSheet/StyleSheetTypes';
|
|
16
16
|
import {
|
|
17
17
|
GestureResponderEvent,
|
|
18
18
|
LayoutChangeEvent,
|
|
@@ -294,6 +294,11 @@ export interface TextProps
|
|
|
294
294
|
* Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).
|
|
295
295
|
*/
|
|
296
296
|
minimumFontScale?: number | undefined;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Controls how touch events are handled. Similar to `View`'s `pointerEvents`.
|
|
300
|
+
*/
|
|
301
|
+
pointerEvents?: ViewStyle['pointerEvents'] | undefined;
|
|
297
302
|
}
|
|
298
303
|
|
|
299
304
|
/**
|