@office-iss/react-native-win32 0.0.0-canary.257 → 0.0.0-canary.259
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 +3 -3
- package/CHANGELOG.json +55 -1
- package/CHANGELOG.md +28 -8
- package/Libraries/Alert/Alert.js +3 -0
- package/Libraries/Animated/nodes/AnimatedValue.js +1 -0
- package/Libraries/Animated/useAnimatedProps.js +68 -3
- package/Libraries/BatchedBridge/NativeModules.js +2 -0
- package/Libraries/Components/ScrollView/ScrollView.js +124 -165
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/TextInput/TextInput.js +204 -73
- package/Libraries/Components/TextInput/TextInput.win32.js +204 -79
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +11 -0
- package/Libraries/Core/ErrorHandlers.js +9 -0
- package/Libraries/Core/ExceptionsManager.js +2 -0
- package/Libraries/Core/InitializeCore.js +2 -0
- package/Libraries/Core/ReactFiberErrorDialog.js +3 -0
- package/Libraries/Core/ReactNativeVersion.js +3 -3
- package/Libraries/Core/ReactNativeVersionCheck.win32.js +1 -1
- package/Libraries/Core/setUpGlobals.js +1 -0
- package/Libraries/Core/setUpReactRefresh.js +0 -4
- package/Libraries/Image/ImageViewNativeComponent.js +1 -0
- package/Libraries/Interaction/TaskQueue.js +1 -0
- package/Libraries/Lists/SectionList.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +1 -0
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.js +20 -8
- package/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js +20 -8
- package/Libraries/NativeComponent/BaseViewConfig.android.js +1 -0
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +3 -0
- package/Libraries/NativeComponent/BaseViewConfig.win32.js +3 -0
- package/Libraries/NativeComponent/NativeComponentRegistry.js +9 -2
- package/Libraries/ReactNative/AppContainer-dev.js +1 -5
- package/Libraries/ReactNative/AppContainer-prod.js +1 -5
- package/Libraries/ReactNative/AppContainer.js +0 -1
- package/Libraries/ReactNative/AppRegistry.js +0 -6
- package/Libraries/ReactNative/BridgelessUIManager.js +1 -0
- package/Libraries/ReactNative/renderApplication.js +0 -2
- package/Libraries/Renderer/shims/ReactNativeTypes.js +3 -1
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +46 -0
- package/Libraries/StyleSheet/StyleSheetTypes.js +48 -5
- package/Libraries/StyleSheet/processBoxShadow.js +211 -0
- package/Libraries/StyleSheet/processFilter.js +226 -41
- package/Libraries/Text/Text.js +393 -196
- package/Libraries/Text/Text.win32.js +440 -228
- package/Libraries/TurboModule/TurboModuleRegistry.js +13 -50
- package/Libraries/Types/CodegenTypes.js +3 -1
- package/Libraries/Utilities/HMRClient.js +1 -0
- package/Libraries/Utilities/Platform.android.js +1 -1
- package/Libraries/Utilities/Platform.d.ts +1 -1
- package/Libraries/Utilities/Platform.flow.js +2 -2
- package/Libraries/Utilities/Platform.flow.win32.js +3 -3
- package/Libraries/Utilities/Platform.ios.js +1 -1
- package/Libraries/Utilities/Platform.win32.js +1 -1
- package/Libraries/vendor/emitter/EventEmitter.js +1 -0
- package/index.js +1 -0
- package/index.win32.js +1 -0
- package/jest/mockComponent.js +4 -1
- package/jest/setup.js +8 -1
- package/overrides.json +11 -11
- package/package.json +23 -23
- package/src/private/core/components/HScrollViewNativeComponents.js +55 -0
- package/src/private/core/components/VScrollViewNativeComponents.js +47 -0
- package/src/private/core/components/useSyncOnScroll.js +48 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +70 -12
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +12 -4
- package/src/private/specs/modules/NativeLinkingManager.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsAndroid.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsIOS.js +1 -1
- package/src/private/specs/modules/NativePlatformConstantsWin.js +8 -1
- package/src/private/specs/modules/NativeSampleTurboModule.js +14 -1
- package/src/private/webapis/performance/PerformanceEntry.js +1 -1
- package/src/private/webapis/performance/RawPerformanceEntry.js +5 -0
- package/types/experimental.d.ts +12 -1
- package/Libraries/Text/TextOptimized.js +0 -538
|
@@ -16,52 +16,25 @@ const NativeModules = require('../BatchedBridge/NativeModules');
|
|
|
16
16
|
|
|
17
17
|
const turboModuleProxy = global.__turboModuleProxy;
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
TurboModules: ([]: Array<string>),
|
|
22
|
-
NotFound: ([]: Array<string>),
|
|
23
|
-
};
|
|
19
|
+
const useLegacyNativeModuleInterop =
|
|
20
|
+
global.RN$Bridgeless !== true || global.RN$TurboInterop === true;
|
|
24
21
|
|
|
25
|
-
function isBridgeless() {
|
|
26
|
-
return global.RN$Bridgeless === true;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function isTurboModuleInteropEnabled() {
|
|
30
|
-
return global.RN$TurboInterop === true;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// TODO(154308585): Remove "module not found" debug info logging
|
|
34
|
-
function shouldReportDebugInfo() {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// TODO(148943970): Consider reversing the lookup here:
|
|
39
|
-
// Lookup on __turboModuleProxy, then lookup on nativeModuleProxy
|
|
40
22
|
function requireModule<T: TurboModule>(name: string): ?T {
|
|
41
|
-
if (!isBridgeless() || isTurboModuleInteropEnabled()) {
|
|
42
|
-
// Backward compatibility layer during migration.
|
|
43
|
-
const legacyModule = NativeModules[name];
|
|
44
|
-
if (legacyModule != null) {
|
|
45
|
-
if (shouldReportDebugInfo()) {
|
|
46
|
-
moduleLoadHistory.NativeModules.push(name);
|
|
47
|
-
}
|
|
48
|
-
return ((legacyModule: $FlowFixMe): T);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
23
|
if (turboModuleProxy != null) {
|
|
53
24
|
const module: ?T = turboModuleProxy(name);
|
|
54
25
|
if (module != null) {
|
|
55
|
-
if (shouldReportDebugInfo()) {
|
|
56
|
-
moduleLoadHistory.TurboModules.push(name);
|
|
57
|
-
}
|
|
58
26
|
return module;
|
|
59
27
|
}
|
|
60
28
|
}
|
|
61
29
|
|
|
62
|
-
if (
|
|
63
|
-
|
|
30
|
+
if (useLegacyNativeModuleInterop) {
|
|
31
|
+
// Backward compatibility layer during migration.
|
|
32
|
+
const legacyModule: ?T = NativeModules[name];
|
|
33
|
+
if (legacyModule != null) {
|
|
34
|
+
return legacyModule;
|
|
35
|
+
}
|
|
64
36
|
}
|
|
37
|
+
|
|
65
38
|
return null;
|
|
66
39
|
}
|
|
67
40
|
|
|
@@ -71,20 +44,10 @@ export function get<T: TurboModule>(name: string): ?T {
|
|
|
71
44
|
|
|
72
45
|
export function getEnforcing<T: TurboModule>(name: string): T {
|
|
73
46
|
const module = requireModule<T>(name);
|
|
74
|
-
|
|
47
|
+
invariant(
|
|
48
|
+
module != null,
|
|
75
49
|
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (shouldReportDebugInfo()) {
|
|
79
|
-
message +=
|
|
80
|
-
' Bridgeless mode: ' + (isBridgeless() ? 'true' : 'false') + '. ';
|
|
81
|
-
message +=
|
|
82
|
-
'TurboModule interop: ' +
|
|
83
|
-
(isTurboModuleInteropEnabled() ? 'true' : 'false') +
|
|
84
|
-
'. ';
|
|
85
|
-
message += 'Modules loaded: ' + JSON.stringify(moduleLoadHistory);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
invariant(module != null, message);
|
|
50
|
+
'Verify that a module by this name is registered in the native binary.',
|
|
51
|
+
);
|
|
89
52
|
return module;
|
|
90
53
|
}
|
|
@@ -42,4 +42,6 @@ type DefaultTypes = number | boolean | string | $ReadOnlyArray<string>;
|
|
|
42
42
|
// eslint-disable-next-line no-unused-vars
|
|
43
43
|
export type WithDefault<Type: DefaultTypes, Value: ?Type | string> = ?Type;
|
|
44
44
|
|
|
45
|
-
export type EventEmitter<T> = (
|
|
45
|
+
export type EventEmitter<T> = (
|
|
46
|
+
handler: (T) => void | Promise<void>,
|
|
47
|
+
) => EventSubscription;
|
|
@@ -379,6 +379,7 @@ function showCompileError() {
|
|
|
379
379
|
|
|
380
380
|
/* $FlowFixMe[class-object-subtyping] added when improving typing for this
|
|
381
381
|
* parameters */
|
|
382
|
+
// $FlowFixMe[incompatible-type]
|
|
382
383
|
const error: ExtendedError = new Error(message);
|
|
383
384
|
// Symbolicating compile errors is wasted effort
|
|
384
385
|
// because the stack trace is meaningless:
|
|
@@ -32,7 +32,7 @@ type IOSPlatform = {
|
|
|
32
32
|
major: number,
|
|
33
33
|
minor: number,
|
|
34
34
|
patch: number,
|
|
35
|
-
prerelease: ?
|
|
35
|
+
prerelease: ?string,
|
|
36
36
|
|},
|
|
37
37
|
systemName: string,
|
|
38
38
|
isMacCatalyst?: boolean,
|
|
@@ -65,7 +65,7 @@ type AndroidPlatform = {
|
|
|
65
65
|
major: number,
|
|
66
66
|
minor: number,
|
|
67
67
|
patch: number,
|
|
68
|
-
prerelease: ?
|
|
68
|
+
prerelease: ?string,
|
|
69
69
|
|},
|
|
70
70
|
Version: number,
|
|
71
71
|
Release: string,
|
|
@@ -34,7 +34,7 @@ type IOSPlatform = {
|
|
|
34
34
|
major: number,
|
|
35
35
|
minor: number,
|
|
36
36
|
patch: number,
|
|
37
|
-
prerelease: ?string
|
|
37
|
+
prerelease: ?string,
|
|
38
38
|
|},
|
|
39
39
|
isMacCatalyst?: boolean,
|
|
40
40
|
|},
|
|
@@ -66,7 +66,7 @@ type AndroidPlatform = {
|
|
|
66
66
|
major: number,
|
|
67
67
|
minor: number,
|
|
68
68
|
patch: number,
|
|
69
|
-
prerelease: ?
|
|
69
|
+
prerelease: ?string,
|
|
70
70
|
|},
|
|
71
71
|
Version: number,
|
|
72
72
|
Release: string,
|
|
@@ -105,7 +105,7 @@ type Win32Platform = {
|
|
|
105
105
|
major: number,
|
|
106
106
|
minor: number,
|
|
107
107
|
patch: number,
|
|
108
|
-
prerelease: ?string
|
|
108
|
+
prerelease: ?string,
|
|
109
109
|
|},
|
|
110
110
|
systemName: string,
|
|
111
111
|
isMacCatalyst?: boolean,
|
|
@@ -113,6 +113,7 @@ export default class EventEmitter<TEventToArgsMap: {...}>
|
|
|
113
113
|
// Copy `registrations` to take a snapshot when we invoke `emit`, in case
|
|
114
114
|
// registrations are added or removed when listeners are invoked.
|
|
115
115
|
for (const registration of Array.from(registrations)) {
|
|
116
|
+
// $FlowFixMe[incompatible-call]
|
|
116
117
|
registration.listener.apply(registration.context, args);
|
|
117
118
|
}
|
|
118
119
|
}
|
package/index.js
CHANGED
package/index.win32.js
CHANGED
package/jest/mockComponent.js
CHANGED
|
@@ -16,7 +16,10 @@ module.exports = (moduleName, instanceMethods, isESModule) => {
|
|
|
16
16
|
const React = require('react');
|
|
17
17
|
|
|
18
18
|
const SuperClass =
|
|
19
|
-
typeof RealComponent === 'function'
|
|
19
|
+
typeof RealComponent === 'function' &&
|
|
20
|
+
RealComponent.prototype.constructor instanceof React.Component
|
|
21
|
+
? RealComponent
|
|
22
|
+
: React.Component;
|
|
20
23
|
|
|
21
24
|
const name =
|
|
22
25
|
RealComponent.displayName ||
|
package/jest/setup.js
CHANGED
|
@@ -287,7 +287,14 @@ jest
|
|
|
287
287
|
},
|
|
288
288
|
PlatformConstants: {
|
|
289
289
|
getConstants() {
|
|
290
|
-
return {
|
|
290
|
+
return {
|
|
291
|
+
reactNativeVersion: {
|
|
292
|
+
major: 1000,
|
|
293
|
+
minor: 0,
|
|
294
|
+
patch: 0,
|
|
295
|
+
prerelease: undefined,
|
|
296
|
+
},
|
|
297
|
+
};
|
|
291
298
|
},
|
|
292
299
|
},
|
|
293
300
|
PushNotificationManager: {
|
package/overrides.json
CHANGED
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
"**/__snapshots__/**",
|
|
8
8
|
"src-win/rntypes/**"
|
|
9
9
|
],
|
|
10
|
-
"baseVersion": "0.
|
|
10
|
+
"baseVersion": "0.76.0-nightly-20240719-6d56cea28",
|
|
11
11
|
"overrides": [
|
|
12
12
|
{
|
|
13
13
|
"type": "derived",
|
|
14
14
|
"file": ".flowconfig",
|
|
15
15
|
"baseFile": ".flowconfig",
|
|
16
|
-
"baseHash": "
|
|
16
|
+
"baseHash": "83d25eb077cc8d865039ec211f3fedeac9e57d39"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
"type": "derived",
|
|
20
20
|
"file": "src-win/index.win32.js",
|
|
21
21
|
"baseFile": "packages/react-native/index.js",
|
|
22
|
-
"baseHash": "
|
|
22
|
+
"baseHash": "2690130ef7a40e3fb37fc465979e69b1036cdae8"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"type": "platform",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"type": "patch",
|
|
30
30
|
"file": "src-win/Libraries/Alert/Alert.win32.js",
|
|
31
31
|
"baseFile": "packages/react-native/Libraries/Alert/Alert.js",
|
|
32
|
-
"baseHash": "
|
|
32
|
+
"baseHash": "173b99e6ae120f14176cf3425877728787d3feed"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"type": "derived",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"type": "derived",
|
|
117
117
|
"file": "src-win/Libraries/Components/TextInput/TextInput.win32.js",
|
|
118
118
|
"baseFile": "packages/react-native/Libraries/Components/TextInput/TextInput.js",
|
|
119
|
-
"baseHash": "
|
|
119
|
+
"baseHash": "2cc1ee09c4a71e79656db18576b4983cfca153ed"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"type": "patch",
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
"type": "patch",
|
|
318
318
|
"file": "src-win/Libraries/LogBox/UI/LogBoxInspectorHeader.win32.js",
|
|
319
319
|
"baseFile": "packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js",
|
|
320
|
-
"baseHash": "
|
|
320
|
+
"baseHash": "46b6ee5d65a0c820dd0a2415bd8f43e5e8807bae",
|
|
321
321
|
"issue": 7952
|
|
322
322
|
},
|
|
323
323
|
{
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
"type": "derived",
|
|
345
345
|
"file": "src-win/Libraries/NativeComponent/BaseViewConfig.win32.js",
|
|
346
346
|
"baseFile": "packages/react-native/Libraries/NativeComponent/BaseViewConfig.ios.js",
|
|
347
|
-
"baseHash": "
|
|
347
|
+
"baseHash": "86178b8f2e04b5df9e4c8dc8ca412c22231e6673"
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
"type": "copy",
|
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
"type": "derived",
|
|
440
440
|
"file": "src-win/Libraries/Text/Text.win32.js",
|
|
441
441
|
"baseFile": "packages/react-native/Libraries/Text/Text.js",
|
|
442
|
-
"baseHash": "
|
|
442
|
+
"baseHash": "fa9abb0db816a992824228c520fc0381bf2a1f63"
|
|
443
443
|
},
|
|
444
444
|
{
|
|
445
445
|
"type": "derived",
|
|
@@ -498,13 +498,13 @@
|
|
|
498
498
|
"type": "derived",
|
|
499
499
|
"file": "src-win/Libraries/Utilities/Platform.flow.win32.js",
|
|
500
500
|
"baseFile": "packages/react-native/Libraries/Utilities/Platform.flow.js",
|
|
501
|
-
"baseHash": "
|
|
501
|
+
"baseHash": "f38efa527b9426ae0178bb2336be2e93af0392ba"
|
|
502
502
|
},
|
|
503
503
|
{
|
|
504
504
|
"type": "derived",
|
|
505
505
|
"file": "src-win/Libraries/Utilities/Platform.win32.js",
|
|
506
506
|
"baseFile": "packages/react-native/Libraries/Utilities/Platform.android.js",
|
|
507
|
-
"baseHash": "
|
|
507
|
+
"baseHash": "33f07d6fddb5290d05c8d4cc490312e3af88c70b"
|
|
508
508
|
},
|
|
509
509
|
{
|
|
510
510
|
"type": "copy",
|
|
@@ -528,7 +528,7 @@
|
|
|
528
528
|
"type": "derived",
|
|
529
529
|
"file": "src-win/src/private/specs/modules/NativePlatformConstantsWin.js",
|
|
530
530
|
"baseFile": "packages/react-native/src/private/specs/modules/NativePlatformConstantsAndroid.js",
|
|
531
|
-
"baseHash": "
|
|
531
|
+
"baseHash": "fa0f34a2de33b641bd63863629087644796d8b59"
|
|
532
532
|
}
|
|
533
533
|
]
|
|
534
534
|
}
|
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.259",
|
|
4
4
|
"description": "Implementation of react native on top of Office's Win32 platform.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,31 +12,31 @@
|
|
|
12
12
|
"types": "types",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "rnw-scripts build",
|
|
15
|
-
"bundle": "rnw-scripts prepareBundle && react-native bundle --platform win32 --entry-file ../react-native-win32-tester/js/RNTesterApp.win32.js --bundle-output dist/win32/dev/js/RNTesterApp.bundle --assets-dest dist/win32/dev --sourcemap-output ./dist/win32/dev/js/RNTesterApp.bundle.map",
|
|
15
|
+
"bundle": "rnw-scripts prepareBundle && npx @react-native-community/cli bundle --platform win32 --entry-file ../react-native-win32-tester/js/RNTesterApp.win32.js --bundle-output dist/win32/dev/js/RNTesterApp.bundle --assets-dest dist/win32/dev --sourcemap-output ./dist/win32/dev/js/RNTesterApp.bundle.map",
|
|
16
16
|
"clean": "rnw-scripts clean",
|
|
17
17
|
"flow-check": "rnw-scripts flow-check",
|
|
18
18
|
"lint:fix": "rnw-scripts lint:fix",
|
|
19
19
|
"lint": "rnw-scripts lint",
|
|
20
20
|
"run-win32-devmain": "npx @office-iss/rex-win32@0.71.15-devmain.16607.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDevMain --useDirectDebugger --useFastRefresh",
|
|
21
21
|
"run-win32": "npx @office-iss/rex-win32@0.71.15-devmain.16607.10000 --bundle js/RNTesterApp --component RNTesterApp --basePath ./dist/win32/dev --jsEngine v8 --useDirectDebugger --useFastRefresh",
|
|
22
|
-
"start": "react-native start --projectRoot ../react-native-win32-tester",
|
|
22
|
+
"start": "npx @react-native-community/cli start --projectRoot ../react-native-win32-tester",
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"validate-overrides": "react-native-platform-override validate"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.0.0",
|
|
28
28
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
29
|
-
"@react-native-community/cli": "14.0.0-alpha.
|
|
30
|
-
"@react-native-community/cli-platform-android": "14.0.0-alpha.
|
|
31
|
-
"@react-native-community/cli-platform-ios": "14.0.0-alpha.
|
|
29
|
+
"@react-native-community/cli": "14.0.0-alpha.11",
|
|
30
|
+
"@react-native-community/cli-platform-android": "14.0.0-alpha.11",
|
|
31
|
+
"@react-native-community/cli-platform-ios": "14.0.0-alpha.11",
|
|
32
32
|
"@react-native/assets": "1.0.0",
|
|
33
|
-
"@react-native/assets-registry": "0.
|
|
34
|
-
"@react-native/codegen": "0.
|
|
35
|
-
"@react-native/community-cli-plugin": "0.
|
|
36
|
-
"@react-native/gradle-plugin": "0.
|
|
37
|
-
"@react-native/js-polyfills": "0.
|
|
38
|
-
"@react-native/normalize-colors": "0.
|
|
39
|
-
"@react-native/virtualized-lists": "0.
|
|
33
|
+
"@react-native/assets-registry": "0.76.0-nightly-20240719-6d56cea28",
|
|
34
|
+
"@react-native/codegen": "0.76.0-nightly-20240719-6d56cea28",
|
|
35
|
+
"@react-native/community-cli-plugin": "0.76.0-nightly-20240719-6d56cea28",
|
|
36
|
+
"@react-native/gradle-plugin": "0.76.0-nightly-20240719-6d56cea28",
|
|
37
|
+
"@react-native/js-polyfills": "0.76.0-nightly-20240719-6d56cea28",
|
|
38
|
+
"@react-native/normalize-colors": "0.76.0-nightly-20240719-6d56cea28",
|
|
39
|
+
"@react-native/virtualized-lists": "0.76.0-nightly-20240719-6d56cea28",
|
|
40
40
|
"abort-controller": "^3.0.0",
|
|
41
41
|
"anser": "^1.4.9",
|
|
42
42
|
"ansi-regex": "^5.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"pretty-format": "^26.5.2",
|
|
58
58
|
"promise": "^8.3.0",
|
|
59
59
|
"react-clone-referenced-element": "^1.0.1",
|
|
60
|
-
"react-devtools-core": "5.1
|
|
60
|
+
"react-devtools-core": "^5.3.1",
|
|
61
61
|
"react-refresh": "^0.14.0",
|
|
62
62
|
"react-shallow-renderer": "^16.15.0",
|
|
63
63
|
"regenerator-runtime": "^0.13.2",
|
|
@@ -65,36 +65,36 @@
|
|
|
65
65
|
"semver": "^7.1.3",
|
|
66
66
|
"stacktrace-parser": "^0.1.10",
|
|
67
67
|
"whatwg-fetch": "^3.0.0",
|
|
68
|
-
"ws": "^6.2.
|
|
68
|
+
"ws": "^6.2.3",
|
|
69
69
|
"yargs": "^17.6.2"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@babel/core": "^7.20.0",
|
|
73
73
|
"@babel/eslint-parser": "^7.20.0",
|
|
74
|
-
"@react-native/metro-config": "0.
|
|
74
|
+
"@react-native/metro-config": "0.76.0-nightly-20240701-9f6cb21ed",
|
|
75
75
|
"@rnw-scripts/babel-react-native-config": "0.0.0",
|
|
76
|
-
"@rnw-scripts/eslint-config": "1.2.
|
|
77
|
-
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.
|
|
78
|
-
"@rnw-scripts/just-task": "2.3.
|
|
76
|
+
"@rnw-scripts/eslint-config": "1.2.26",
|
|
77
|
+
"@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.30",
|
|
78
|
+
"@rnw-scripts/just-task": "2.3.43",
|
|
79
79
|
"@rnw-scripts/metro-dev-config": "0.0.0",
|
|
80
80
|
"@rnx-kit/jest-preset": "^0.1.17",
|
|
81
81
|
"@types/node": "^18.0.0",
|
|
82
82
|
"@types/prop-types": "15.7.1",
|
|
83
83
|
"@types/react": "^18.2.6",
|
|
84
84
|
"eslint": "^8.19.0",
|
|
85
|
-
"flow-bin": "^0.
|
|
85
|
+
"flow-bin": "^0.241.0",
|
|
86
86
|
"jscodeshift": "^0.14.0",
|
|
87
87
|
"just-scripts": "^1.3.3",
|
|
88
88
|
"prettier": "2.8.8",
|
|
89
89
|
"react": "19.0.0-rc-fb9a90fa48-20240614",
|
|
90
|
-
"react-native": "0.
|
|
91
|
-
"react-native-platform-override": "^1.9.
|
|
90
|
+
"react-native": "0.76.0-nightly-20240719-6d56cea28",
|
|
91
|
+
"react-native-platform-override": "^1.9.45",
|
|
92
92
|
"typescript": "5.0.4"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@types/react": "^18.2.6",
|
|
96
96
|
"react": "^19.0.0-rc-fb9a90fa48-20240614",
|
|
97
|
-
"react-native": "0.
|
|
97
|
+
"react-native": "0.76.0-nightly-20240719-6d56cea28"
|
|
98
98
|
},
|
|
99
99
|
"beachball": {
|
|
100
100
|
"defaultNpmTag": "canary",
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
14
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
15
|
+
import type {TScrollViewNativeImperativeHandle} from './useSyncOnScroll';
|
|
16
|
+
|
|
17
|
+
import AndroidHorizontalScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent';
|
|
18
|
+
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
|
|
19
|
+
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
|
|
20
|
+
import Platform from '../../../../Libraries/Utilities/Platform';
|
|
21
|
+
import AndroidHorizontalScrollContentViewNativeComponent from '../../specs/components/AndroidHorizontalScrollContentViewNativeComponent';
|
|
22
|
+
import useSyncOnScroll from './useSyncOnScroll';
|
|
23
|
+
import * as React from 'react';
|
|
24
|
+
|
|
25
|
+
const HScrollViewNativeComponentForPlatform =
|
|
26
|
+
Platform.OS === 'android'
|
|
27
|
+
? AndroidHorizontalScrollViewNativeComponent
|
|
28
|
+
: ScrollViewNativeComponent;
|
|
29
|
+
|
|
30
|
+
export const HScrollViewNativeComponent: React.AbstractComponent<
|
|
31
|
+
ScrollViewNativeProps,
|
|
32
|
+
TScrollViewNativeImperativeHandle,
|
|
33
|
+
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
|
|
34
|
+
> = function HScrollViewNativeComponent(props: {
|
|
35
|
+
...ScrollViewNativeProps,
|
|
36
|
+
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
37
|
+
...
|
|
38
|
+
}): React.Node {
|
|
39
|
+
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
|
|
40
|
+
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
|
|
41
|
+
// changed. Notably, `props.children` will be the same, allowing React to
|
|
42
|
+
// bail out during reconciliation.
|
|
43
|
+
return (
|
|
44
|
+
<HScrollViewNativeComponentForPlatform
|
|
45
|
+
{...props}
|
|
46
|
+
ref={ref}
|
|
47
|
+
enableSyncOnScroll={enableSyncOnScroll}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const HScrollContentViewNativeComponent: HostComponent<ViewProps> =
|
|
53
|
+
Platform.OS === 'android'
|
|
54
|
+
? AndroidHorizontalScrollContentViewNativeComponent
|
|
55
|
+
: ScrollContentViewNativeComponent;
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
14
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
15
|
+
import type {TScrollViewNativeImperativeHandle} from './useSyncOnScroll';
|
|
16
|
+
|
|
17
|
+
import ScrollContentViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollContentViewNativeComponent';
|
|
18
|
+
import ScrollViewNativeComponent from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponent';
|
|
19
|
+
import View from '../../../../Libraries/Components/View/View';
|
|
20
|
+
import Platform from '../../../../Libraries/Utilities/Platform';
|
|
21
|
+
import useSyncOnScroll from './useSyncOnScroll';
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
|
|
24
|
+
export const VScrollViewNativeComponent: React.AbstractComponent<
|
|
25
|
+
ScrollViewNativeProps,
|
|
26
|
+
TScrollViewNativeImperativeHandle,
|
|
27
|
+
// $FlowExpectedError[incompatible-type] - Flow cannot model imperative handles, yet.
|
|
28
|
+
> = function VScrollViewNativeComponent(props: {
|
|
29
|
+
...ScrollViewNativeProps,
|
|
30
|
+
ref?: React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
31
|
+
...
|
|
32
|
+
}): React.Node {
|
|
33
|
+
const [ref, enableSyncOnScroll] = useSyncOnScroll(props.ref);
|
|
34
|
+
// NOTE: When `useSyncOnScroll` triggers an update, `props` will not have
|
|
35
|
+
// changed. Notably, `props.children` will be the same, allowing React to
|
|
36
|
+
// bail out during reconciliation.
|
|
37
|
+
return (
|
|
38
|
+
<ScrollViewNativeComponent
|
|
39
|
+
{...props}
|
|
40
|
+
ref={ref}
|
|
41
|
+
enableSyncOnScroll={enableSyncOnScroll}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const VScrollContentViewNativeComponent: HostComponent<ViewProps> =
|
|
47
|
+
Platform.OS === 'android' ? View : ScrollContentViewNativeComponent;
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
* @oncall react_native
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type {ScrollViewNativeProps} from '../../../../Libraries/Components/ScrollView/ScrollViewNativeComponentType';
|
|
13
|
+
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
14
|
+
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import {useImperativeHandle, useRef, useState} from 'react';
|
|
17
|
+
|
|
18
|
+
export type TScrollViewNativeComponentInstance = React.ElementRef<
|
|
19
|
+
HostComponent<ScrollViewNativeProps>,
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export type TScrollViewNativeImperativeHandle = {
|
|
23
|
+
componentRef: React.RefObject<TScrollViewNativeComponentInstance | null>,
|
|
24
|
+
unstable_setEnableSyncOnScroll: (enabled: true) => void,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Hook used by `HScrollViewNativeComponent` and `VScrollViewNativeComponent`
|
|
29
|
+
* to make an implementation of `unstable_setEnableSyncOnScroll` available that
|
|
30
|
+
* does not require updating all `ScrollView` children.
|
|
31
|
+
*/
|
|
32
|
+
export default function useSyncOnScroll(
|
|
33
|
+
inputRef: ?React.RefSetter<TScrollViewNativeImperativeHandle | null>,
|
|
34
|
+
): [React.RefSetter<TScrollViewNativeComponentInstance | null>, true | void] {
|
|
35
|
+
const componentRef = useRef<TScrollViewNativeComponentInstance | null>(null);
|
|
36
|
+
const [enableSyncOnScroll, setEnableSyncOnScroll] = useState<true | void>();
|
|
37
|
+
|
|
38
|
+
useImperativeHandle<TScrollViewNativeImperativeHandle>(inputRef, () => {
|
|
39
|
+
return {
|
|
40
|
+
componentRef,
|
|
41
|
+
unstable_setEnableSyncOnScroll(enabled: true): void {
|
|
42
|
+
setEnableSyncOnScroll(enabled);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
return [componentRef, enableSyncOnScroll];
|
|
48
|
+
}
|