react-native-tvos 0.85.0-0rc5 → 0.85.3-0
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/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.d.ts +7 -0
- package/Libraries/Components/ScrollView/ScrollView.js +6 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +1 -0
- package/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js +5 -1
- package/Libraries/Components/TextInput/TextInput.flow.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Utilities/HMRClient.js +28 -1
- package/README.md +52 -0
- package/React/Base/RCTVersion.m +2 -2
- package/React/CoreModules/RCTDevLoadingView.mm +17 -0
- package/React/CoreModules/RCTJscSafeUrl+Internal.h +23 -0
- package/React/CoreModules/RCTJscSafeUrl.mm +38 -0
- package/React/CoreModules/RCTRedBox+Internal.h +42 -0
- package/React/CoreModules/RCTRedBox.mm +30 -471
- package/React/CoreModules/RCTRedBox2AnsiParser+Internal.h +22 -0
- package/React/CoreModules/RCTRedBox2AnsiParser.mm +55 -0
- package/React/CoreModules/RCTRedBox2Controller+Internal.h +34 -0
- package/React/CoreModules/RCTRedBox2Controller.mm +764 -0
- package/React/CoreModules/RCTRedBox2ErrorParser+Internal.h +46 -0
- package/React/CoreModules/RCTRedBox2ErrorParser.mm +57 -0
- package/React/CoreModules/RCTRedBoxController+Internal.h +31 -0
- package/React/CoreModules/RCTRedBoxController.mm +447 -0
- package/React/CoreModules/RCTRedBoxHMRClient+Internal.h +26 -0
- package/React/CoreModules/RCTRedBoxHMRClient.mm +125 -0
- package/React/CoreModules/React-CoreModules.podspec +1 -0
- package/React/DevSupport/RCTFrameTimingsObserver.h +24 -0
- package/React/DevSupport/RCTFrameTimingsObserver.mm +298 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +40 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.h +1 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.mm +78 -0
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +32 -6
- package/React/Views/ScrollView/RCTScrollViewManager.m +1 -0
- package/ReactAndroid/build.gradle.kts +2 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/hermes-engine/build.gradle.kts +17 -0
- package/ReactAndroid/publish.gradle +20 -46
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/InspectorFlags.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingSequence.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector/FrameTimingsObserver.kt +127 -26
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +31 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +51 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +12 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +56 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Experimental_Android.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +11 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/tracing/PerformanceTracer.kt +39 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/NetworkEventUtil.kt +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/network/RequestBodyUtil.kt +2 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.kt +50 -10
- package/ReactAndroid/src/main/java/com/facebook/react/views/common/UiModeUtils.kt +20 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.java +57 -8
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +48 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java +28 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.kt +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputSubmitEditingEvent.kt +6 -1
- package/ReactAndroid/src/main/jni/CMakeLists.txt +7 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.cpp +22 -0
- package/ReactAndroid/src/main/jni/react/devsupport/JInspectorFlags.h +2 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +71 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +16 -1
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.cpp +14 -0
- package/ReactAndroid/src/main/jni/react/runtime/jni/JReactHostInspectorTarget.h +18 -4
- package/ReactCommon/React-Fabric.podspec +7 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +3 -3
- package/ReactCommon/jsinspector-modern/HostAgent.cpp +36 -0
- package/ReactCommon/jsinspector-modern/HostTarget.cpp +7 -1
- package/ReactCommon/jsinspector-modern/HostTarget.h +25 -0
- package/ReactCommon/jsinspector-modern/HostTargetTracing.cpp +1 -1
- package/ReactCommon/jsinspector-modern/HostTargetTracing.h +4 -4
- package/ReactCommon/jsinspector-modern/InspectorFlags.cpp +12 -0
- package/ReactCommon/jsinspector-modern/InspectorFlags.h +12 -0
- package/ReactCommon/jsinspector-modern/NetworkIOAgent.cpp +1 -1
- package/ReactCommon/jsinspector-modern/RuntimeAgent.cpp +19 -0
- package/ReactCommon/jsinspector-modern/RuntimeAgent.h +7 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.cpp +33 -0
- package/ReactCommon/jsinspector-modern/RuntimeTarget.h +6 -0
- package/ReactCommon/jsinspector-modern/tests/HostTargetTest.cpp +12 -0
- package/ReactCommon/jsinspector-modern/tests/InspectorMocks.h +3 -2
- package/ReactCommon/jsinspector-modern/tests/JsiIntegrationTest.cpp +1 -0
- package/ReactCommon/jsinspector-modern/tests/NetworkReporterTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/TracingTest.cpp +1 -1
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.cpp +10 -0
- package/ReactCommon/jsinspector-modern/tests/utils/InspectorFlagOverridesGuard.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/CMakeLists.txt +1 -0
- package/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h +7 -3
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.cpp +52 -29
- package/ReactCommon/jsinspector-modern/tracing/HostTracingProfileSerializer.h +6 -6
- package/ReactCommon/jsinspector-modern/tracing/PerformanceTracerSection.h +113 -0
- package/ReactCommon/jsinspector-modern/tracing/React-jsinspectortracing.podspec +1 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.cpp +12 -5
- package/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h +3 -1
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.cpp +42 -0
- package/ReactCommon/jsinspector-modern/tracing/TraceEventSerializer.h +7 -0
- package/ReactCommon/react/debug/CMakeLists.txt +2 -1
- package/ReactCommon/react/debug/React-debug.podspec +7 -1
- package/ReactCommon/react/debug/redbox/AnsiParser.cpp +139 -0
- package/ReactCommon/react/debug/redbox/AnsiParser.h +35 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.cpp +179 -0
- package/ReactCommon/react/debug/redbox/JscSafeUrl.h +27 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.cpp +171 -0
- package/ReactCommon/react/debug/redbox/RedBoxErrorParser.h +40 -0
- package/ReactCommon/react/debug/redbox/tests/AnsiParserTest.cpp +97 -0
- package/ReactCommon/react/debug/redbox/tests/JscSafeUrlTest.cpp +173 -0
- package/ReactCommon/react/debug/redbox/tests/RedBoxErrorParserTest.cpp +107 -0
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +21 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +26 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +135 -45
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +12 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +22 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +46 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsOverridesOSSExperimental.h +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +6 -1
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +3 -1
- package/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +1 -0
- package/ReactCommon/react/nativemodule/defaults/DefaultTurboModules.cpp +7 -0
- package/ReactCommon/react/nativemodule/defaults/React-defaultsnativemodule.podspec +1 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +26 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.h +4 -0
- package/ReactCommon/react/nativemodule/mutationobserver/React-mutationobservernativemodule.podspec +66 -0
- package/ReactCommon/react/performance/timeline/PerformanceObserver.cpp +18 -6
- package/ReactCommon/react/performance/timeline/PerformanceObserver.h +2 -0
- package/ReactCommon/react/renderer/animated/NativeAnimatedNodesManager.cpp +4 -1
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp +58 -25
- package/ReactCommon/react/renderer/animationbackend/AnimationBackend.h +9 -0
- package/ReactCommon/react/renderer/animationbackend/AnimationChoreographer.h +5 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.cpp +10 -0
- package/ReactCommon/react/renderer/components/scrollview/BaseScrollViewProps.h +1 -0
- package/ReactCommon/react/renderer/uimanager/UIManagerAnimationBackend.h +1 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +115 -0
- package/ReactCommon/{jsinspector-modern → react/utils}/Base64.h +2 -2
- package/package.json +11 -11
- package/scripts/cocoapods/utils.rb +1 -0
- package/scripts/codegen/generate-artifacts-executor/generateAppDependencyProvider.js +4 -4
- package/scripts/codegen/generate-artifacts-executor/generateCustomURLHandlers.js +3 -3
- package/scripts/codegen/generate-artifacts-executor/generateNativeCode.js +2 -3
- package/scripts/codegen/generate-artifacts-executor/generatePackageSwift.js +2 -2
- package/scripts/codegen/generate-artifacts-executor/generateRCTModuleProviders.js +3 -2
- package/scripts/codegen/generate-artifacts-executor/generateRCTThirdPartyComponents.js +3 -2
- package/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js +2 -2
- package/scripts/codegen/generate-artifacts-executor/generateUnstableModulesRequiringMainQueueSetupProvider.js +3 -3
- package/scripts/codegen/generate-artifacts-executor/utils.js +48 -0
- package/scripts/react_native_pods.rb +1 -0
- package/scripts/replace-rncore-version.js +72 -15
- package/src/private/featureflags/ReactNativeFeatureFlags.js +27 -2
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +6 -1
- package/src/private/setup/setUpDefaultReactNativeEnvironment.js +6 -0
- package/types/public/ReactNativeTVTypes.d.ts +8 -0
|
@@ -754,6 +754,13 @@ export interface ScrollViewProps
|
|
|
754
754
|
*/
|
|
755
755
|
removeClippedSubviews?: boolean | undefined;
|
|
756
756
|
|
|
757
|
+
/**
|
|
758
|
+
* (TV only)
|
|
759
|
+
* When false, the scroll view will jump to the correct offset without animation
|
|
760
|
+
* when focus changes. Defaults to true.
|
|
761
|
+
*/
|
|
762
|
+
scrollAnimationEnabled?: boolean | undefined;
|
|
763
|
+
|
|
757
764
|
/**
|
|
758
765
|
* When true, shows a horizontal scroll indicator.
|
|
759
766
|
*/
|
|
@@ -670,6 +670,12 @@ type ScrollViewBaseProps = Readonly<{
|
|
|
670
670
|
* true.
|
|
671
671
|
*/
|
|
672
672
|
removeClippedSubviews?: ?boolean,
|
|
673
|
+
/**
|
|
674
|
+
* (TV only)
|
|
675
|
+
* When false, the scroll view will jump to the correct offset without animation
|
|
676
|
+
* when focus changes. Defaults to true.
|
|
677
|
+
*/
|
|
678
|
+
scrollAnimationEnabled?: ?boolean,
|
|
673
679
|
/**
|
|
674
680
|
* A RefreshControl component, used to provide pull-to-refresh
|
|
675
681
|
* functionality for the ScrollView. Only works for vertical ScrollViews
|
|
@@ -76,6 +76,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
76
76
|
borderTopRightRadius: true,
|
|
77
77
|
borderLeftColor: colorAttribute,
|
|
78
78
|
snapToItemPadding: true,
|
|
79
|
+
scrollAnimationEnabled: true,
|
|
79
80
|
pointerEvents: true,
|
|
80
81
|
isInvertedVirtualizedList: true,
|
|
81
82
|
scrollsChildToFocus: true,
|
|
@@ -142,6 +143,7 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
142
143
|
scrollsToTop: true,
|
|
143
144
|
showsHorizontalScrollIndicator: true,
|
|
144
145
|
showsVerticalScrollIndicator: true,
|
|
146
|
+
scrollAnimationEnabled: true,
|
|
145
147
|
showsScrollIndex: true,
|
|
146
148
|
snapToItemPadding: true,
|
|
147
149
|
snapToAlignment: true,
|
|
@@ -73,6 +73,7 @@ export type ScrollViewNativeProps = Readonly<{
|
|
|
73
73
|
snapToItemPadding?: ?number,
|
|
74
74
|
sendMomentumEvents?: ?boolean,
|
|
75
75
|
showsHorizontalScrollIndicator?: ?boolean,
|
|
76
|
+
scrollAnimationEnabled?: ?boolean,
|
|
76
77
|
showsScrollIndex?: ?boolean,
|
|
77
78
|
showsVerticalScrollIndicator?: ?boolean,
|
|
78
79
|
snapToAlignment?: ?('start' | 'center' | 'end' | 'item'),
|
|
@@ -402,7 +402,11 @@ export type AndroidTextInputNativeProps = Readonly<{
|
|
|
402
402
|
* Invalid if `multiline={true}` is specified.
|
|
403
403
|
*/
|
|
404
404
|
onSubmitEditing?: ?BubblingEventHandler<
|
|
405
|
-
Readonly<{
|
|
405
|
+
Readonly<{
|
|
406
|
+
target: Int32,
|
|
407
|
+
text: string,
|
|
408
|
+
action?: 'submit' | 'next' | 'previous',
|
|
409
|
+
}>,
|
|
406
410
|
>,
|
|
407
411
|
|
|
408
412
|
/**
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
export default class ReactNativeVersion {
|
|
29
29
|
static major: number = 0;
|
|
30
30
|
static minor: number = 85;
|
|
31
|
-
static patch: number =
|
|
32
|
-
static prerelease: string | null = '
|
|
31
|
+
static patch: number = 3;
|
|
32
|
+
static prerelease: string | null = '0';
|
|
33
33
|
|
|
34
34
|
static getVersionString(): string {
|
|
35
35
|
return `${this.major}.${this.minor}.${this.patch}${this.prerelease != null ? `-${this.prerelease}` : ''}`;
|
|
@@ -212,6 +212,7 @@ Error: ${e.message}`;
|
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
let pendingUpdatesCount = 0;
|
|
215
|
+
let lastMarkerChangeId: string | null = null;
|
|
215
216
|
client.on('update-start', ({isInitialUpdate}) => {
|
|
216
217
|
pendingUpdatesCount++;
|
|
217
218
|
currentCompileErrorMessage = null;
|
|
@@ -229,10 +230,15 @@ Error: ${e.message}`;
|
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
|
|
232
|
-
client.on('update-done',
|
|
233
|
+
client.on('update-done', body => {
|
|
233
234
|
pendingUpdatesCount--;
|
|
234
235
|
if (pendingUpdatesCount === 0) {
|
|
235
236
|
DevLoadingView.hide();
|
|
237
|
+
const changeId = body?.changeId;
|
|
238
|
+
if (changeId != null && changeId !== lastMarkerChangeId) {
|
|
239
|
+
lastMarkerChangeId = changeId;
|
|
240
|
+
emitFastRefreshCompleteEvents();
|
|
241
|
+
}
|
|
236
242
|
}
|
|
237
243
|
});
|
|
238
244
|
|
|
@@ -379,4 +385,25 @@ function showCompileError() {
|
|
|
379
385
|
throw error;
|
|
380
386
|
}
|
|
381
387
|
|
|
388
|
+
function emitFastRefreshCompleteEvents() {
|
|
389
|
+
// Add marker entry in performance timeline
|
|
390
|
+
performance.mark('Fast Refresh - Update done', {
|
|
391
|
+
detail: {
|
|
392
|
+
devtools: {
|
|
393
|
+
dataType: 'marker',
|
|
394
|
+
color: 'primary',
|
|
395
|
+
tooltipText: 'Fast Refresh \u269b',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// Notify CDP clients via internal binding
|
|
401
|
+
if (
|
|
402
|
+
// $FlowFixMe[prop-missing] - Injected by RuntimeTarget
|
|
403
|
+
typeof globalThis.__notifyFastRefreshComplete === 'function'
|
|
404
|
+
) {
|
|
405
|
+
globalThis.__notifyFastRefreshComplete();
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
382
409
|
export default HMRClient;
|
package/README.md
CHANGED
|
@@ -262,6 +262,58 @@ class Game2048 extends React.Component {
|
|
|
262
262
|
|
|
263
263
|
- _TVTextScrollView_: On Apple TV, a ScrollView will not scroll unless there are focusable items inside it or above/below it. This component works on both Apple TV and Android TV, using native code to allow scrolling using swipe gestures from the remote control.
|
|
264
264
|
|
|
265
|
+
- _ScrollView snap alignment_: The existing `snapToAlignment` prop has been extended with a new `'item'` value that enables per-item snap alignment on TV. Instead of snapping all items uniformly to `'start'`, `'center'`, or `'end'`, each child can specify its own alignment via the `scrollSnapAlign` View prop. Optional padding can be applied with `snapToItemPadding` on the ScrollView.
|
|
266
|
+
|
|
267
|
+
| Prop (ScrollView) | Value | Description |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| snapToAlignment | `'item'` | Enables per-item snap alignment (TV only). Requires `snapToInterval` to be set. |
|
|
270
|
+
| snapToItemPadding | number? | Extra padding (in dp/pt) applied around items when snapping. Only used with `snapToAlignment="item"`. |
|
|
271
|
+
|
|
272
|
+
| Prop (View) | Value | Description |
|
|
273
|
+
|---|---|---|
|
|
274
|
+
| scrollSnapAlign | `'start'` \| `'center'` \| `'end'` | Controls where this item snaps inside its parent ScrollView. Only used when the parent has `snapToAlignment="item"`. |
|
|
275
|
+
|
|
276
|
+
```jsx
|
|
277
|
+
<ScrollView
|
|
278
|
+
horizontal
|
|
279
|
+
snapToInterval={300}
|
|
280
|
+
snapToAlignment="item"
|
|
281
|
+
snapToItemPadding={20}>
|
|
282
|
+
<Pressable scrollSnapAlign="start" style={{width: 300}}>
|
|
283
|
+
<Text>Snaps to start</Text>
|
|
284
|
+
</Pressable>
|
|
285
|
+
<Pressable scrollSnapAlign="center" style={{width: 200}}>
|
|
286
|
+
<Text>Snaps to center</Text>
|
|
287
|
+
</Pressable>
|
|
288
|
+
<Pressable scrollSnapAlign="end" style={{width: 300}}>
|
|
289
|
+
<Text>Snaps to end</Text>
|
|
290
|
+
</Pressable>
|
|
291
|
+
</ScrollView>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
- _ScrollView animation control_: The `scrollAnimationEnabled` prop allows disabling scroll animations when focus changes on TV. When set to `false`, the scroll view jumps instantly to the focused item instead of animating. This only affects TV platforms and has no effect on mobile.
|
|
295
|
+
|
|
296
|
+
| Prop (ScrollView) | Value | Description |
|
|
297
|
+
|---|---|---|
|
|
298
|
+
| scrollAnimationEnabled | boolean? | When `false`, disables animated scrolling on focus change. Defaults to `true`. TV only. |
|
|
299
|
+
|
|
300
|
+
```jsx
|
|
301
|
+
<ScrollView horizontal scrollAnimationEnabled={false}>
|
|
302
|
+
<Pressable style={{width: 300}}><Text>Item 1</Text></Pressable>
|
|
303
|
+
<Pressable style={{width: 300}}><Text>Item 2</Text></Pressable>
|
|
304
|
+
<Pressable style={{width: 300}}><Text>Item 3</Text></Pressable>
|
|
305
|
+
</ScrollView>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
- _Interaction with existing ScrollView props_: The TV scroll props build on top of existing React Native ScrollView behavior. Here is how they interact:
|
|
309
|
+
|
|
310
|
+
- `snapToAlignment="item"` does not require `snapToInterval` to be set. It works as a standalone snapping mode where each child's `scrollSnapAlign` determines the snap position. If `snapToInterval` is also set, the interval is applied as an additional constraint after the item offset is computed.
|
|
311
|
+
- `snapToAlignment="item"` should not be combined with `pagingEnabled`. Both attempt to control scroll positioning independently, which leads to unpredictable behavior. Use one or the other.
|
|
312
|
+
- `snapToStart` and `snapToEnd` work independently of `snapToAlignment="item"`. They control edge behavior during swipe/drag momentum (whether the scroll view snaps to the first or last position), but do not affect focus driven item snapping.
|
|
313
|
+
- `scrollAnimationEnabled={false}` disables all scroll animations, including programmatic `scrollTo({animated: true})` calls. When disabled, all scrolling is instant.
|
|
314
|
+
- `decelerationRate` has no effect when `scrollAnimationEnabled={false}`, since there is no animation to decelerate.
|
|
315
|
+
- `scrollAnimationEnabled` and `snapToAlignment="item"` work well together. Snapping still occurs, but instantly instead of animated.
|
|
316
|
+
|
|
265
317
|
- _VirtualizedList_: We extend `VirtualizedList` to make virtualization work well with focus management in mind. All of the improvements that we made are automatically available to all the VirtualizedList based components such as `FlatList`.
|
|
266
318
|
- Defaults: VirtualizeList contents are automatically wrapped with a `TVFocusGuideView` with `trapFocus*` properties enabled depending on the orientation of the list. This default makes sure that focus doesn't leave the list accidentally due to a virtualization issue etc. until reaching the beginning or the end of the list.
|
|
267
319
|
- New Props:
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(85),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(3),
|
|
27
|
+
RCTVersionPrerelease: @"0",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -51,10 +51,27 @@ RCT_EXPORT_MODULE()
|
|
|
51
51
|
selector:@selector(hide)
|
|
52
52
|
name:RCTJavaScriptDidFailToLoadNotification
|
|
53
53
|
object:nil];
|
|
54
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
55
|
+
selector:@selector(hide)
|
|
56
|
+
name:@"RCTInstanceDidLoadBundle"
|
|
57
|
+
object:nil];
|
|
54
58
|
}
|
|
55
59
|
return self;
|
|
56
60
|
}
|
|
57
61
|
|
|
62
|
+
- (void)dealloc
|
|
63
|
+
{
|
|
64
|
+
[self clearInitialMessageDelay];
|
|
65
|
+
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
66
|
+
UIWindow *window = _window;
|
|
67
|
+
_window = nil;
|
|
68
|
+
if (window) {
|
|
69
|
+
RCTExecuteOnMainQueue(^{
|
|
70
|
+
window.hidden = YES;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
58
75
|
+ (void)setEnabled:(BOOL)enabled
|
|
59
76
|
{
|
|
60
77
|
RCTDevLoadingViewSetEnabled(enabled);
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Converts between standard URLs and JSC-safe URLs.
|
|
12
|
+
*
|
|
13
|
+
* JSC (JavaScriptCore) strips query strings from source URLs in stack traces
|
|
14
|
+
* as of iOS 16.4. Metro works around this by encoding the query string into
|
|
15
|
+
* the URL path. These methods convert between the two formats.
|
|
16
|
+
*/
|
|
17
|
+
@interface RCTJscSafeUrl : NSObject
|
|
18
|
+
|
|
19
|
+
+ (nonnull NSString *)normalUrlFromJscSafeUrl:(nonnull NSString *)url;
|
|
20
|
+
+ (nonnull NSString *)jscSafeUrlFromNormalUrl:(nonnull NSString *)url;
|
|
21
|
+
+ (BOOL)isJscSafeUrl:(nonnull NSString *)url;
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
|
|
8
|
+
#import "RCTJscSafeUrl+Internal.h"
|
|
9
|
+
|
|
10
|
+
#import <React/RCTDefines.h>
|
|
11
|
+
#import <react/debug/redbox/JscSafeUrl.h>
|
|
12
|
+
|
|
13
|
+
#if RCT_DEV_MENU
|
|
14
|
+
|
|
15
|
+
using facebook::react::unstable_redbox::isJscSafeUrl;
|
|
16
|
+
using facebook::react::unstable_redbox::toJscSafeUrl;
|
|
17
|
+
using facebook::react::unstable_redbox::toNormalUrl;
|
|
18
|
+
|
|
19
|
+
@implementation RCTJscSafeUrl
|
|
20
|
+
|
|
21
|
+
+ (NSString *)normalUrlFromJscSafeUrl:(NSString *)url
|
|
22
|
+
{
|
|
23
|
+
return [NSString stringWithUTF8String:toNormalUrl(url.UTF8String).c_str()];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+ (NSString *)jscSafeUrlFromNormalUrl:(NSString *)url
|
|
27
|
+
{
|
|
28
|
+
return [NSString stringWithUTF8String:toJscSafeUrl(url.UTF8String).c_str()];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
+ (BOOL)isJscSafeUrl:(NSString *)url
|
|
32
|
+
{
|
|
33
|
+
return isJscSafeUrl(url.UTF8String);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
#endif
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
|
|
8
|
+
#import <React/RCTDefines.h>
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
|
|
11
|
+
#if RCT_DEV_MENU
|
|
12
|
+
|
|
13
|
+
@class RCTJSStackFrame;
|
|
14
|
+
|
|
15
|
+
@protocol RCTRedBoxControllerActionDelegate <NSObject>
|
|
16
|
+
|
|
17
|
+
- (void)redBoxController:(UIViewController *)redBoxController openStackFrameInEditor:(RCTJSStackFrame *)stackFrame;
|
|
18
|
+
- (void)reloadFromRedBoxController:(UIViewController *)redBoxController;
|
|
19
|
+
- (void)loadExtraDataViewController;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@protocol RCTRedBoxControlling <NSObject>
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, weak) id<RCTRedBoxControllerActionDelegate> actionDelegate;
|
|
26
|
+
|
|
27
|
+
- (void)showErrorMessage:(NSString *)message
|
|
28
|
+
withStack:(NSArray<RCTJSStackFrame *> *)stack
|
|
29
|
+
isUpdate:(BOOL)isUpdate
|
|
30
|
+
errorCookie:(int)errorCookie;
|
|
31
|
+
|
|
32
|
+
- (void)dismiss;
|
|
33
|
+
|
|
34
|
+
@end
|
|
35
|
+
|
|
36
|
+
@protocol RCTRedBox2Controlling <RCTRedBoxControlling>
|
|
37
|
+
|
|
38
|
+
@property (nonatomic, strong, nullable) NSURL *bundleURL;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
#endif
|