react-native-tvos 0.87.0-0 → 0.87.1-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/Animated/AnimatedEvent.js +1 -1
- package/Libraries/Animated/AnimatedImplementation.js +6 -2
- package/Libraries/Animated/nodes/AnimatedNode.js +1 -1
- package/Libraries/Animated/nodes/AnimatedValue.js +2 -2
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/ScrollView.d.ts +26 -0
- package/Libraries/Components/ScrollView/ScrollView.js +32 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponentType.js +11 -0
- package/Libraries/Components/ScrollView/processScrollAnimationEasing.js +40 -0
- package/Libraries/Components/TV/TVFocusGuideView.js +31 -0
- package/Libraries/Components/TV/useFocusEnterLeave.js +112 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/README.md +17 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +30 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt +36 -13
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.kt +13 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt +25 -3
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt +62 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.kt +13 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp +26 -0
- package/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.h +3 -0
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm +1 -1
- package/package.json +8 -8
- package/scripts/cocoapods/rndependencies.rb +31 -25
- package/scripts/replace-rncore-version.js +18 -2
- package/scripts/setup-apple-spm.js +28 -12
- package/scripts/spm/autolinking-plugins.js +80 -0
- package/scripts/spm/download-spm-artifacts.js +64 -6
- package/scripts/spm/expand-spm-dependencies.js +249 -30
- package/scripts/spm/generate-spm-autolinking.js +157 -40
- package/scripts/spm/generate-spm-package.js +30 -18
- package/scripts/spm/generate-spm-xcodeproj.js +595 -71
- package/scripts/spm/scaffold-package-swift.js +65 -24
- package/scripts/spm/spm-pbxproj.js +158 -28
- package/scripts/spm/spm-types.js +29 -3
- package/scripts/spm/spm-utils.js +117 -2
- package/sdks/.hermesv1version +1 -1
- package/sdks/hermes-engine/version.properties +1 -1
- package/types/public/ReactNativeTVTypes.d.ts +40 -1
- package/scripts/spm/__doc__/rfc-spm-xcframework.md +0 -707
- package/scripts/spm/__doc__/spm-autolinking-plugins.md +0 -244
- package/scripts/spm/__doc__/spm-header-paths-contract.md +0 -97
- package/scripts/spm/__doc__/spm-plugins-assessment.md +0 -128
- package/scripts/spm/__doc__/spm-scripts.md +0 -486
package/scripts/spm/spm-utils.js
CHANGED
|
@@ -14,6 +14,67 @@ const fs = require('fs');
|
|
|
14
14
|
const os = require('os');
|
|
15
15
|
const path = require('path');
|
|
16
16
|
|
|
17
|
+
// The package and product names React Native's own generated manifests use. A
|
|
18
|
+
// dependency whose Swift name lands on one of them surfaces as a duplicate-name
|
|
19
|
+
// error from inside SPM's resolution, far from the react-native.config.js that
|
|
20
|
+
// caused it, so the autolinker rejects the collision up front instead.
|
|
21
|
+
//
|
|
22
|
+
// These cover the emitters in this directory and the collision guard. Adding a
|
|
23
|
+
// React Native SPM product also touches, depending on what the product is:
|
|
24
|
+
// - scripts/codegen/templates/Package.swift.spm-template — if the per-app
|
|
25
|
+
// codegen package must depend on it (a static Swift file, patched by
|
|
26
|
+
// string replacement, not generated from these constants)
|
|
27
|
+
// - flavored-frameworks.js INVARIANT_BINARY_TARGETS — if it is
|
|
28
|
+
// xcframework-backed
|
|
29
|
+
// - download-spm-artifacts.js REQUIRED_ARTIFACTS — if it ships as its own
|
|
30
|
+
// downloadable artifact (that list names ARTIFACTS, which overlap with
|
|
31
|
+
// product names without being the same set)
|
|
32
|
+
const REACT_NATIVE_PACKAGE_NAME /*: string */ = 'ReactNative';
|
|
33
|
+
const REACT_CODEGEN_PACKAGE_NAME /*: string */ = 'React-GeneratedCode';
|
|
34
|
+
// The autolinking aggregator package, whose single product shares its name.
|
|
35
|
+
const AUTOLINKED_PACKAGE_NAME /*: string */ = 'Autolinked';
|
|
36
|
+
// React Native's products by KIND, so no consumer has to infer the kind from a
|
|
37
|
+
// position in a flat list. The umbrella is a Clang target over the staged
|
|
38
|
+
// headers that re-exports the pure-RN namespaces; the rest are each backed by
|
|
39
|
+
// an xcframework of the same name.
|
|
40
|
+
const REACT_NATIVE_UMBRELLA_PRODUCT /*: string */ = 'ReactHeaders';
|
|
41
|
+
const REACT_NATIVE_HEADERS_PRODUCT /*: string */ = 'ReactNativeHeaders';
|
|
42
|
+
const REACT_NATIVE_DEPENDENCIES_HEADERS_PRODUCT /*: string */ =
|
|
43
|
+
'ReactNativeDependenciesHeaders';
|
|
44
|
+
const REACT_NATIVE_XCFRAMEWORK_PRODUCTS /*: ReadonlyArray<string> */ =
|
|
45
|
+
Object.freeze([
|
|
46
|
+
REACT_NATIVE_HEADERS_PRODUCT,
|
|
47
|
+
REACT_NATIVE_DEPENDENCIES_HEADERS_PRODUCT,
|
|
48
|
+
]);
|
|
49
|
+
// Derived, so a new product cannot be added without choosing a kind above.
|
|
50
|
+
const REACT_NATIVE_PRODUCTS /*: ReadonlyArray<string> */ = Object.freeze([
|
|
51
|
+
REACT_NATIVE_UMBRELLA_PRODUCT,
|
|
52
|
+
...REACT_NATIVE_XCFRAMEWORK_PRODUCTS,
|
|
53
|
+
]);
|
|
54
|
+
// The codegen package product every autolinked target depends on for the app's
|
|
55
|
+
// generated headers.
|
|
56
|
+
const REACT_CODEGEN_PRODUCTS /*: ReadonlyArray<string> */ = Object.freeze([
|
|
57
|
+
'ReactAppHeaders',
|
|
58
|
+
]);
|
|
59
|
+
// The codegen package products the APP target links, declared by the static
|
|
60
|
+
// template rather than by any emitter here.
|
|
61
|
+
const REACT_CODEGEN_APP_PRODUCTS /*: ReadonlyArray<string> */ = Object.freeze([
|
|
62
|
+
'ReactCodegen',
|
|
63
|
+
'ReactAppDependencyProvider',
|
|
64
|
+
]);
|
|
65
|
+
const REACT_HEADERS_TARGET_DIR /*: string */ = 'ReactHeadersTarget';
|
|
66
|
+
// Target names only have to be unique within their own package, so
|
|
67
|
+
// REACT_HEADERS_TARGET_DIR is deliberately absent: a dependency named after it
|
|
68
|
+
// collides with nothing.
|
|
69
|
+
const RESERVED_SWIFT_NAMES /*: ReadonlyArray<string> */ = Object.freeze([
|
|
70
|
+
REACT_NATIVE_PACKAGE_NAME,
|
|
71
|
+
REACT_CODEGEN_PACKAGE_NAME,
|
|
72
|
+
AUTOLINKED_PACKAGE_NAME,
|
|
73
|
+
...REACT_NATIVE_PRODUCTS,
|
|
74
|
+
...REACT_CODEGEN_PRODUCTS,
|
|
75
|
+
...REACT_CODEGEN_APP_PRODUCTS,
|
|
76
|
+
]);
|
|
77
|
+
|
|
17
78
|
/**
|
|
18
79
|
* Creates a logger trio {log, warn, die} that prefixes messages with [name].
|
|
19
80
|
* log – green prefix, writes to stdout
|
|
@@ -582,10 +643,10 @@ function installSpmCodegenTemplate(
|
|
|
582
643
|
if (remote != null) {
|
|
583
644
|
content = content
|
|
584
645
|
.replace(
|
|
585
|
-
|
|
646
|
+
`.package(name: "${REACT_NATIVE_PACKAGE_NAME}", path: "../../xcframeworks"),`,
|
|
586
647
|
`.package(url: "${remote.url}", exact: "${remote.version}"),`,
|
|
587
648
|
)
|
|
588
|
-
.split(
|
|
649
|
+
.split(`package: "${REACT_NATIVE_PACKAGE_NAME}")`)
|
|
589
650
|
.join(`package: "${remote.identity}")`);
|
|
590
651
|
}
|
|
591
652
|
fs.writeFileSync(codegenPkgSwift, content, 'utf8');
|
|
@@ -624,7 +685,59 @@ function runCodegenAndInstallTemplate(
|
|
|
624
685
|
}
|
|
625
686
|
}
|
|
626
687
|
|
|
688
|
+
// ---------------------------------------------------------------------------
|
|
689
|
+
// Autolinking-plugin script phases — the shared validation rules. Two gates
|
|
690
|
+
// apply them with different POLICIES (invokePlugins throws, the injector's
|
|
691
|
+
// sidecar reader skips the entry), so only the rules live here. See
|
|
692
|
+
// __doc__/spm-autolinking-plugins.md for the reasoning.
|
|
693
|
+
// ---------------------------------------------------------------------------
|
|
694
|
+
|
|
695
|
+
// `@` and `/` are admitted so a package can use its own scoped npm name
|
|
696
|
+
// (`@expo/log-box`). `:` is not: the id is hashed into the UUID seed as
|
|
697
|
+
// `plugin:<id>`, and keeping the separator out of the id keeps that seed
|
|
698
|
+
// unambiguous.
|
|
699
|
+
const SCRIPT_PHASE_ID_PATTERN = /^[@A-Za-z0-9_./-]+$/;
|
|
700
|
+
|
|
701
|
+
// `ledger.__proto__ = uuid` sets the prototype instead of an own property, so a
|
|
702
|
+
// phase with one of these ids would look recorded, vanish through
|
|
703
|
+
// JSON.stringify, and never be removable by `deinit`.
|
|
704
|
+
const RESERVED_SCRIPT_PHASE_IDS = new Set([
|
|
705
|
+
'__proto__',
|
|
706
|
+
'constructor',
|
|
707
|
+
'prototype',
|
|
708
|
+
]);
|
|
709
|
+
|
|
710
|
+
function isValidScriptPhaseId(value /*: unknown */) /*: boolean */ {
|
|
711
|
+
return (
|
|
712
|
+
typeof value === 'string' &&
|
|
713
|
+
SCRIPT_PHASE_ID_PATTERN.test(value) &&
|
|
714
|
+
!RESERVED_SCRIPT_PHASE_IDS.has(value)
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* The name reaches the project file twice: verbatim in the escaped `name` field
|
|
720
|
+
* Xcode displays, and normalized (spm-pbxproj's commentSafe) in the cosmetic
|
|
721
|
+
* `/* … */` comments. Both are safe for any single-line string, so the only
|
|
722
|
+
* thing left to refuse is a line break — which no Xcode phase display name can
|
|
723
|
+
* carry anyway.
|
|
724
|
+
*/
|
|
725
|
+
function isValidScriptPhaseName(value /*: unknown */) /*: boolean */ {
|
|
726
|
+
return typeof value === 'string' && value.length > 0 && !/[\r\n]/.test(value);
|
|
727
|
+
}
|
|
728
|
+
|
|
627
729
|
module.exports = {
|
|
730
|
+
REACT_NATIVE_PACKAGE_NAME,
|
|
731
|
+
REACT_CODEGEN_PACKAGE_NAME,
|
|
732
|
+
AUTOLINKED_PACKAGE_NAME,
|
|
733
|
+
REACT_NATIVE_UMBRELLA_PRODUCT,
|
|
734
|
+
REACT_NATIVE_HEADERS_PRODUCT,
|
|
735
|
+
REACT_NATIVE_XCFRAMEWORK_PRODUCTS,
|
|
736
|
+
REACT_NATIVE_PRODUCTS,
|
|
737
|
+
REACT_CODEGEN_PRODUCTS,
|
|
738
|
+
REACT_CODEGEN_APP_PRODUCTS,
|
|
739
|
+
REACT_HEADERS_TARGET_DIR,
|
|
740
|
+
RESERVED_SWIFT_NAMES,
|
|
628
741
|
makeLogger,
|
|
629
742
|
displayPath,
|
|
630
743
|
sharedCacheDir,
|
|
@@ -641,5 +754,7 @@ module.exports = {
|
|
|
641
754
|
RemoteVersionError,
|
|
642
755
|
installSpmCodegenTemplate,
|
|
643
756
|
runCodegenAndInstallTemplate,
|
|
757
|
+
isValidScriptPhaseId,
|
|
758
|
+
isValidScriptPhaseName,
|
|
644
759
|
SCAFFOLDER_MARKER,
|
|
645
760
|
};
|
package/sdks/.hermesv1version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
hermes-v250829098.0.
|
|
1
|
+
hermes-v250829098.0.17
|
|
@@ -1 +1 @@
|
|
|
1
|
-
HERMES_VERSION_NAME=250829098.0.
|
|
1
|
+
HERMES_VERSION_NAME=250829098.0.17
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { View, ScrollViewProps, HostComponent, EventSubscription, TVParallaxProperties } from 'react-native';
|
|
2
|
+
import type { View, ScrollViewProps, HostComponent, EventSubscription, TVParallaxProperties, FocusEvent, BlurEvent } from 'react-native';
|
|
3
3
|
|
|
4
4
|
declare module 'react-native' {
|
|
5
5
|
export type FocusDestination = null | number | React.Component<any, any> | React.ComponentClass<any>;
|
|
@@ -19,6 +19,34 @@ declare module 'react-native' {
|
|
|
19
19
|
* @platform tv
|
|
20
20
|
*/
|
|
21
21
|
scrollAnimationEnabled?: boolean | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Duration in milliseconds of the animated scroll that runs when focus moves to
|
|
25
|
+
* another item. Applies to the snap scroll (`snapToAlignment="item"` with
|
|
26
|
+
* per-item `scrollSnapAlign`/`scrollSnapOffset` markers) and to animated
|
|
27
|
+
* `scrollTo` commands; other focus scrolls are instant. When unset or <= 0, the platform default (~250ms) is used.
|
|
28
|
+
* On tvOS the focus engine owns this animation and the prop has no effect.
|
|
29
|
+
*
|
|
30
|
+
* @platform android
|
|
31
|
+
*/
|
|
32
|
+
scrollAnimationDuration?: number | undefined;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Easing curve of that animation, either a CSS easing keyword or explicit
|
|
36
|
+
* cubic-bezier control points `[x1, y1, x2, y2]`. When unset, the platform
|
|
37
|
+
* default curve (`AccelerateDecelerateInterpolator`) is used.
|
|
38
|
+
* On tvOS the focus engine owns this animation and the prop has no effect.
|
|
39
|
+
*
|
|
40
|
+
* @platform android
|
|
41
|
+
*/
|
|
42
|
+
scrollAnimationEasing?:
|
|
43
|
+
| 'linear'
|
|
44
|
+
| 'ease'
|
|
45
|
+
| 'ease-in'
|
|
46
|
+
| 'ease-out'
|
|
47
|
+
| 'ease-in-out'
|
|
48
|
+
| [number, number, number, number]
|
|
49
|
+
| undefined;
|
|
22
50
|
}
|
|
23
51
|
|
|
24
52
|
interface ViewProps {
|
|
@@ -151,6 +179,17 @@ declare module 'react-native' {
|
|
|
151
179
|
* @deprecated Don't use it, no longer necessary.
|
|
152
180
|
*/
|
|
153
181
|
safePadding?: 'both' | 'vertical' | 'horizontal' | null | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Fires once when focus enters this focus guide's subtree from outside.
|
|
184
|
+
* Unlike `onFocus`, which bubbles and fires for every descendant, this
|
|
185
|
+
* does not fire again when focus moves between descendants.
|
|
186
|
+
*/
|
|
187
|
+
onFocusEnter?: ((event: FocusEvent) => void) | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Fires once when focus leaves this focus guide's subtree entirely. Does
|
|
190
|
+
* not fire when focus moves between descendants. Pairs with `onFocusEnter`.
|
|
191
|
+
*/
|
|
192
|
+
onFocusLeave?: ((event: BlurEvent) => void) | undefined;
|
|
154
193
|
}
|
|
155
194
|
|
|
156
195
|
export type FocusGuideMethods = {
|