mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5983edd21b |
@@ -46,7 +46,9 @@ describe('FirebaseClient', () => {
|
||||
expect(client.password).toBe('testpassword');
|
||||
expect(client.apiKey).toBe('test-api-key');
|
||||
expect(client.projectId).toBe('test-project');
|
||||
expect(client.databaseUrl).toBe('test-project.firebaseio.com');
|
||||
expect(client.databaseUrl).toBe(
|
||||
'test-project-default-rtdb.firebaseio.com',
|
||||
);
|
||||
expect(client.idToken).toBeNull();
|
||||
});
|
||||
});
|
||||
@@ -228,7 +230,7 @@ describe('FirebaseClient', () => {
|
||||
|
||||
expect(result).toEqual(mockData);
|
||||
expect(global.fetch).toHaveBeenCalledWith(
|
||||
'https://test-project.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
'https://test-project-default-rtdb.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -273,7 +275,7 @@ describe('FirebaseClient', () => {
|
||||
await client.makeDatabaseRequest('2023-12-01', 'PUT', testData);
|
||||
|
||||
expect(global.fetch).toHaveBeenCalledWith(
|
||||
'https://test-project.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
'https://test-project-default-rtdb.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
{
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
@@ -299,7 +301,7 @@ describe('FirebaseClient', () => {
|
||||
await client.storeResults('2023-12-01', results);
|
||||
|
||||
expect(global.fetch).toHaveBeenCalledWith(
|
||||
'https://test-project.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
'https://test-project-default-rtdb.firebaseio.com/nightly-results/2023-12-01.json?auth=existing-token',
|
||||
{
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
|
||||
@@ -15,7 +15,7 @@ class FirebaseClient {
|
||||
this.password = process.env.FIREBASE_APP_PASS;
|
||||
this.apiKey = process.env.FIREBASE_APP_APIKEY;
|
||||
this.projectId = process.env.FIREBASE_APP_PROJECTNAME;
|
||||
this.databaseUrl = `${this.projectId}.firebaseio.com`;
|
||||
this.databaseUrl = `${this.projectId}-default-rtdb.firebaseio.com`;
|
||||
this.idToken = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,58 +1,58 @@
|
||||
#!/usr/bin/env dotslash
|
||||
|
||||
// @generated SignedSource<<14de73ea0ed751d80c7c687c6aeb123f>>
|
||||
// @generated SignedSource<<686df5695b32a90cd465412d979a1a3f>>
|
||||
|
||||
|
||||
{
|
||||
"name": "React Native DevTools",
|
||||
"platforms": {
|
||||
"linux-aarch64": {
|
||||
"size": 116120331,
|
||||
"size": 113511487,
|
||||
"hash": "sha256",
|
||||
"digest": "5a1747bdb50f8140d96e99b31f9a603ceaf52e777e5dd59f65edacd87f8c6348",
|
||||
"digest": "c22f7d5e029357f05055ce7c56cc284a0d441d558e103a7b7ebae118c67d0b95",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQMRq1ou56GjpsIRFHpozEYiPfCuVvgWQVwiMMPBbwKyBnebit8HDGKof5XgDHbAKCqAZSgC8L22eJETnqIUM3kEAMYNXcHviIGy41rsXKVDYDgyWlGFB1zP2WzHrjWagfD062Pt4q5GqvCG5RVlhz656BOsutU7B4pDXGFCIdry7FveKn0PXGxvd1E"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPRilWDJV8xyKEv9lqYn7Hf2kyZg6nqW8KctGZCXsU95lS_MTFyAmEULrB3J6hGCjqBY2Zl-uq_FjERAIgzbZFWX2eceacTbutBSOKEj6QTZzkVN_L1zPh2lGh24x29MHpkwUzw4E-kAXV43f-11QxqD7orI1QicyOnsmUqeRNKE_QjM9rNRsw6iE8"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-arm64/React Native DevTools"
|
||||
},
|
||||
"linux-x86_64": {
|
||||
"size": 116056146,
|
||||
"size": 113244728,
|
||||
"hash": "sha256",
|
||||
"digest": "b48a3e392ac482de8058917879cf07fd5934dcb84aa901d4fe0d29273b503f54",
|
||||
"digest": "d749aee18d6c969f033511ed631b439c578068cc20786974bc0ee707c6c2f177",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQOyyb_LXrME2ubBGSkEi1vDw-2hwuHgHwnR-kAGQyhJK7lnELQDXKX1xW_u0joDwbTOhmiptwenq07G2NFkrY3t_AXefb_xTu2qHzpmrsX2YcwJlewbprgbuX7Uvdhqncb_IRAnJ4ogYKHUg6CZBNmLCQsyDsoqmkXtJ9ikJcQeDu2aiqbb-RWJ"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQP8NAAXjHJ-9NJThip1nnmVim4yiS1tdYAXmWl2Remiluq5f13nXA8YEadsmGRLWxXz2WJouHXSK47ea4a30fxewyKeTt0niFn3T-lr_91m3Ve5ZS-FOZ_9CRVCkv5zC-Z1FlXJGOnphfWetIU10Pw9tho3IzjdSNlXle0XTrkJ2AyKSl4cKPaX"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools-linux-x64/React Native DevTools"
|
||||
},
|
||||
"macos-aarch64": {
|
||||
"size": 110957864,
|
||||
"size": 108805847,
|
||||
"hash": "sha256",
|
||||
"digest": "7964d83c857f12bb741abf4377771f3f3697b81df6283dd88d75ae43991afb73",
|
||||
"digest": "dc4a6cfa3d2d8646db8793ef497e43ad72be54bb14ed96345d059880ff72ce1e",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQM7USVzavWxZkjOO6CasnSfPIfE08jJAkwfVO0qWiYBli136vpzA_HS89ZqsIsAC_GXeT7K-K9BxdON7z5qBoRMUygAay7z4DGT5OZ9YSf9MDCd0JOzah5_6s3ijw2j4eeRu8ZNYzI3aTutDXtPMJAb2KfBHGx2lEiSW5YK9idcB5Y2boAWeDXXX5nb"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPuZx9G4h30mUDM0hZ8y74LbzAi7-S6jnOqq8uyfDdIptLwIgpb8CKB8F2tduvaBFMGd7obwXd2NVy01r6XKVdgAK5-QTp8PYUPUE7VSCi6QAqobXcQ2uq_lY-jgyj8XkV4Ua4gA6KR609Bmh-beSTOrSqMymqVodaGqoGjB_9jVwfD99_PfFlex-Ta"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
"path": "React Native DevTools.app/Contents/MacOS/React Native DevTools"
|
||||
},
|
||||
"macos-x86_64": {
|
||||
"size": 117827315,
|
||||
"size": 113766610,
|
||||
"hash": "sha256",
|
||||
"digest": "bab2fac43def4a82fb88300aac05180eeda24f31cc00402a3ff7ca2e612bd532",
|
||||
"digest": "74178859ce6a1c26c32055e192b1b123822c76c827ea86a6dfdb5463b89b1ace",
|
||||
"providers": [
|
||||
{
|
||||
"type": "http",
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQPYS0ZRQ7RV1S-yy3tut6pRqcKdPcOiKfekrA5AXdd_M-HDaXLwJS57iAFU2K2X-EA_cyg25C3L-5L7O3eyNKPMToZHbV282GiojnNSKFNjsjj9_B737lOwHI_XqbDQEIiNJZ7NjbkZ8_iMKK-LNL-Ydha2ORWWqytuzP4sWQ6sm0XIxsdyQ6bOLw"
|
||||
"url": "https://scontent.xx.fbcdn.net/mci_ab/uap/?ab_b=m&ab_page=react_native_devtools_binaries&ab_entry=AQN6DjGhr8_L7N_cwrh8pi3cfNcbn9dot_QQpgwe3Vv-780FDgi6JUeMvbo_wbFoT2rogxfHZ0-NbXbKdWYwhGUoGeQuikT57QnVMOYuPUTjlQUgYy0Ng9XPhq3iSEYwlMV1XsUJuPFRUg-hIHcgaaA55JoTLXZ1fLYydhHnmgRxGHc4pxaHvSpTtQ"
|
||||
}
|
||||
],
|
||||
"format": "tar.gz",
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4",
|
||||
"electron": ">=37.2.4"
|
||||
"electron": ">=36.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.6",
|
||||
"electron": "37.2.4"
|
||||
"electron": "36.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"semver": "^7.1.3"
|
||||
|
||||
+26
@@ -29,6 +29,7 @@ import com.facebook.react.utils.JdkConfiguratorUtils.configureJavaToolChains
|
||||
import com.facebook.react.utils.JsonUtils
|
||||
import com.facebook.react.utils.NdkConfiguratorUtils.configureReactNativeNdk
|
||||
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
|
||||
import com.facebook.react.utils.PropertyUtils
|
||||
import com.facebook.react.utils.findPackageJsonFile
|
||||
import java.io.File
|
||||
import kotlin.system.exitProcess
|
||||
@@ -42,6 +43,7 @@ import org.gradle.internal.jvm.Jvm
|
||||
class ReactPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
checkJvmVersion(project)
|
||||
checkLegacyArchProperty(project)
|
||||
val extension = project.extensions.create("react", ReactExtension::class.java, project)
|
||||
|
||||
// We register a private extension on the rootProject so that project wide configs
|
||||
@@ -114,6 +116,30 @@ class ReactPlugin : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkLegacyArchProperty(project: Project) {
|
||||
if ((project.hasProperty(PropertyUtils.NEW_ARCH_ENABLED) &&
|
||||
!project.property(PropertyUtils.NEW_ARCH_ENABLED).toString().toBoolean()) ||
|
||||
(project.hasProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED) &&
|
||||
!project.property(PropertyUtils.SCOPED_NEW_ARCH_ENABLED).toString().toBoolean())) {
|
||||
project.logger.error(
|
||||
"""
|
||||
|
||||
********************************************************************************
|
||||
|
||||
WARNING: Setting `newArchEnabled=false` in your `gradle.properties` file is not
|
||||
supported anymore since React Native 0.82.
|
||||
|
||||
You can remove the line from your `gradle.properties` file.
|
||||
|
||||
The application will run with the New Architecture enabled by default.
|
||||
|
||||
********************************************************************************
|
||||
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
}
|
||||
|
||||
/** This function configures Android resources - in this case just the bundle */
|
||||
private fun configureResources(project: Project, reactExtension: ReactExtension) {
|
||||
project.extensions.getByType(ApplicationAndroidComponentsExtension::class.java).finalizeDsl {
|
||||
|
||||
+3
-40
@@ -7,10 +7,8 @@
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.utils.PropertyUtils
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.jetbrains.kotlin.gradle.plugin.extraProperties
|
||||
|
||||
/**
|
||||
* Gradle plugin applied to the `android/build.gradle` file.
|
||||
@@ -20,25 +18,13 @@ import org.jetbrains.kotlin.gradle.plugin.extraProperties
|
||||
*/
|
||||
class ReactRootProjectPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
checkLegacyArchProperty(project)
|
||||
project.subprojects { subproject ->
|
||||
project.subprojects {
|
||||
// As the :app project (i.e. ReactPlugin) configures both namespaces and JVM toolchains
|
||||
// for libraries, its evaluation must happen before the libraries' evaluation.
|
||||
// Eventually the configuration of namespace/JVM toolchain can be moved inside this plugin.
|
||||
if (subproject.path != ":app") {
|
||||
subproject.evaluationDependsOn(":app")
|
||||
if (it.path != ":app") {
|
||||
it.evaluationDependsOn(":app")
|
||||
}
|
||||
// We set the New Architecture properties to true for all subprojects. So that
|
||||
// libraries don't need to be modified and can keep on using the isNewArchEnabled()
|
||||
// function to check if property is set.
|
||||
if (subproject.hasProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED)) {
|
||||
subproject.setProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED, "true")
|
||||
}
|
||||
if (subproject.hasProperty(PropertyUtils.NEW_ARCH_ENABLED)) {
|
||||
subproject.setProperty(PropertyUtils.NEW_ARCH_ENABLED, "true")
|
||||
}
|
||||
subproject.extraProperties.set(PropertyUtils.NEW_ARCH_ENABLED, "true")
|
||||
subproject.extraProperties.set(PropertyUtils.SCOPED_NEW_ARCH_ENABLED, "true")
|
||||
}
|
||||
// We need to make sure that `:app:preBuild` task depends on all other subprojects' preBuild
|
||||
// tasks. This is necessary in order to have all the codegen generated code before the CMake
|
||||
@@ -57,27 +43,4 @@ class ReactRootProjectPlugin : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkLegacyArchProperty(project: Project) {
|
||||
if ((project.hasProperty(PropertyUtils.NEW_ARCH_ENABLED) &&
|
||||
!project.property(PropertyUtils.NEW_ARCH_ENABLED).toString().toBoolean()) ||
|
||||
(project.hasProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED) &&
|
||||
!project.property(PropertyUtils.SCOPED_NEW_ARCH_ENABLED).toString().toBoolean())) {
|
||||
project.logger.error(
|
||||
"""
|
||||
********************************************************************************
|
||||
|
||||
WARNING: Setting `newArchEnabled=false` in your `gradle.properties` file is not
|
||||
supported anymore since React Native 0.82.
|
||||
|
||||
You can remove the line from your `gradle.properties` file.
|
||||
|
||||
The application will run with the New Architecture enabled by default.
|
||||
|
||||
********************************************************************************
|
||||
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -717,7 +717,7 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps(
|
||||
const InterfaceOnlyNativeComponentViewProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {std::string{\\"\\"}})) {}
|
||||
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {\\"\\"})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const {
|
||||
@@ -1060,7 +1060,7 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps(
|
||||
const StringPropNativeComponentViewProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {std::string{\\"\\"}})),
|
||||
placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {\\"\\"})),
|
||||
defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
|
||||
+3
-62
@@ -18,7 +18,6 @@ Object {
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/graphics/RectangleEdges.h>
|
||||
@@ -90,7 +89,6 @@ static inline std::string toString(const ArrayPropsNativeComponentViewSizesMaskW
|
||||
struct ArrayPropsNativeComponentViewObjectStruct {
|
||||
std::string prop{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentViewObjectStruct&) const = default;
|
||||
|
||||
@@ -135,7 +133,6 @@ struct ArrayPropsNativeComponentViewArrayOfObjectsStruct {
|
||||
Float prop1{0.0};
|
||||
int prop2{0};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentViewArrayOfObjectsStruct&) const = default;
|
||||
|
||||
@@ -206,8 +203,6 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -230,7 +225,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -249,8 +243,6 @@ class BooleanPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -273,7 +265,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -292,8 +283,6 @@ class ColorPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -317,7 +306,6 @@ Object {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -336,8 +324,6 @@ class DimensionPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -360,7 +346,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -378,8 +363,6 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -402,7 +385,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -486,8 +468,6 @@ class EnumPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -510,7 +490,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -528,8 +507,6 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -552,7 +529,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -570,8 +546,6 @@ class EventPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -594,7 +568,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -618,8 +591,6 @@ class FloatPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -642,7 +613,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -661,8 +631,6 @@ class ImagePropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -685,7 +653,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -705,8 +672,6 @@ class IntegerPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -729,7 +694,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -740,15 +704,13 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string title{std::string{\\"\\"}};
|
||||
std::string title{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName getDiffPropsImplementationTarget() const override;
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -771,7 +733,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -789,8 +750,6 @@ class MixedPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -813,7 +772,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -837,8 +795,6 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -861,7 +817,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -879,8 +834,6 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -905,7 +858,6 @@ Object {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -966,14 +918,13 @@ static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentIntEnumPr
|
||||
}
|
||||
#endif
|
||||
struct ObjectPropsNativeComponentObjectPropStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
std::string stringProp{\\"\\"};
|
||||
bool booleanProp{false};
|
||||
Float floatProp{0.0};
|
||||
int intProp{0};
|
||||
ObjectPropsNativeComponentStringEnumProp stringEnumProp{ObjectPropsNativeComponentStringEnumProp::Small};
|
||||
ObjectPropsNativeComponentIntEnumProp intEnumProp{ObjectPropsNativeComponentIntEnumProp::IntEnumProp0};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectPropStruct&) const = default;
|
||||
|
||||
@@ -1032,7 +983,6 @@ static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPro
|
||||
struct ObjectPropsNativeComponentObjectArrayPropStruct {
|
||||
std::vector<std::string> array{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectArrayPropStruct&) const = default;
|
||||
|
||||
@@ -1068,7 +1018,6 @@ struct ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct {
|
||||
SharedColor color{};
|
||||
Point point{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct&) const = default;
|
||||
|
||||
@@ -1124,8 +1073,6 @@ class ObjectPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1148,7 +1095,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -1167,8 +1113,6 @@ class PointPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1191,7 +1135,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1202,7 +1145,7 @@ class StringPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string placeholder{std::string{\\"\\"}};
|
||||
std::string placeholder{\\"\\"};
|
||||
std::string defaultValue{};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
@@ -1210,8 +1153,6 @@ class StringPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
-18
@@ -20,7 +20,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ArrayPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ArrayPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ArrayPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -95,7 +94,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class BooleanPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & BooleanPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public BooleanPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -138,7 +136,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ColorPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ColorPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ColorPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -178,7 +175,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class DimensionPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & DimensionPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public DimensionPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -217,7 +213,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EdgeInsetsPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EdgeInsetsPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EdgeInsetsPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -250,7 +245,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EnumPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EnumPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EnumPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -292,7 +286,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventNestedObjectPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventNestedObjectPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventNestedObjectPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -331,7 +324,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -370,7 +362,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class FloatPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & FloatPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public FloatPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -428,7 +419,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ImagePropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ImagePropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ImagePropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -467,7 +457,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class IntegerPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & IntegerPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public IntegerPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -512,7 +501,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class InterfaceOnlyNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & InterfaceOnlyNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public InterfaceOnlyNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -552,7 +540,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MixedPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MixedPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MixedPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -593,7 +580,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiNativePropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiNativePropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiNativePropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -641,7 +627,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class NoPropsNoEventsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & NoPropsNoEventsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public NoPropsNoEventsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -675,7 +660,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ObjectPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ObjectPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ObjectPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -721,7 +705,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class PointPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PointPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public PointPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -760,7 +743,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class StringPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & StringPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public StringPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
|
||||
+2
-2
@@ -717,7 +717,7 @@ InterfaceOnlyNativeComponentViewProps::InterfaceOnlyNativeComponentViewProps(
|
||||
const InterfaceOnlyNativeComponentViewProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {std::string{\\"\\"}})) {}
|
||||
title(convertRawProp(context, rawProps, \\"title\\", sourceProps.title, {\\"\\"})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName InterfaceOnlyNativeComponentViewProps::getDiffPropsImplementationTarget() const {
|
||||
@@ -1060,7 +1060,7 @@ StringPropNativeComponentViewProps::StringPropNativeComponentViewProps(
|
||||
const StringPropNativeComponentViewProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {std::string{\\"\\"}})),
|
||||
placeholder(convertRawProp(context, rawProps, \\"placeholder\\", sourceProps.placeholder, {\\"\\"})),
|
||||
defaultValue(convertRawProp(context, rawProps, \\"defaultValue\\", sourceProps.defaultValue, {})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
|
||||
+3
-62
@@ -18,7 +18,6 @@ Object {
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/graphics/RectangleEdges.h>
|
||||
@@ -90,7 +89,6 @@ static inline std::string toString(const ArrayPropsNativeComponentViewSizesMaskW
|
||||
struct ArrayPropsNativeComponentViewObjectStruct {
|
||||
std::string prop{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentViewObjectStruct&) const = default;
|
||||
|
||||
@@ -135,7 +133,6 @@ struct ArrayPropsNativeComponentViewArrayOfObjectsStruct {
|
||||
Float prop1{0.0};
|
||||
int prop2{0};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentViewArrayOfObjectsStruct&) const = default;
|
||||
|
||||
@@ -206,8 +203,6 @@ class ArrayPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -230,7 +225,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -249,8 +243,6 @@ class BooleanPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -273,7 +265,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -292,8 +283,6 @@ class ColorPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -317,7 +306,6 @@ Object {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -336,8 +324,6 @@ class DimensionPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -360,7 +346,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -378,8 +363,6 @@ class EdgeInsetsPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -402,7 +385,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -486,8 +468,6 @@ class EnumPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -510,7 +490,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -528,8 +507,6 @@ class EventNestedObjectPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -552,7 +529,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -570,8 +546,6 @@ class EventPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -594,7 +568,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -618,8 +591,6 @@ class FloatPropsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -642,7 +613,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -661,8 +631,6 @@ class ImagePropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -685,7 +653,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -705,8 +672,6 @@ class IntegerPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -729,7 +694,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -740,15 +704,13 @@ class InterfaceOnlyNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string title{std::string{\\"\\"}};
|
||||
std::string title{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName getDiffPropsImplementationTarget() const override;
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -771,7 +733,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -789,8 +750,6 @@ class MixedPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -813,7 +772,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -837,8 +795,6 @@ class MultiNativePropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -861,7 +817,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -879,8 +834,6 @@ class NoPropsNoEventsNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -905,7 +858,6 @@ Object {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -966,14 +918,13 @@ static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentIntEnumPr
|
||||
}
|
||||
#endif
|
||||
struct ObjectPropsNativeComponentObjectPropStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
std::string stringProp{\\"\\"};
|
||||
bool booleanProp{false};
|
||||
Float floatProp{0.0};
|
||||
int intProp{0};
|
||||
ObjectPropsNativeComponentStringEnumProp stringEnumProp{ObjectPropsNativeComponentStringEnumProp::Small};
|
||||
ObjectPropsNativeComponentIntEnumProp intEnumProp{ObjectPropsNativeComponentIntEnumProp::IntEnumProp0};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectPropStruct&) const = default;
|
||||
|
||||
@@ -1032,7 +983,6 @@ static inline folly::dynamic toDynamic(const ObjectPropsNativeComponentObjectPro
|
||||
struct ObjectPropsNativeComponentObjectArrayPropStruct {
|
||||
std::vector<std::string> array{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectArrayPropStruct&) const = default;
|
||||
|
||||
@@ -1068,7 +1018,6 @@ struct ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct {
|
||||
SharedColor color{};
|
||||
Point point{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsNativeComponentObjectPrimitiveRequiredPropStruct&) const = default;
|
||||
|
||||
@@ -1124,8 +1073,6 @@ class ObjectPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1148,7 +1095,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -1167,8 +1113,6 @@ class PointPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1191,7 +1135,6 @@ Object {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1202,7 +1145,7 @@ class StringPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string placeholder{std::string{\\"\\"}};
|
||||
std::string placeholder{\\"\\"};
|
||||
std::string defaultValue{};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
@@ -1210,8 +1153,6 @@ class StringPropNativeComponentViewProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
-18
@@ -20,7 +20,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ArrayPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ArrayPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ArrayPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -95,7 +94,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class BooleanPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & BooleanPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public BooleanPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -138,7 +136,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ColorPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ColorPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ColorPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -178,7 +175,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class DimensionPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & DimensionPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public DimensionPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -217,7 +213,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EdgeInsetsPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EdgeInsetsPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EdgeInsetsPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -250,7 +245,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EnumPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EnumPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EnumPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -292,7 +286,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventNestedObjectPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventNestedObjectPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventNestedObjectPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -331,7 +324,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -370,7 +362,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class FloatPropsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & FloatPropsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public FloatPropsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -428,7 +419,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ImagePropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ImagePropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ImagePropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -467,7 +457,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class IntegerPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & IntegerPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public IntegerPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -512,7 +501,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class InterfaceOnlyNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & InterfaceOnlyNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public InterfaceOnlyNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -552,7 +540,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MixedPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MixedPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MixedPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -593,7 +580,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiNativePropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiNativePropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiNativePropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -641,7 +627,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class NoPropsNoEventsNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & NoPropsNoEventsNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public NoPropsNoEventsNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -675,7 +660,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ObjectPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ObjectPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ObjectPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -721,7 +705,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class PointPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PointPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public PointPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -760,7 +743,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class StringPropNativeComponentViewManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & StringPropNativeComponentViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public StringPropNativeComponentViewManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
|
||||
@@ -46,17 +46,9 @@ try {
|
||||
} catch (err) {
|
||||
throw new Error(`Can't parse schema to JSON. ${schemaPath}`);
|
||||
}
|
||||
const includeGetDebugPropsImplementation: boolean =
|
||||
libraryName.includes('FBReactNativeSpec');
|
||||
|
||||
RNCodegen.generate(
|
||||
{
|
||||
libraryName,
|
||||
schema,
|
||||
outputDirectory,
|
||||
packageName,
|
||||
assumeNonnull,
|
||||
includeGetDebugPropsImplementation,
|
||||
},
|
||||
{libraryName, schema, outputDirectory, packageName, assumeNonnull},
|
||||
{
|
||||
generators: [
|
||||
'descriptors',
|
||||
|
||||
@@ -81,7 +81,6 @@ export type GenerateFunction = (
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean,
|
||||
) => FilesOutput;
|
||||
|
||||
export type LibraryGeneratorsFunctions = $ReadOnly<{
|
||||
@@ -95,7 +94,6 @@ export type LibraryOptions = $ReadOnly<{
|
||||
packageName?: string, // Some platforms have a notion of package, which should be configurable.
|
||||
assumeNonnull: boolean,
|
||||
useLocalIncludePaths?: boolean,
|
||||
includeGetDebugPropsImplementation?: boolean,
|
||||
libraryGenerators?: LibraryGeneratorsFunctions,
|
||||
}>;
|
||||
|
||||
@@ -257,7 +255,6 @@ module.exports = {
|
||||
packageName,
|
||||
assumeNonnull,
|
||||
useLocalIncludePaths,
|
||||
includeGetDebugPropsImplementation = false,
|
||||
libraryGenerators = LIBRARY_GENERATORS,
|
||||
}: LibraryOptions,
|
||||
{generators, test}: LibraryConfig,
|
||||
@@ -302,7 +299,6 @@ module.exports = {
|
||||
packageName,
|
||||
assumeNonnull,
|
||||
headerPrefix,
|
||||
includeGetDebugPropsImplementation,
|
||||
).forEach((contents: string, fileName: string) => {
|
||||
generatedFiles.push({
|
||||
name: fileName,
|
||||
|
||||
@@ -190,7 +190,7 @@ function convertDefaultTypeToString(
|
||||
if (typeAnnotation.default == null) {
|
||||
return '';
|
||||
}
|
||||
return `std::string{"${typeAnnotation.default}"}`;
|
||||
return `"${typeAnnotation.default}"`;
|
||||
case 'Int32TypeAnnotation':
|
||||
return String(typeAnnotation.default);
|
||||
case 'DoubleTypeAnnotation':
|
||||
|
||||
-1
@@ -61,7 +61,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'ComponentDescriptors.cpp';
|
||||
|
||||
|
||||
-1
@@ -63,7 +63,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'ComponentDescriptors.h';
|
||||
|
||||
|
||||
-1
@@ -381,7 +381,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'RCTComponentViewHelpers.h';
|
||||
|
||||
|
||||
-1
@@ -413,7 +413,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const moduleComponents: ComponentCollection = Object.keys(schema.modules)
|
||||
.map(moduleName => {
|
||||
|
||||
-1
@@ -320,7 +320,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const moduleComponents: ComponentCollection = Object.keys(schema.modules)
|
||||
.map(moduleName => {
|
||||
|
||||
+1
-43
@@ -77,8 +77,6 @@ function generatePropsDiffString(
|
||||
className: string,
|
||||
componentName: string,
|
||||
component: ComponentShape,
|
||||
debugProps: string = '',
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
) {
|
||||
const diffProps = component.props
|
||||
.map(prop => {
|
||||
@@ -136,12 +134,6 @@ function generatePropsDiffString(
|
||||
})
|
||||
.join('\n' + ' ');
|
||||
|
||||
const getDebugPropsString = `#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
SharedDebugStringConvertibleList ${className}::getDebugProps() const {
|
||||
return ViewProps::getDebugProps()${debugProps && debugProps.length > 0 ? ` +\n\t\tSharedDebugStringConvertibleList{${debugProps}\n\t}` : ''};
|
||||
}
|
||||
#endif`;
|
||||
|
||||
return `
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName ${className}::getDiffPropsImplementationTarget() const {
|
||||
@@ -161,11 +153,8 @@ folly::dynamic ${className}::getDiffProps(
|
||||
${diffProps}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
${includeGetDebugPropsImplementation ? getDebugPropsString : ''}
|
||||
`;
|
||||
#endif`;
|
||||
}
|
||||
|
||||
function generatePropsString(componentName: string, component: ComponentShape) {
|
||||
return component.props
|
||||
.map(prop => {
|
||||
@@ -181,24 +170,6 @@ function generatePropsString(componentName: string, component: ComponentShape) {
|
||||
.join(',\n' + ' ');
|
||||
}
|
||||
|
||||
function generateDebugPropsString(
|
||||
componentName: string,
|
||||
component: ComponentShape,
|
||||
) {
|
||||
return component.props
|
||||
.map(prop => {
|
||||
if (prop.typeAnnotation.type === 'ObjectTypeAnnotation') {
|
||||
// Skip ObjectTypeAnnotation because there is no generic `toString`
|
||||
// method for it. We would have to define an interface that the structs implement.
|
||||
return '';
|
||||
}
|
||||
|
||||
const defaultValue = convertDefaultTypeToString(componentName, prop);
|
||||
return `\n\t\t\tdebugStringConvertibleItem("${prop.name}", ${prop.name}${defaultValue ? `, ${defaultValue}` : ''})`;
|
||||
})
|
||||
.join(',');
|
||||
}
|
||||
|
||||
function getClassExtendString(component: ComponentShape): string {
|
||||
const extendString =
|
||||
' ' +
|
||||
@@ -231,7 +202,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'Props.cpp';
|
||||
const allImports: Set<string> = new Set([
|
||||
@@ -239,13 +209,6 @@ module.exports = {
|
||||
'#include <react/renderer/core/PropsParserContext.h>',
|
||||
]);
|
||||
|
||||
if (includeGetDebugPropsImplementation) {
|
||||
allImports.add('#include <react/renderer/core/graphicsConversions.h>');
|
||||
allImports.add(
|
||||
'#include <react/renderer/debug/debugStringConvertibleUtils.h>',
|
||||
);
|
||||
}
|
||||
|
||||
const componentProps = Object.keys(schema.modules)
|
||||
.map(moduleName => {
|
||||
const module = schema.modules[moduleName];
|
||||
@@ -266,15 +229,10 @@ module.exports = {
|
||||
|
||||
const propsString = generatePropsString(componentName, component);
|
||||
const extendString = getClassExtendString(component);
|
||||
const debugProps = includeGetDebugPropsImplementation
|
||||
? generateDebugPropsString(componentName, component)
|
||||
: '';
|
||||
const diffPropsString = generatePropsDiffString(
|
||||
newName,
|
||||
componentName,
|
||||
component,
|
||||
debugProps,
|
||||
includeGetDebugPropsImplementation,
|
||||
);
|
||||
|
||||
const imports = getImports(component.props);
|
||||
|
||||
@@ -65,20 +65,14 @@ const ClassTemplate = ({
|
||||
className,
|
||||
props,
|
||||
extendClasses,
|
||||
includeGetDebugPropsImplementation,
|
||||
}: {
|
||||
enums: string,
|
||||
structs: string,
|
||||
className: string,
|
||||
props: string,
|
||||
extendClasses: string,
|
||||
includeGetDebugPropsImplementation: boolean,
|
||||
}) => {
|
||||
const getDebugPropsString = `#if RN_DEBUG_STRING_CONVERTIBLE
|
||||
SharedDebugStringConvertibleList getDebugProps() const override;
|
||||
#endif`;
|
||||
|
||||
return `
|
||||
}) =>
|
||||
`
|
||||
${enums}
|
||||
${structs}
|
||||
class ${className} final${extendClasses} {
|
||||
@@ -95,11 +89,8 @@ class ${className} final${extendClasses} {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
${includeGetDebugPropsImplementation ? getDebugPropsString : ''}
|
||||
};
|
||||
`.trim();
|
||||
};
|
||||
|
||||
const EnumTemplate = ({
|
||||
enumName,
|
||||
@@ -187,7 +178,6 @@ const StructTemplate = ({
|
||||
`struct ${structName} {
|
||||
${fields}
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ${structName}&) const = default;
|
||||
|
||||
@@ -546,7 +536,6 @@ function getExtendsImports(
|
||||
const imports: Set<string> = new Set();
|
||||
|
||||
imports.add('#include <react/renderer/core/PropsParserContext.h>');
|
||||
imports.add('#include <react/renderer/debug/DebugStringConvertible.h>');
|
||||
|
||||
extendsProps.forEach(extendProps => {
|
||||
switch (extendProps.type) {
|
||||
@@ -794,7 +783,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'Props.h';
|
||||
|
||||
@@ -843,7 +831,6 @@ module.exports = {
|
||||
className: newName,
|
||||
extendClasses: extendString,
|
||||
props: propsString,
|
||||
includeGetDebugPropsImplementation,
|
||||
});
|
||||
|
||||
return replacedTemplate;
|
||||
|
||||
-2
@@ -55,7 +55,6 @@ package ${packageName};
|
||||
|
||||
${imports}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ${className}<T extends ${extendClasses}, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ${interfaceClassName}<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ${className}(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -300,7 +299,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
// TODO: This doesn't support custom package name yet.
|
||||
const normalizedPackageName = 'com.facebook.react.viewmanagers';
|
||||
|
||||
-1
@@ -238,7 +238,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
// TODO: This doesn't support custom package name yet.
|
||||
const normalizedPackageName = 'com.facebook.react.viewmanagers';
|
||||
|
||||
-1
@@ -54,7 +54,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'ShadowNodes.cpp';
|
||||
|
||||
|
||||
-1
@@ -74,7 +74,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'ShadowNodes.h';
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'States.cpp';
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ module.exports = {
|
||||
packageName?: string,
|
||||
assumeNonnull: boolean = false,
|
||||
headerPrefix?: string,
|
||||
includeGetDebugPropsImplementation?: boolean = false,
|
||||
): FilesOutput {
|
||||
const fileName = 'States.h';
|
||||
|
||||
|
||||
+3
-3
@@ -347,7 +347,7 @@ CommandNativeComponentProps::CommandNativeComponentProps(
|
||||
const CommandNativeComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})) {}
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {\\"\\"})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName CommandNativeComponentProps::getDiffPropsImplementationTarget() const {
|
||||
@@ -1168,7 +1168,7 @@ InterfaceOnlyComponentProps::InterfaceOnlyComponentProps(
|
||||
const InterfaceOnlyComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})) {}
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {\\"\\"})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName InterfaceOnlyComponentProps::getDiffPropsImplementationTarget() const {
|
||||
@@ -1554,7 +1554,7 @@ StringPropComponentProps::StringPropComponentProps(
|
||||
const StringPropComponentProps &sourceProps,
|
||||
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
||||
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {std::string{\\"\\"}})),
|
||||
accessibilityHint(convertRawProp(context, rawProps, \\"accessibilityHint\\", sourceProps.accessibilityHint, {\\"\\"})),
|
||||
accessibilityRole(convertRawProp(context, rawProps, \\"accessibilityRole\\", sourceProps.accessibilityRole, {})) {}
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
|
||||
+10
-115
@@ -18,7 +18,6 @@ Map {
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -87,8 +86,7 @@ static inline std::string toString(const ArrayPropsNativeComponentSizesMaskWrapp
|
||||
return result;
|
||||
}
|
||||
struct ArrayPropsNativeComponentObjectStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
|
||||
std::string stringProp{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentObjectStruct&) const = default;
|
||||
@@ -131,8 +129,7 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
|
||||
|
||||
|
||||
struct ArrayPropsNativeComponentArrayObjectStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
|
||||
std::string stringProp{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentArrayObjectStruct&) const = default;
|
||||
@@ -177,7 +174,6 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
|
||||
struct ArrayPropsNativeComponentArrayStruct {
|
||||
std::vector<ArrayPropsNativeComponentArrayObjectStruct> object{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentArrayStruct&) const = default;
|
||||
|
||||
@@ -219,8 +215,7 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
|
||||
|
||||
|
||||
struct ArrayPropsNativeComponentArrayOfArrayOfObjectStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
|
||||
std::string stringProp{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentArrayOfArrayOfObjectStruct&) const = default;
|
||||
@@ -291,8 +286,6 @@ class ArrayPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -317,7 +310,6 @@ Map {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -330,7 +322,6 @@ struct ArrayPropsNativeComponentNativePrimitivesStruct {
|
||||
std::vector<ImageSource> srcs{};
|
||||
std::vector<Point> points{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ArrayPropsNativeComponentNativePrimitivesStruct&) const = default;
|
||||
|
||||
@@ -394,8 +385,6 @@ class ArrayPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -418,7 +407,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -436,8 +424,6 @@ class BooleanPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -460,7 +446,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -479,8 +464,6 @@ class ColorPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -503,7 +486,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -521,8 +503,6 @@ class CommandNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -545,7 +525,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -556,15 +535,13 @@ class CommandNativeComponentProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string accessibilityHint{std::string{\\"\\"}};
|
||||
std::string accessibilityHint{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName getDiffPropsImplementationTarget() const override;
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -588,7 +565,6 @@ Map {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <yoga/Yoga.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -607,8 +583,6 @@ class DimensionPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -631,7 +605,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -654,8 +627,6 @@ class DoublePropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -678,7 +649,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -696,8 +666,6 @@ class EventsNestedObjectNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -720,7 +688,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -738,8 +705,6 @@ class EventsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -762,7 +727,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -780,8 +744,6 @@ class InterfaceOnlyComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -804,7 +766,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -822,8 +783,6 @@ class ExcludedAndroidComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -846,7 +805,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -864,8 +822,6 @@ class ExcludedAndroidIosComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -888,7 +844,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -906,8 +861,6 @@ class ExcludedIosComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
class MultiFileIncludedNativeComponentProps final : public ViewProps {
|
||||
@@ -924,8 +877,6 @@ class MultiFileIncludedNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -948,7 +899,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -971,8 +921,6 @@ class FloatPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -995,7 +943,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -1014,8 +961,6 @@ class ImagePropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1038,7 +983,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/RectangleEdges.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -1057,8 +1001,6 @@ class InsetsPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1081,7 +1023,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1136,8 +1077,6 @@ class Int32EnumPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1160,7 +1099,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1180,8 +1118,6 @@ class IntegerPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1204,7 +1140,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1215,15 +1150,13 @@ class InterfaceOnlyComponentProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string accessibilityHint{std::string{\\"\\"}};
|
||||
std::string accessibilityHint{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
ComponentName getDiffPropsImplementationTarget() const override;
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1246,7 +1179,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1264,8 +1196,6 @@ class MixedPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1288,7 +1218,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -1312,8 +1241,6 @@ class ImageColorPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1336,7 +1263,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1354,8 +1280,6 @@ class NoPropsNoEventsComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1380,7 +1304,6 @@ Map {
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
#include <react/renderer/imagemanager/primitives.h>
|
||||
@@ -1436,7 +1359,6 @@ static inline folly::dynamic toDynamic(const ObjectPropsIntEnumProp &value) {
|
||||
struct ObjectPropsObjectPropObjectArrayPropStruct {
|
||||
std::vector<std::string> array{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropObjectArrayPropStruct&) const = default;
|
||||
|
||||
@@ -1472,7 +1394,6 @@ struct ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct {
|
||||
SharedColor color{};
|
||||
Point point{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropObjectPrimitiveRequiredPropStruct&) const = default;
|
||||
|
||||
@@ -1514,8 +1435,7 @@ static inline folly::dynamic toDynamic(const ObjectPropsObjectPropObjectPrimitiv
|
||||
#endif
|
||||
|
||||
struct ObjectPropsObjectPropNestedPropANestedPropBStruct {
|
||||
std::string nestedPropC{std::string{\\"\\"}};
|
||||
|
||||
std::string nestedPropC{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropNestedPropANestedPropBStruct&) const = default;
|
||||
@@ -1550,7 +1470,6 @@ static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedPropANes
|
||||
struct ObjectPropsObjectPropNestedPropAStruct {
|
||||
ObjectPropsObjectPropNestedPropANestedPropBStruct nestedPropB{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropNestedPropAStruct&) const = default;
|
||||
|
||||
@@ -1582,8 +1501,7 @@ static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedPropAStr
|
||||
#endif
|
||||
|
||||
struct ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
|
||||
std::string stringProp{\\"\\"};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct&) const = default;
|
||||
@@ -1628,7 +1546,6 @@ static inline void fromRawValue(const PropsParserContext& context, const RawValu
|
||||
struct ObjectPropsObjectPropNestedArrayAsPropertyStruct {
|
||||
std::vector<ObjectPropsObjectPropNestedArrayAsPropertyArrayPropStruct> arrayProp{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropNestedArrayAsPropertyStruct&) const = default;
|
||||
|
||||
@@ -1660,11 +1577,11 @@ static inline folly::dynamic toDynamic(const ObjectPropsObjectPropNestedArrayAsP
|
||||
#endif
|
||||
|
||||
struct ObjectPropsObjectPropStruct {
|
||||
std::string stringProp{std::string{\\"\\"}};
|
||||
std::string stringProp{\\"\\"};
|
||||
bool booleanProp{false};
|
||||
Float floatProp{0.0};
|
||||
int intProp{0};
|
||||
std::string stringUserDefaultProp{std::string{\\"user_default\\"}};
|
||||
std::string stringUserDefaultProp{\\"user_default\\"};
|
||||
bool booleanUserDefaultProp{true};
|
||||
Float floatUserDefaultProp{3.14};
|
||||
int intUserDefaultProp{9999};
|
||||
@@ -1675,7 +1592,6 @@ struct ObjectPropsObjectPropStruct {
|
||||
ObjectPropsObjectPropNestedPropAStruct nestedPropA{};
|
||||
ObjectPropsObjectPropNestedArrayAsPropertyStruct nestedArrayAsProperty{};
|
||||
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
bool operator==(const ObjectPropsObjectPropStruct&) const = default;
|
||||
|
||||
@@ -1784,8 +1700,6 @@ class ObjectPropsProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1808,7 +1722,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
#include <react/renderer/graphics/Point.h>
|
||||
|
||||
namespace facebook::react {
|
||||
@@ -1827,8 +1740,6 @@ class PointPropNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1851,7 +1762,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1893,8 +1803,6 @@ class StringEnumPropsNativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1917,7 +1825,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1928,7 +1835,7 @@ class StringPropComponentProps final : public ViewProps {
|
||||
|
||||
#pragma mark - Props
|
||||
|
||||
std::string accessibilityHint{std::string{\\"\\"}};
|
||||
std::string accessibilityHint{\\"\\"};
|
||||
std::string accessibilityRole{};
|
||||
|
||||
#ifdef RN_SERIALIZABLE_STATE
|
||||
@@ -1936,8 +1843,6 @@ class StringPropComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1960,7 +1865,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -1978,8 +1882,6 @@ class MultiFile1NativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
class MultiFile2NativeComponentProps final : public ViewProps {
|
||||
@@ -1996,8 +1898,6 @@ class MultiFile2NativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -2020,7 +1920,6 @@ Map {
|
||||
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/debug/DebugStringConvertible.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
@@ -2038,8 +1937,6 @@ class MultiComponent1NativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
class MultiComponent2NativeComponentProps final : public ViewProps {
|
||||
@@ -2056,8 +1953,6 @@ class MultiComponent2NativeComponentProps final : public ViewProps {
|
||||
|
||||
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
||||
#endif
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
-30
@@ -20,7 +20,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ArrayPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ArrayPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ArrayPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -96,7 +95,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ArrayPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ArrayPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ArrayPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -135,7 +133,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class BooleanPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & BooleanPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public BooleanPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -175,7 +172,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ColorPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ColorPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ColorPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -215,7 +211,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class CommandNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & CommandNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public CommandNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -261,7 +256,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class CommandNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & CommandNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public CommandNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -316,7 +310,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class DimensionPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & DimensionPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public DimensionPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -355,7 +348,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class DoublePropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & DoublePropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public DoublePropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -409,7 +401,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventsNestedObjectNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventsNestedObjectNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventsNestedObjectNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -448,7 +439,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class EventsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & EventsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public EventsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -487,7 +477,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class InterfaceOnlyComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & InterfaceOnlyComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public InterfaceOnlyComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -524,7 +513,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ExcludedIosComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ExcludedIosComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ExcludedIosComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -552,7 +540,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiFileIncludedNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiFileIncludedNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiFileIncludedNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -591,7 +578,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class FloatPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & FloatPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public FloatPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -646,7 +632,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ImagePropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ImagePropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ImagePropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -686,7 +671,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class InsetsPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & InsetsPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public InsetsPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -725,7 +709,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class Int32EnumPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & Int32EnumPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public Int32EnumPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -764,7 +747,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class IntegerPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & IntegerPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public IntegerPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -809,7 +791,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class InterfaceOnlyComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & InterfaceOnlyComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public InterfaceOnlyComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -849,7 +830,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MixedPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MixedPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MixedPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -890,7 +870,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ImageColorPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ImageColorPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ImageColorPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -938,7 +917,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class NoPropsNoEventsComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & NoPropsNoEventsComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public NoPropsNoEventsComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -972,7 +950,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class ObjectPropsManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & ObjectPropsManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public ObjectPropsManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1012,7 +989,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class PointPropNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & PointPropNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public PointPropNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1051,7 +1027,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class StringEnumPropsNativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & StringEnumPropsNativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public StringEnumPropsNativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1090,7 +1065,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class StringPropComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & StringPropComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public StringPropComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1132,7 +1106,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiFile1NativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiFile1NativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiFile1NativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1166,7 +1139,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiFile2NativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiFile2NativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiFile2NativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1205,7 +1177,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiComponent1NativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiComponent1NativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiComponent1NativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
@@ -1239,7 +1210,6 @@ import com.facebook.react.uimanager.BaseViewManager;
|
||||
import com.facebook.react.uimanager.BaseViewManagerDelegate;
|
||||
import com.facebook.react.uimanager.LayoutShadowNode;
|
||||
|
||||
@SuppressWarnings(\\"deprecation\\")
|
||||
public class MultiComponent2NativeComponentManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & MultiComponent2NativeComponentManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
|
||||
public MultiComponent2NativeComponentManagerDelegate(U viewManager) {
|
||||
super(viewManager);
|
||||
|
||||
-186
@@ -1,186 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
|
||||
|
||||
import type {HostInstance} from 'react-native';
|
||||
|
||||
import * as Fantom from '@react-native/fantom';
|
||||
import * as React from 'react';
|
||||
import {createRef} from 'react';
|
||||
import {Pressable} from 'react-native';
|
||||
import {Text} from 'react-native';
|
||||
import ensureInstance from 'react-native/src/private/__tests__/utilities/ensureInstance';
|
||||
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
|
||||
|
||||
describe('<Pressable>', () => {
|
||||
describe('props', () => {
|
||||
describe('style', () => {
|
||||
it('can be set with ViewStyle', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Pressable
|
||||
style={{
|
||||
width: 100,
|
||||
height: 50,
|
||||
backgroundColor: 'blue',
|
||||
borderColor: 'red',
|
||||
borderWidth: 3,
|
||||
opacity: 40,
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-view
|
||||
accessible="true"
|
||||
backgroundColor="rgba(0, 0, 255, 1)"
|
||||
borderWidth="3.000000"
|
||||
height="50.000000"
|
||||
opacity="40"
|
||||
width="100.000000"
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
it('function that receives a boolean reflecting whether the component is currently pressed ', () => {
|
||||
const root = Fantom.createRoot();
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Pressable
|
||||
style={({pressed}) => ({
|
||||
backgroundColor: pressed ? 'red' : 'gray',
|
||||
})}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-view
|
||||
accessible="true"
|
||||
backgroundColor="rgba(128, 128, 128, 1)"
|
||||
/>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('onPress', () => {
|
||||
it('triggers callback when the element is pressed', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
const onPressCallback = jest.fn();
|
||||
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Pressable
|
||||
ref={elementRef}
|
||||
onPress={onPressCallback}
|
||||
style={{height: 100}}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
const element = ensureInstance(elementRef.current, ReactNativeElement);
|
||||
Fantom.dispatchNativeEvent(element, 'click');
|
||||
|
||||
expect(onPressCallback).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe('disabled', () => {
|
||||
it('cannot be pressed', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
|
||||
const root = Fantom.createRoot();
|
||||
const onPressCallback = jest.fn();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Pressable
|
||||
ref={elementRef}
|
||||
onPress={onPressCallback}
|
||||
disabled={true}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
const element = ensureInstance(elementRef.current, ReactNativeElement);
|
||||
Fantom.dispatchNativeEvent(element, 'change', {value: true});
|
||||
|
||||
expect(onPressCallback).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('children', () => {
|
||||
it('adds children to the component', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Pressable ref={elementRef}>
|
||||
<Text>the quick brown fox</Text>
|
||||
</Pressable>,
|
||||
);
|
||||
});
|
||||
const element = ensureInstance(elementRef.current, ReactNativeElement);
|
||||
|
||||
expect(element.childNodes.length).toBe(1);
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-view accessible="true">
|
||||
<rn-paragraph
|
||||
allowFontScaling="true"
|
||||
ellipsizeMode="tail"
|
||||
fontSize="NaN"
|
||||
fontSizeMultiplier="NaN"
|
||||
foregroundColor="rgba(0, 0, 0, 0)">
|
||||
the quick brown fox
|
||||
</rn-paragraph>
|
||||
</rn-view>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('ref', () => {
|
||||
describe('instance', () => {
|
||||
it('is an element node', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Pressable ref={elementRef} />);
|
||||
});
|
||||
|
||||
expect(elementRef.current).toBeInstanceOf(ReactNativeElement);
|
||||
});
|
||||
|
||||
it('uses the "RN:View" tag name', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Pressable ref={elementRef} />);
|
||||
});
|
||||
|
||||
const element = ensureInstance(elementRef.current, ReactNativeElement);
|
||||
// Pressable is implemented with a <View> under the hood
|
||||
expect(element.tagName).toBe('RN:View');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
+18
-197
@@ -17,7 +17,6 @@ import * as React from 'react';
|
||||
import {createRef} from 'react';
|
||||
import {Image} from 'react-native';
|
||||
import ensureInstance from 'react-native/src/private/__tests__/utilities/ensureInstance';
|
||||
import NativeFantom from 'react-native/src/private/testing/fantom/specs/NativeFantom';
|
||||
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
|
||||
|
||||
const LOGO_SOURCE = {uri: 'https://reactnative.dev/img/tiny_logo.png'};
|
||||
@@ -34,12 +33,7 @@ describe('<Image>', () => {
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-image
|
||||
overflow="hidden"
|
||||
source-scale="1"
|
||||
source-type="remote"
|
||||
resizeMode="cover"
|
||||
/>,
|
||||
<rn-image overflow="hidden" source-scale="1" source-type="remote" />,
|
||||
);
|
||||
|
||||
Fantom.runTask(() => {
|
||||
@@ -47,12 +41,7 @@ describe('<Image>', () => {
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-image
|
||||
overflow="hidden"
|
||||
source-scale="1"
|
||||
source-type="remote"
|
||||
resizeMode="cover"
|
||||
/>,
|
||||
<rn-image overflow="hidden" source-scale="1" source-type="remote" />,
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -323,47 +312,35 @@ describe('<Image>', () => {
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['resizeMode']}).toJSX()).toEqual(
|
||||
<rn-image resizeMode="cover" />,
|
||||
<rn-image />,
|
||||
);
|
||||
});
|
||||
|
||||
it('can be set to "cover" explicitly', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Image resizeMode="cover" source={LOGO_SOURCE} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['resizeMode']}).toJSX()).toEqual(
|
||||
<rn-image resizeMode="cover" />,
|
||||
);
|
||||
});
|
||||
|
||||
it('can be set to "stretch", which is the same as not setting it', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Image resizeMode="stretch" source={LOGO_SOURCE} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['resizeMode']}).toJSX()).toEqual(
|
||||
<rn-image />,
|
||||
);
|
||||
});
|
||||
|
||||
(['contain', 'repeat', 'center'] as const).forEach(resizeMode => {
|
||||
it(`can be set to "${resizeMode}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
(['stretch', 'contain', 'repeat', 'center'] as const).forEach(
|
||||
resizeMode => {
|
||||
it(`can be set to "${resizeMode}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Image resizeMode={resizeMode} source={LOGO_SOURCE} />);
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Image resizeMode={resizeMode} source={LOGO_SOURCE} />,
|
||||
);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['resizeMode']}).toJSX(),
|
||||
).toEqual(<rn-image resizeMode={resizeMode} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['resizeMode']}).toJSX(),
|
||||
).toEqual(<rn-image resizeMode={resizeMode} />);
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
describe('source', () => {
|
||||
@@ -676,160 +653,4 @@ describe('<Image>', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('static methods', () => {
|
||||
afterEach(() => {
|
||||
NativeFantom.clearAllImages();
|
||||
});
|
||||
|
||||
describe('getSize', () => {
|
||||
it('returns the size of the image when image is loaded', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
NativeFantom.setImageResponse(uri, {
|
||||
width: 100,
|
||||
height: 100,
|
||||
});
|
||||
|
||||
let size;
|
||||
Fantom.runTask(() => {
|
||||
Image.getSize(uri, (width, height) => {
|
||||
size = {width, height};
|
||||
});
|
||||
});
|
||||
|
||||
expect(size).toEqual({width: 100, height: 100});
|
||||
});
|
||||
|
||||
it('fails when image is not loaded', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
let size;
|
||||
let err: ?Error;
|
||||
Fantom.runTask(async () => {
|
||||
Image.getSize(
|
||||
uri,
|
||||
(width, height) => {
|
||||
size = {width, height};
|
||||
},
|
||||
(e: mixed) => {
|
||||
if (e instanceof Error) {
|
||||
err = e;
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
expect(size).toBeUndefined();
|
||||
expect(err).toBeInstanceOf(Error);
|
||||
expect(err?.message).toBe('image not loaded');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getSizeWithHeaders', () => {
|
||||
afterEach(() => {
|
||||
NativeFantom.clearAllImages();
|
||||
});
|
||||
|
||||
it('returns the size of the image when image is loaded', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
NativeFantom.setImageResponse(uri, {
|
||||
width: 100,
|
||||
height: 100,
|
||||
});
|
||||
|
||||
let size;
|
||||
Fantom.runTask(() => {
|
||||
Image.getSizeWithHeaders(
|
||||
uri,
|
||||
{
|
||||
Authorization: 'Basic RandomString',
|
||||
},
|
||||
(width: number, height: number) => {
|
||||
size = {width, height};
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
expect(size).toEqual({width: 100, height: 100});
|
||||
});
|
||||
});
|
||||
|
||||
describe('prefetch', () => {
|
||||
it('prefetches the image', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
NativeFantom.setImageResponse(uri, {
|
||||
width: 100,
|
||||
height: 100,
|
||||
});
|
||||
|
||||
let result;
|
||||
Fantom.runTask(async () => {
|
||||
result = await Image.prefetch(uri);
|
||||
});
|
||||
|
||||
expect(result).toEqual(true);
|
||||
});
|
||||
|
||||
it('can fail to prefetch image', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
NativeFantom.setImageResponse(uri, {
|
||||
width: 100,
|
||||
height: 100,
|
||||
errorMessage: 'Failed to prefetch image',
|
||||
});
|
||||
|
||||
let result;
|
||||
let error;
|
||||
Fantom.runTask(async () => {
|
||||
try {
|
||||
result = await Image.prefetch(uri);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
});
|
||||
|
||||
expect(result).toEqual(undefined);
|
||||
expect(error).toBeInstanceOf(Error);
|
||||
expect(error?.message).toBe('Failed to prefetch image');
|
||||
});
|
||||
});
|
||||
|
||||
describe('queryCache', () => {
|
||||
it('returns empty when image is not cached', () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
let result;
|
||||
Fantom.runTask(async () => {
|
||||
result = await Image.queryCache([uri]);
|
||||
});
|
||||
|
||||
expect(result).toEqual({});
|
||||
});
|
||||
|
||||
(['disk', 'memory', 'disk/memory'] as const).forEach(cacheStatus => {
|
||||
it(`returns the '${cacheStatus}' record when image is cached`, () => {
|
||||
const uri = 'https://reactnative.dev/img/tiny_logo.png';
|
||||
|
||||
NativeFantom.setImageResponse(uri, {
|
||||
width: 100,
|
||||
height: 100,
|
||||
cacheStatus,
|
||||
});
|
||||
|
||||
let result;
|
||||
Fantom.runTask(async () => {
|
||||
result = await Image.queryCache([uri]);
|
||||
});
|
||||
|
||||
expect(result).toEqual({
|
||||
[uri]: cacheStatus,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,370 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
|
||||
import type {HostInstance} from 'react-native';
|
||||
|
||||
import * as Fantom from '@react-native/fantom';
|
||||
import * as React from 'react';
|
||||
import {createRef} from 'react';
|
||||
import {Modal} from 'react-native';
|
||||
import ensureInstance from 'react-native/src/private/__tests__/utilities/ensureInstance';
|
||||
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
|
||||
|
||||
const DEFAULT_MODAL_CHILD_VIEW = (
|
||||
<rn-view
|
||||
backgroundColor="rgba(255, 255, 255, 1)"
|
||||
flex="1.000000"
|
||||
left="0.000000"
|
||||
top="0.000000"
|
||||
/>
|
||||
);
|
||||
|
||||
describe('<Modal>', () => {
|
||||
describe('props', () => {
|
||||
it('renders a Modal with the default values when no props are passed', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-modalHostView positionType="absolute" visible="true">
|
||||
{DEFAULT_MODAL_CHILD_VIEW}
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
describe('animationType', () => {
|
||||
it('renders a Modal with animationType="none" by default', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal animationType="none" />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['animationType']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
|
||||
(['slide', 'fade'] as const).forEach(animationType => {
|
||||
it(`renders a Modal with animationType="${animationType}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal animationType={animationType} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['animationType']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView animationType={animationType}>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('presentationStyle', () => {
|
||||
it('renders a Modal with presentationStyle="fullScreen" by default', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal presentationStyle="fullScreen" />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['presentationStyle']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
|
||||
(['pageSheet', 'formSheet', 'overFullScreen'] as const).forEach(
|
||||
presentationStyle => {
|
||||
it(`renders a Modal with presentationStyle="${presentationStyle}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal presentationStyle={presentationStyle} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['presentationStyle']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView presentationStyle={presentationStyle}>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
describe('transparent', () => {
|
||||
it('renders a Modal with transparent="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal transparent={true} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({props: ['transparent', 'presentationStyle']})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView
|
||||
transparent="true"
|
||||
presentationStyle="overFullScreen">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
|
||||
it('renders a Modal with transparent="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal transparent={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({props: ['transparent', 'presentationStyle']})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('statusBarTranslucent', () => {
|
||||
it('renders a Modal with statusBarTranslucent="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal statusBarTranslucent={true} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['statusBarTranslucent']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView statusBarTranslucent="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders a Modal with statusBarTranslucent="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal statusBarTranslucent={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['statusBarTranslucent']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('navigationBarTranslucent', () => {
|
||||
it('renders a Modal with navigationBarTranslucent="true" and statusBarTranslucent="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
// navigationBarTranslucent=true with statusBarTranslucent=false is not supported
|
||||
// and it emits a warning.
|
||||
root.render(
|
||||
<Modal
|
||||
navigationBarTranslucent={true}
|
||||
statusBarTranslucent={true}
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({
|
||||
props: ['navigationBarTranslucent', 'statusBarTranslucent'],
|
||||
})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView
|
||||
navigationBarTranslucent="true"
|
||||
statusBarTranslucent="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders a Modal with navigationBarTranslucent="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal navigationBarTranslucent={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root
|
||||
.getRenderedOutput({
|
||||
props: ['navigationBarTranslucent', 'statusBarTranslucent'],
|
||||
})
|
||||
.toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('hardwareAccelerated', () => {
|
||||
it('renders a Modal with hardwareAccelerated="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal hardwareAccelerated={true} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['hardwareAccelerated']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView hardwareAccelerated="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders a Modal with hardwareAccelerated="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal hardwareAccelerated={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['hardwareAccelerated']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('visible', () => {
|
||||
it('renders a Modal with visible="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal visible={true} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toEqual(
|
||||
<rn-modalHostView visible="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders nothing when visible="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal visible={false} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['visible']}).toJSX()).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe('allowSwipeDismissal', () => {
|
||||
it('renders a Modal with allowSwipeDismissal="true"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal allowSwipeDismissal={true} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['allowSwipeDismissal']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView allowSwipeDismissal="true">
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
it('renders a Modal with allowSwipeDismissal="false"', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal allowSwipeDismissal={false} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['allowSwipeDismissal']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('animated', () => {
|
||||
[true, false].forEach(animated => {
|
||||
// The 'animated' prop is deprecated and ignored when the Modal is rendered
|
||||
// Users should use the 'animationType' prop instead.
|
||||
it(`[DEPRECATED] renders a Modal with animated="${animated ? 'true' : 'false'}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal animated={animated} />);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['animated']}).toJSX()).toEqual(
|
||||
<rn-modalHostView>
|
||||
<rn-view />
|
||||
</rn-modalHostView>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
// ... more props
|
||||
});
|
||||
describe('ref', () => {
|
||||
describe('exampleMethod()', () => {
|
||||
// more describe('<context>') or tests with it('<behaviour>')
|
||||
});
|
||||
// ... more methods
|
||||
describe('instance', () => {
|
||||
it('uses the "RN:ModalHostView" tag name', () => {
|
||||
const elementRef = createRef<HostInstance>();
|
||||
const root = Fantom.createRoot();
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Modal ref={elementRef} />);
|
||||
});
|
||||
|
||||
expect(elementRef.current).toBeInstanceOf(ReactNativeElement);
|
||||
const element = ensureInstance(elementRef.current, ReactNativeElement);
|
||||
expect(element.tagName).toBe('RN:ModalHostView');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment';
|
||||
|
||||
import type {Role} from '../../Components/View/ViewAccessibility';
|
||||
import type {HostInstance} from 'react-native';
|
||||
|
||||
import ensureInstance from '../../../src/private/__tests__/utilities/ensureInstance';
|
||||
@@ -22,372 +21,8 @@ import {Text} from 'react-native';
|
||||
import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement';
|
||||
import ReadOnlyText from 'react-native/src/private/webapis/dom/nodes/ReadOnlyText';
|
||||
|
||||
const TEST_TEXT = 'the text';
|
||||
|
||||
describe('<Text>', () => {
|
||||
describe('props', () => {
|
||||
describe('empty props', () => {
|
||||
it('renders an empty element when there are no props', () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput().toJSX()).toEqual(
|
||||
<rn-paragraph
|
||||
allowFontScaling="true"
|
||||
ellipsizeMode="tail"
|
||||
fontSize="NaN"
|
||||
fontSizeMultiplier="NaN"
|
||||
foregroundColor="rgba(0, 0, 0, 0)">
|
||||
{TEST_TEXT}
|
||||
</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('allowFontScaling', () => {
|
||||
([true, false] as const).forEach(propVal => {
|
||||
it(`can be set to "${propVal.toString()}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text allowFontScaling={propVal}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph allowFontScaling={propVal.toString()}>
|
||||
{TEST_TEXT}
|
||||
</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it(`has 'true' as default`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['allowFontScaling']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph allowFontScaling={'true'}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('ellipsizeMode', () => {
|
||||
it(`has 'tail' as default on JS side`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['ellipsizeMode']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph ellipsizeMode="tail">{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`has 'clip' as default on C++ side`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text ellipsizeMode="clip">{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['ellipsizeMode']}).toJSX(),
|
||||
).toEqual(<rn-paragraph>{TEST_TEXT}</rn-paragraph>);
|
||||
});
|
||||
|
||||
(['head', 'middle', 'tail'] as const).forEach(propVal => {
|
||||
it(`can be set to "${propVal}"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text ellipsizeMode={propVal}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['ellipsizeMode']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph ellipsizeMode={propVal}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('id and nativeID', () => {
|
||||
it(`has 'id' propagated correctly`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text id="alpha">{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['nativeID']}).toJSX()).toEqual(
|
||||
<rn-paragraph nativeID={'alpha'}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`has 'nativeID' propagated correctly`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text nativeID="alpha">{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['nativeID']}).toJSX()).toEqual(
|
||||
<rn-paragraph nativeID={'alpha'}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
it(`has a precedence of 'id' over 'nativeID'`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(
|
||||
<Text id="alpha" nativeID="gamma">
|
||||
{TEST_TEXT}
|
||||
</Text>,
|
||||
);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['id', 'nativeID']}).toJSX(),
|
||||
).toEqual(<rn-paragraph nativeID={'alpha'}>{TEST_TEXT}</rn-paragraph>);
|
||||
});
|
||||
});
|
||||
|
||||
describe('maxFontSizeMultiplier', () => {
|
||||
it(`propagates valid numbers correctly`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
[-1, 0, 1, 3, 1000].forEach(val => {
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text maxFontSizeMultiplier={val}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['maxFontSizeMultiplier']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph maxFontSizeMultiplier={val.toString()}>
|
||||
{TEST_TEXT}
|
||||
</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('numberOfLines', () => {
|
||||
let originalConsoleError = null;
|
||||
|
||||
afterEach(() => {
|
||||
if (originalConsoleError != null) {
|
||||
// $FlowExpectedError[cannot-write]
|
||||
console.error = originalConsoleError;
|
||||
originalConsoleError = null;
|
||||
}
|
||||
});
|
||||
|
||||
it(`doesn't allow negative numbers`, () => {
|
||||
originalConsoleError = console.error;
|
||||
// $FlowExpectedError[cannot-write]
|
||||
console.error = jest.fn();
|
||||
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text numberOfLines={-1}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
// NB. "numberOfLines" is mapped to "maximumNumberOfLines" in C++
|
||||
root.getRenderedOutput({props: ['maximumNumberOfLines']}).toJSX(),
|
||||
).toEqual(<rn-paragraph>{TEST_TEXT}</rn-paragraph>);
|
||||
});
|
||||
|
||||
it(`has 0 as defult`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text numberOfLines={0}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['maximumNumberOfLines']}).toJSX(),
|
||||
).toEqual(<rn-paragraph>{TEST_TEXT}</rn-paragraph>);
|
||||
});
|
||||
|
||||
it(`propagates valid numbers correctly`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
[3, 1000].forEach(val => {
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text numberOfLines={val}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(
|
||||
root.getRenderedOutput({props: ['maximumNumberOfLines']}).toJSX(),
|
||||
).toEqual(
|
||||
<rn-paragraph maximumNumberOfLines={val.toString()}>
|
||||
{TEST_TEXT}
|
||||
</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('role', () => {
|
||||
it(`has none by default`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['role']}).toJSX()).toEqual(
|
||||
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`maps invalid values to 'none'`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
// $FlowExpectedError[incompatible-type]
|
||||
root.render(<Text role="__some_invalid_value">{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['role']}).toJSX()).toEqual(
|
||||
<rn-paragraph role="none">{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`propagates correctly all possible values`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
(
|
||||
[
|
||||
'alert',
|
||||
'alertdialog',
|
||||
'application',
|
||||
'article',
|
||||
'banner',
|
||||
'button',
|
||||
'cell',
|
||||
'checkbox',
|
||||
'columnheader',
|
||||
'combobox',
|
||||
'complementary',
|
||||
'contentinfo',
|
||||
'definition',
|
||||
'dialog',
|
||||
'directory',
|
||||
'document',
|
||||
'feed',
|
||||
'figure',
|
||||
'form',
|
||||
'grid',
|
||||
'group',
|
||||
'heading',
|
||||
'img',
|
||||
'link',
|
||||
'list',
|
||||
'listitem',
|
||||
'log',
|
||||
'main',
|
||||
'marquee',
|
||||
'math',
|
||||
'menu',
|
||||
'menubar',
|
||||
'menuitem',
|
||||
'meter',
|
||||
'navigation',
|
||||
'none',
|
||||
'note',
|
||||
'option',
|
||||
'presentation',
|
||||
'progressbar',
|
||||
'radio',
|
||||
'radiogroup',
|
||||
'region',
|
||||
'row',
|
||||
'rowgroup',
|
||||
'rowheader',
|
||||
'scrollbar',
|
||||
'searchbox',
|
||||
'separator',
|
||||
'slider',
|
||||
'spinbutton',
|
||||
'status',
|
||||
'summary',
|
||||
'switch',
|
||||
'tab',
|
||||
'table',
|
||||
'tablist',
|
||||
'tabpanel',
|
||||
'term',
|
||||
'timer',
|
||||
'toolbar',
|
||||
'tooltip',
|
||||
'tree',
|
||||
'treegrid',
|
||||
'treeitem',
|
||||
'treeitem',
|
||||
] as Array<Role>
|
||||
).forEach(propVal => {
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text role={propVal}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['role']}).toJSX()).toEqual(
|
||||
<rn-paragraph role={propVal}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('selectable', () => {
|
||||
it(`can be set to "true"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text selectable={true}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph selectable={'true'}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`has 'false' as default`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text selectable={false}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('style', () => {
|
||||
describe('writingDirection', () => {
|
||||
it('propagates to mounting layer', () => {
|
||||
|
||||
+1
-4
@@ -13,8 +13,6 @@
|
||||
#import <React/RCTScrollableProtocol.h>
|
||||
#import <React/RCTViewComponentView.h>
|
||||
|
||||
#import "RCTVirtualViewContainerProtocol.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/*
|
||||
@@ -25,8 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
* keyboard-avoiding functionality and so on. All that complexity must be implemented inside those components in order
|
||||
* to keep the complexity of this component manageable.
|
||||
*/
|
||||
@interface RCTScrollViewComponentView
|
||||
: RCTViewComponentView <RCTMountingTransactionObserving, RCTVirtualViewContainerProtocol>
|
||||
@interface RCTScrollViewComponentView : RCTViewComponentView <RCTMountingTransactionObserving>
|
||||
|
||||
/*
|
||||
* Finds and returns the closet RCTScrollViewComponentView component to the given view
|
||||
|
||||
-14
@@ -24,7 +24,6 @@
|
||||
#import "RCTCustomPullToRefreshViewProtocol.h"
|
||||
#import "RCTEnhancedScrollView.h"
|
||||
#import "RCTFabricComponentsPlugins.h"
|
||||
#import "RCTVirtualViewContainerState.h"
|
||||
|
||||
using namespace facebook::react;
|
||||
|
||||
@@ -118,8 +117,6 @@ RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrollView, NSInt
|
||||
// It is not restored to the default value in prepareForRecycle.
|
||||
// Once an accessibility API is used, view culling will be disabled for the entire session.
|
||||
BOOL _isAccessibilityAPIUsed;
|
||||
|
||||
RCTVirtualViewContainerState *_virtualViewContainerState;
|
||||
}
|
||||
|
||||
+ (RCTScrollViewComponentView *_Nullable)findScrollViewComponentViewForView:(UIView *)view
|
||||
@@ -681,7 +678,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
||||
_contentView = nil;
|
||||
_prevFirstVisibleFrame = CGRectZero;
|
||||
_firstVisibleView = nil;
|
||||
_virtualViewContainerState = nil;
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate
|
||||
@@ -1094,16 +1090,6 @@ static inline UIViewAnimationOptions animationOptionsWithCurve(UIViewAnimationCu
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - RCTVirtualViewContainerProtocol
|
||||
|
||||
- (RCTVirtualViewContainerState *)virtualViewContainerState
|
||||
{
|
||||
if (!_virtualViewContainerState) {
|
||||
_virtualViewContainerState = [[RCTVirtualViewContainerState alloc] initWithScrollView:self];
|
||||
}
|
||||
return _virtualViewContainerState;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Class<RCTComponentViewProtocol> RCTScrollViewCls(void)
|
||||
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@class RCTVirtualViewContainerState;
|
||||
|
||||
@protocol RCTVirtualViewContainerProtocol
|
||||
|
||||
- (RCTVirtualViewContainerState *)virtualViewContainerState;
|
||||
|
||||
@end
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCTVirtualViewProtocol.h"
|
||||
|
||||
@class RCTScrollViewComponentView;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface RCTVirtualViewContainerState : NSObject
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (instancetype)new NS_UNAVAILABLE;
|
||||
- (instancetype)initWithScrollView:(RCTScrollViewComponentView *)scrollView NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
- (void)onChange:(id<RCTVirtualViewProtocol>)virtualView;
|
||||
- (void)remove:(id<RCTVirtualViewProtocol>)virtualView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
-193
@@ -1,193 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <React/RCTLog.h>
|
||||
#import <React/RCTScrollViewComponentView.h>
|
||||
#import <React/RCTVirtualViewMode.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
|
||||
#import "RCTVirtualViewContainerState.h"
|
||||
|
||||
using namespace facebook;
|
||||
using namespace facebook::react;
|
||||
|
||||
#if RCT_DEBUG
|
||||
static void debugLog(NSString *msg, ...)
|
||||
{
|
||||
auto debugEnabled = ReactNativeFeatureFlags::enableVirtualViewDebugFeatures();
|
||||
if (!debugEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
va_list args;
|
||||
va_start(args, msg);
|
||||
NSString *msgString = [[NSString alloc] initWithFormat:msg arguments:args];
|
||||
RCTLogInfo(@"%@", msgString);
|
||||
va_end(args); // Don't forget to call va_end to clean up
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Checks whether one CGRect overlaps with another CGRect.
|
||||
*
|
||||
* This is different from CGRectIntersectsRect because a CGRect representing
|
||||
* a line or a point is considered to overlap with another CGRect if the line
|
||||
* or point is within the rect bounds. However, two CGRects are not considered
|
||||
* to overlap if they only share a boundary.
|
||||
*/
|
||||
static BOOL CGRectOverlaps(CGRect rect1, CGRect rect2)
|
||||
{
|
||||
CGFloat minY1 = CGRectGetMinY(rect1);
|
||||
CGFloat maxY1 = CGRectGetMaxY(rect1);
|
||||
CGFloat minY2 = CGRectGetMinY(rect2);
|
||||
CGFloat maxY2 = CGRectGetMaxY(rect2);
|
||||
if (minY1 >= maxY2 || minY2 >= maxY1) {
|
||||
// No overlap on the y-axis.
|
||||
return NO;
|
||||
}
|
||||
CGFloat minX1 = CGRectGetMinX(rect1);
|
||||
CGFloat maxX1 = CGRectGetMaxX(rect1);
|
||||
CGFloat minX2 = CGRectGetMinX(rect2);
|
||||
CGFloat maxX2 = CGRectGetMaxX(rect2);
|
||||
if (minX1 >= maxX2 || minX2 >= maxX1) {
|
||||
// No overlap on the x-axis.
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@interface RCTVirtualViewContainerState () <UIScrollViewDelegate>
|
||||
@end
|
||||
|
||||
@interface RCTVirtualViewContainerState () {
|
||||
NSMutableSet<id<RCTVirtualViewProtocol>> *_virtualViews;
|
||||
CGRect _emptyRect;
|
||||
CGRect _prerenderRect;
|
||||
__weak RCTScrollViewComponentView *_scrollViewComponentView;
|
||||
CGFloat _prerenderRatio;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation RCTVirtualViewContainerState
|
||||
|
||||
- (instancetype)initWithScrollView:(RCTScrollViewComponentView *)scrollView
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_virtualViews = [NSMutableSet set];
|
||||
_emptyRect = CGRectZero;
|
||||
_prerenderRect = CGRectZero;
|
||||
_scrollViewComponentView = scrollView;
|
||||
_prerenderRatio = ReactNativeFeatureFlags::virtualViewPrerenderRatio();
|
||||
[_scrollViewComponentView addScrollListener:self];
|
||||
|
||||
#if RCT_DEBUG
|
||||
debugLog(@"initWithScrollView");
|
||||
#endif
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
#if RCT_DEBUG
|
||||
debugLog(@"dealloc");
|
||||
#endif
|
||||
if (_scrollViewComponentView != nil) {
|
||||
[_scrollViewComponentView removeScrollListener:self];
|
||||
_scrollViewComponentView = nil;
|
||||
}
|
||||
[_virtualViews removeAllObjects];
|
||||
}
|
||||
|
||||
#pragma mark - Public API
|
||||
|
||||
- (void)onChange:(id<RCTVirtualViewProtocol>)virtualView
|
||||
{
|
||||
if (![_virtualViews containsObject:virtualView]) {
|
||||
[_virtualViews addObject:virtualView];
|
||||
#if RCT_DEBUG
|
||||
debugLog(@"Add virtualViewID=%@", virtualView.virtualViewID);
|
||||
#endif
|
||||
|
||||
} else {
|
||||
#if RCT_DEBUG
|
||||
debugLog(@"Update virtualViewID=%@", virtualView.virtualViewID);
|
||||
#endif
|
||||
}
|
||||
[self _updateModes:virtualView];
|
||||
}
|
||||
|
||||
- (void)remove:(id<RCTVirtualViewProtocol>)virtualView
|
||||
{
|
||||
if (![_virtualViews containsObject:virtualView]) {
|
||||
RCTLogError(@"Attempting to remove non-existent VirtualView: %@", virtualView.virtualViewID);
|
||||
}
|
||||
|
||||
[_virtualViews removeObject:virtualView];
|
||||
|
||||
#if RCT_DEBUG
|
||||
debugLog(@"Remove virtualViewID=%@", virtualView.virtualViewID);
|
||||
#endif
|
||||
}
|
||||
|
||||
#pragma mark - Private Helpers
|
||||
|
||||
- (void)_updateModes:(id<RCTVirtualViewProtocol>)virtualView
|
||||
{
|
||||
auto scrollView = _scrollViewComponentView.scrollView;
|
||||
CGRect visibleRect = CGRectMake(
|
||||
scrollView.contentOffset.x,
|
||||
scrollView.contentOffset.y,
|
||||
scrollView.frame.size.width,
|
||||
scrollView.frame.size.height);
|
||||
|
||||
_prerenderRect = visibleRect;
|
||||
_prerenderRect = CGRectInset(
|
||||
_prerenderRect, -_prerenderRect.size.width * _prerenderRatio, -_prerenderRect.size.height * _prerenderRatio);
|
||||
|
||||
NSArray<id<RCTVirtualViewProtocol>> *virtualViewsIt =
|
||||
(virtualView != nullptr) ? @[ virtualView ] : [_virtualViews allObjects];
|
||||
|
||||
for (id<RCTVirtualViewProtocol> vv = nullptr in virtualViewsIt) {
|
||||
CGRect rect = [vv containerRelativeRect:scrollView];
|
||||
|
||||
RCTVirtualViewMode mode = RCTVirtualViewModeHidden;
|
||||
CGRect thresholdRect = _emptyRect;
|
||||
|
||||
if (CGRectIsEmpty(rect)) {
|
||||
mode = RCTVirtualViewModeHidden;
|
||||
thresholdRect = _emptyRect;
|
||||
} else if (CGRectOverlaps(rect, visibleRect)) {
|
||||
thresholdRect = visibleRect;
|
||||
mode = RCTVirtualViewModeVisible;
|
||||
} else if (CGRectOverlaps(rect, _prerenderRect)) {
|
||||
mode = RCTVirtualViewModePrerender;
|
||||
thresholdRect = _prerenderRect;
|
||||
}
|
||||
|
||||
#if RCT_DEBUG
|
||||
debugLog(
|
||||
@"UpdateModes virtualView=%@ mode=%ld rect=%@ thresholdRect=%@",
|
||||
vv.virtualViewID,
|
||||
(long)mode,
|
||||
NSStringFromCGRect(rect),
|
||||
NSStringFromCGRect(thresholdRect));
|
||||
#endif
|
||||
[vv onModeChange:mode targetRect:rect thresholdRect:thresholdRect];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UIScrollViewDelegate
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
{
|
||||
[self _updateModes:nil];
|
||||
}
|
||||
@end
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import <React/RCTVirtualViewMode.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol RCTVirtualViewProtocol <NSObject>
|
||||
|
||||
- (NSString *)virtualViewID;
|
||||
- (CGRect)containerRelativeRect:(UIView *)view;
|
||||
- (void)onModeChange:(RCTVirtualViewMode)newMode targetRect:(CGRect)targetRect thresholdRect:(CGRect)thresholdRect;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+1
-1
@@ -571,7 +571,7 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
||||
_backgroundColorLayer.frame = CGRectMake(0, 0, self.layer.bounds.size.width, self.layer.bounds.size.height);
|
||||
}
|
||||
|
||||
if ((_props->transformOrigin.isSet() || !_props->transform.operations.empty()) &&
|
||||
if ((_props->transformOrigin.isSet() || _props->transform.operations.size() > 0) &&
|
||||
layoutMetrics.frame.size != oldLayoutMetrics.frame.size) {
|
||||
auto newTransform = _props->resolveTransform(layoutMetrics);
|
||||
self.layer.transform = RCTCATransform3DFromTransformMatrix(newTransform);
|
||||
|
||||
+1
-2
@@ -8,11 +8,10 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import <React/RCTViewComponentView.h>
|
||||
#import <React/RCTVirtualViewProtocol.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RCTVirtualViewExperimentalComponentView : RCTViewComponentView <RCTVirtualViewProtocol>
|
||||
@interface RCTVirtualViewExperimentalComponentView : RCTViewComponentView
|
||||
|
||||
+ (instancetype)new NS_UNAVAILABLE;
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
+127
-76
@@ -11,8 +11,6 @@
|
||||
#import <React/RCTConversions.h>
|
||||
#import <React/RCTScrollViewComponentView.h>
|
||||
#import <React/RCTScrollableProtocol.h>
|
||||
#import <React/RCTVirtualViewContainerProtocol.h>
|
||||
#import <React/RCTVirtualViewContainerState.h>
|
||||
#import <React/UIView+React.h>
|
||||
#import <jsi/jsi.h>
|
||||
|
||||
@@ -30,30 +28,50 @@
|
||||
using namespace facebook;
|
||||
using namespace facebook::react;
|
||||
|
||||
@interface RCTVirtualViewExperimentalComponentView () {
|
||||
NSString *_virtualViewID;
|
||||
/**
|
||||
* Checks whether one CGRect overlaps with another CGRect.
|
||||
*
|
||||
* This is different from CGRectIntersectsRect because a CGRect representing
|
||||
* a line or a point is considered to overlap with another CGRect if the line
|
||||
* or point is within the rect bounds. However, two CGRects are not considered
|
||||
* to overlap if they only share a boundary.
|
||||
*/
|
||||
static BOOL CGRectOverlaps(CGRect rect1, CGRect rect2)
|
||||
{
|
||||
CGFloat minY1 = CGRectGetMinY(rect1);
|
||||
CGFloat maxY1 = CGRectGetMaxY(rect1);
|
||||
CGFloat minY2 = CGRectGetMinY(rect2);
|
||||
CGFloat maxY2 = CGRectGetMaxY(rect2);
|
||||
if (minY1 >= maxY2 || minY2 >= maxY1) {
|
||||
// No overlap on the y-axis.
|
||||
return NO;
|
||||
}
|
||||
CGFloat minX1 = CGRectGetMinX(rect1);
|
||||
CGFloat maxX1 = CGRectGetMaxX(rect1);
|
||||
CGFloat minX2 = CGRectGetMinX(rect2);
|
||||
CGFloat maxX2 = CGRectGetMaxX(rect2);
|
||||
if (minX1 >= maxX2 || minX2 >= maxX1) {
|
||||
// No overlap on the x-axis.
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
@interface RCTVirtualViewExperimentalComponentView () <UIScrollViewDelegate>
|
||||
@end
|
||||
|
||||
@implementation RCTVirtualViewExperimentalComponentView {
|
||||
id<RCTVirtualViewContainerProtocol> _parentVirtualViewContainer;
|
||||
RCTScrollViewComponentView *_lastParentScrollViewComponentView;
|
||||
std::optional<RCTVirtualViewMode> _mode;
|
||||
RCTVirtualViewRenderState _renderState;
|
||||
std::optional<CGRect> _targetRect;
|
||||
NSString *_nativeId;
|
||||
BOOL _didLayout;
|
||||
}
|
||||
|
||||
#pragma mark - Public API
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
if ((self = [super initWithFrame:frame]) != nil) {
|
||||
_props = VirtualViewExperimentalShadowNode::defaultSharedProps();
|
||||
_renderState = RCTVirtualViewRenderStateUnknown;
|
||||
_virtualViewID = [[NSUUID UUID] UUIDString];
|
||||
_didLayout = NO;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -85,13 +103,21 @@ using namespace facebook::react;
|
||||
}
|
||||
}
|
||||
|
||||
const auto &newBaseViewProps = static_cast<const ViewProps &>(*props);
|
||||
const auto nativeId = RCTNSStringFromStringNilIfEmpty(newBaseViewProps.nativeId);
|
||||
_virtualViewID = nativeId == nil ? _virtualViewID : nativeId;
|
||||
|
||||
[super updateProps:props oldProps:oldProps];
|
||||
}
|
||||
|
||||
- (RCTScrollViewComponentView *)getParentScrollViewComponentView
|
||||
{
|
||||
UIView *view = self.superview;
|
||||
while (view != nil) {
|
||||
if ([view isKindOfClass:[RCTScrollViewComponentView class]]) {
|
||||
return (RCTScrollViewComponentView *)view;
|
||||
}
|
||||
view = view.superview;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static flag that tracks whether accessibility services are being used.
|
||||
* When accessibility is detected, virtual views will remain visible even when
|
||||
@@ -100,6 +126,18 @@ using namespace facebook::react;
|
||||
*/
|
||||
static BOOL sIsAccessibilityUsed = NO;
|
||||
|
||||
- (void)_unhideIfNeeded
|
||||
{
|
||||
if (!sIsAccessibilityUsed) {
|
||||
// accessibility is detected for the first time. Make views visible.
|
||||
sIsAccessibilityUsed = YES;
|
||||
}
|
||||
|
||||
if (self.hidden) {
|
||||
self.hidden = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)accessibilityElementCount
|
||||
{
|
||||
// From empirical testing, method `accessibilityElementCount` is called lazily only
|
||||
@@ -116,23 +154,19 @@ static BOOL sIsAccessibilityUsed = NO;
|
||||
return [super focusItemsInRect:rect];
|
||||
}
|
||||
|
||||
- (NSString *)virtualViewID
|
||||
{
|
||||
// Return a unique identifier for this virtual view
|
||||
// Using the tag as a unique identifier since it's already unique per view
|
||||
return _virtualViewID;
|
||||
}
|
||||
|
||||
- (void)prepareForRecycle
|
||||
{
|
||||
[super prepareForRecycle];
|
||||
|
||||
[[_parentVirtualViewContainer virtualViewContainerState] remove:self];
|
||||
// No need to remove the scroll listener here since the view is always removed from window before being recycled and
|
||||
// we do that in didMoveToWindow, which gets called when the view is removed from window.
|
||||
RCTAssert(
|
||||
_lastParentScrollViewComponentView == nil,
|
||||
@"_lastParentScrollViewComponentView should already have been cleared in didMoveToWindow.");
|
||||
|
||||
self.hidden = NO;
|
||||
_didLayout = NO;
|
||||
_mode.reset();
|
||||
_targetRect.reset();
|
||||
_parentVirtualViewContainer = nil;
|
||||
}
|
||||
|
||||
// Handles case when sibling changes size.
|
||||
@@ -142,41 +176,84 @@ static BOOL sIsAccessibilityUsed = NO;
|
||||
oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics
|
||||
{
|
||||
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:_layoutMetrics];
|
||||
_didLayout = YES;
|
||||
[self updateState];
|
||||
}
|
||||
|
||||
- (void)updateState
|
||||
{
|
||||
[[_parentVirtualViewContainer virtualViewContainerState] onChange:self];
|
||||
[self dispatchOnModeChangeIfNeeded:YES];
|
||||
}
|
||||
|
||||
- (void)didMoveToWindow
|
||||
{
|
||||
[super didMoveToWindow];
|
||||
// here we will set the pointer to the virtualView container
|
||||
// and if there was a layout, update
|
||||
|
||||
_parentVirtualViewContainer = [self _getParentVirtualViewContainer];
|
||||
if (_parentVirtualViewContainer != nil && self.window != nil && _didLayout) {
|
||||
[self updateState];
|
||||
if (_lastParentScrollViewComponentView != nil) {
|
||||
[_lastParentScrollViewComponentView removeScrollListener:self];
|
||||
_lastParentScrollViewComponentView = nil;
|
||||
}
|
||||
|
||||
if (RCTScrollViewComponentView *parentScrollViewComponentView = [self getParentScrollViewComponentView]) {
|
||||
if (self.window != nil) {
|
||||
// TODO(T202601695): We also want the ScrollView to emit layout changes from didLayoutSubviews so that any event
|
||||
// that may affect visibily of this view notifies the listeners.
|
||||
[parentScrollViewComponentView addScrollListener:self];
|
||||
_lastParentScrollViewComponentView = parentScrollViewComponentView;
|
||||
|
||||
// We want to dispatch the event immediately when the view is added to the window before any scrolling occurs.
|
||||
[self dispatchOnModeChangeIfNeeded:NO];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (CGRect)containerRelativeRect:(UIView *)scrollView
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
|
||||
{
|
||||
// Return the view's position relative to its container (the scroll view)
|
||||
return [self convertRect:self.bounds toView:scrollView];
|
||||
[self dispatchOnModeChangeIfNeeded:NO];
|
||||
}
|
||||
|
||||
- (void)onModeChange:(RCTVirtualViewMode)newMode targetRect:(CGRect)targetRect thresholdRect:(CGRect)thresholdRect
|
||||
- (void)dispatchOnModeChangeIfNeeded:(BOOL)checkForTargetRectChange
|
||||
{
|
||||
if (_lastParentScrollViewComponentView == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
UIScrollView *scrollView = _lastParentScrollViewComponentView.scrollView;
|
||||
CGRect targetRect = [self convertRect:self.bounds toView:scrollView];
|
||||
|
||||
// While scrolling, the `targetRect` does not change, so we don't check for changed `targetRect` in that case.
|
||||
if (checkForTargetRectChange) {
|
||||
if (_targetRect.has_value() && CGRectEqualToRect(targetRect, _targetRect.value())) {
|
||||
return;
|
||||
}
|
||||
_targetRect = targetRect;
|
||||
}
|
||||
|
||||
RCTVirtualViewMode newMode;
|
||||
CGRect thresholdRect = CGRectMake(
|
||||
scrollView.contentOffset.x,
|
||||
scrollView.contentOffset.y,
|
||||
scrollView.frame.size.width,
|
||||
scrollView.frame.size.height);
|
||||
if (CGRectOverlaps(targetRect, thresholdRect)) {
|
||||
newMode = RCTVirtualViewModeVisible;
|
||||
} else {
|
||||
auto prerender = false;
|
||||
const CGFloat prerenderRatio = ReactNativeFeatureFlags::virtualViewPrerenderRatio();
|
||||
if (prerenderRatio > 0) {
|
||||
thresholdRect = CGRectInset(
|
||||
thresholdRect, -thresholdRect.size.width * prerenderRatio, -thresholdRect.size.height * prerenderRatio);
|
||||
prerender = CGRectOverlaps(targetRect, thresholdRect);
|
||||
}
|
||||
if (prerender) {
|
||||
newMode = RCTVirtualViewModePrerender;
|
||||
} else {
|
||||
newMode = RCTVirtualViewModeHidden;
|
||||
thresholdRect = CGRectZero;
|
||||
}
|
||||
}
|
||||
|
||||
if (_mode.has_value() && newMode == _mode.value()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE: Make sure to keep these props in sync with dispatchSyncModeChange below where we have to explicitly copy
|
||||
// all props.
|
||||
// NOTE: Make sure to keep these props in sync with dispatchSyncModeChange below where we have to explicitly copy all
|
||||
// props.
|
||||
VirtualViewEventEmitter::OnModeChange event = {
|
||||
.mode = (int)newMode,
|
||||
.targetRect =
|
||||
@@ -198,24 +275,24 @@ static BOOL sIsAccessibilityUsed = NO;
|
||||
case RCTVirtualViewModeVisible:
|
||||
if (_renderState == RCTVirtualViewRenderStateUnknown) {
|
||||
// Feature flag is disabled, so use the former logic.
|
||||
[self _dispatchSyncModeChange:event];
|
||||
[self dispatchSyncModeChange:event];
|
||||
} else {
|
||||
// If the previous mode was prerender and the result of dispatching that event was committed, we do not need
|
||||
// to dispatch an event for visible.
|
||||
// If the previous mode was prerender and the result of dispatching that event was committed, we do not need to
|
||||
// dispatch an event for visible.
|
||||
const auto wasPrerenderCommitted = oldMode.has_value() && oldMode == RCTVirtualViewModePrerender &&
|
||||
_renderState == RCTVirtualViewRenderStateRendered;
|
||||
if (!wasPrerenderCommitted) {
|
||||
[self _dispatchSyncModeChange:event];
|
||||
[self dispatchSyncModeChange:event];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RCTVirtualViewModePrerender:
|
||||
if (!oldMode.has_value() || oldMode != RCTVirtualViewModeVisible) {
|
||||
[self _dispatchAsyncModeChange:event];
|
||||
[self dispatchAsyncModeChange:event];
|
||||
}
|
||||
break;
|
||||
case RCTVirtualViewModeHidden:
|
||||
[self _dispatchAsyncModeChange:event];
|
||||
[self dispatchAsyncModeChange:event];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -234,33 +311,7 @@ static BOOL sIsAccessibilityUsed = NO;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Private API
|
||||
|
||||
- (void)_unhideIfNeeded
|
||||
{
|
||||
if (!sIsAccessibilityUsed) {
|
||||
// accessibility is detected for the first time. Make views visible.
|
||||
sIsAccessibilityUsed = YES;
|
||||
}
|
||||
|
||||
if (self.hidden) {
|
||||
self.hidden = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (id<RCTVirtualViewContainerProtocol>)_getParentVirtualViewContainer
|
||||
{
|
||||
UIView *view = self.superview;
|
||||
while (view != nil) {
|
||||
if ([view respondsToSelector:@selector(virtualViewContainerState)]) {
|
||||
return (id<RCTVirtualViewContainerProtocol>)view;
|
||||
}
|
||||
view = view.superview;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)_dispatchAsyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event
|
||||
- (void)dispatchAsyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event
|
||||
{
|
||||
if (!_eventEmitter) {
|
||||
return;
|
||||
@@ -271,7 +322,7 @@ static BOOL sIsAccessibilityUsed = NO;
|
||||
emitter->onModeChange(event);
|
||||
}
|
||||
|
||||
- (void)_dispatchSyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event
|
||||
- (void)dispatchSyncModeChange:(VirtualViewEventEmitter::OnModeChange &)event
|
||||
{
|
||||
if (!_eventEmitter) {
|
||||
return;
|
||||
|
||||
@@ -3348,8 +3348,10 @@ public final class com/facebook/react/uimanager/DisplayMetricsHolder {
|
||||
public static final fun getDisplayMetricsWritableMap (D)Lcom/facebook/react/bridge/WritableMap;
|
||||
public static final fun getScreenDisplayMetrics ()Landroid/util/DisplayMetrics;
|
||||
public static final fun getWindowDisplayMetrics ()Landroid/util/DisplayMetrics;
|
||||
public static final fun initDisplayMetrics (Landroid/content/Context;)V
|
||||
public static final fun initDisplayMetricsIfNotInitialized (Landroid/content/Context;)V
|
||||
public static final fun initScreenDisplayMetrics (Landroid/content/Context;)V
|
||||
public static final fun initScreenDisplayMetricsIfNotInitialized (Landroid/content/Context;)V
|
||||
public static final fun initWindowDisplayMetrics (Landroid/content/Context;)V
|
||||
public static final fun initWindowDisplayMetricsIfNotInitialized (Landroid/content/Context;)V
|
||||
public static final fun setScreenDisplayMetrics (Landroid/util/DisplayMetrics;)V
|
||||
public static final fun setWindowDisplayMetrics (Landroid/util/DisplayMetrics;)V
|
||||
}
|
||||
@@ -6012,7 +6014,6 @@ public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
|
||||
}
|
||||
|
||||
public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : com/facebook/react/uimanager/LayoutShadowNode {
|
||||
public static final field Companion Lcom/facebook/react/views/text/ReactBaseTextShadowNode$Companion;
|
||||
public static final field DEFAULT_TEXT_SHADOW_COLOR I
|
||||
public static final field PROP_SHADOW_COLOR Ljava/lang/String;
|
||||
public static final field PROP_SHADOW_OFFSET Ljava/lang/String;
|
||||
@@ -6020,86 +6021,61 @@ public abstract class com/facebook/react/views/text/ReactBaseTextShadowNode : co
|
||||
public static final field PROP_SHADOW_OFFSET_WIDTH Ljava/lang/String;
|
||||
public static final field PROP_SHADOW_RADIUS Ljava/lang/String;
|
||||
public static final field PROP_TEXT_TRANSFORM Ljava/lang/String;
|
||||
protected field mAccessibilityRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
||||
protected field mAdjustsFontSizeToFit Z
|
||||
protected field mBackgroundColor I
|
||||
protected field mColor I
|
||||
protected field mContainsImages Z
|
||||
protected field mFontFamily Ljava/lang/String;
|
||||
protected field mFontFeatureSettings Ljava/lang/String;
|
||||
protected field mFontStyle I
|
||||
protected field mFontWeight I
|
||||
protected field mHyphenationFrequency I
|
||||
protected field mIncludeFontPadding Z
|
||||
protected field mInlineViews Ljava/util/Map;
|
||||
protected field mIsBackgroundColorSet Z
|
||||
protected field mIsColorSet Z
|
||||
protected field mIsLineThroughTextDecorationSet Z
|
||||
protected field mIsUnderlineTextDecorationSet Z
|
||||
protected field mJustificationMode I
|
||||
protected field mMinimumFontScale F
|
||||
protected field mNumberOfLines I
|
||||
protected field mReactTextViewManagerCallback Lcom/facebook/react/views/text/ReactTextViewManagerCallback;
|
||||
protected field mRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
||||
protected field mTextAlign I
|
||||
protected field mTextAttributes Lcom/facebook/react/views/text/TextAttributes;
|
||||
protected field mTextBreakStrategy I
|
||||
protected field mTextShadowColor I
|
||||
protected field mTextShadowOffsetDx F
|
||||
protected field mTextShadowOffsetDy F
|
||||
protected field mTextShadowRadius F
|
||||
public fun <init> ()V
|
||||
public fun <init> (Lcom/facebook/react/views/text/ReactTextViewManagerCallback;)V
|
||||
public synthetic fun <init> (Lcom/facebook/react/views/text/ReactTextViewManagerCallback;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
protected final fun getAccessibilityRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
||||
protected final fun getAdjustsFontSizeToFit ()Z
|
||||
protected final fun getBackgroundColor ()I
|
||||
protected final fun getColor ()I
|
||||
protected final fun getContainsImages ()Z
|
||||
protected final fun getFontFamily ()Ljava/lang/String;
|
||||
protected final fun getFontFeatureSettings ()Ljava/lang/String;
|
||||
protected final fun getFontStyle ()I
|
||||
protected final fun getFontWeight ()I
|
||||
protected final fun getHyphenationFrequency ()I
|
||||
protected final fun getIncludeFontPadding ()Z
|
||||
protected final fun getInlineViews ()Ljava/util/Map;
|
||||
protected final fun getJustificationMode ()I
|
||||
protected final fun getMinimumFontScale ()F
|
||||
protected final fun getNumberOfLines ()I
|
||||
protected final fun getReactTextViewManagerCallback ()Lcom/facebook/react/views/text/ReactTextViewManagerCallback;
|
||||
protected final fun getRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
||||
protected final fun getTextAlign ()I
|
||||
protected final fun getTextAttributes ()Lcom/facebook/react/views/text/TextAttributes;
|
||||
protected final fun getTextBreakStrategy ()I
|
||||
protected final fun getTextShadowColor ()I
|
||||
protected final fun getTextShadowOffsetDx ()F
|
||||
protected final fun getTextShadowOffsetDy ()F
|
||||
protected final fun getTextShadowRadius ()F
|
||||
protected final fun isBackgroundColorSet ()Z
|
||||
protected final fun isColorSet ()Z
|
||||
protected final fun isLineThroughTextDecorationSet ()Z
|
||||
protected final fun isUnderlineTextDecorationSet ()Z
|
||||
protected final fun setAccessibilityRole (Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;)V
|
||||
public final fun setAccessibilityRole (Ljava/lang/String;)V
|
||||
public final fun setAdjustFontSizeToFit (Z)V
|
||||
protected final fun setAdjustsFontSizeToFit (Z)V
|
||||
public final fun setAllowFontScaling (Z)V
|
||||
protected final fun setBackgroundColor (I)V
|
||||
public final fun setBackgroundColor (Ljava/lang/Integer;)V
|
||||
protected final fun setBackgroundColorSet (Z)V
|
||||
protected final fun setColor (I)V
|
||||
public final fun setColor (Ljava/lang/Integer;)V
|
||||
protected final fun setColorSet (Z)V
|
||||
protected final fun setContainsImages (Z)V
|
||||
public final fun setFontFamily (Ljava/lang/String;)V
|
||||
protected final fun setFontFeatureSettings (Ljava/lang/String;)V
|
||||
public final fun setFontSize (F)V
|
||||
protected final fun setFontStyle (I)V
|
||||
public final fun setFontStyle (Ljava/lang/String;)V
|
||||
public final fun setFontVariant (Lcom/facebook/react/bridge/ReadableArray;)V
|
||||
protected final fun setFontWeight (I)V
|
||||
public final fun setFontWeight (Ljava/lang/String;)V
|
||||
protected final fun setHyphenationFrequency (I)V
|
||||
public final fun setIncludeFontPadding (Z)V
|
||||
protected final fun setInlineViews (Ljava/util/Map;)V
|
||||
protected final fun setJustificationMode (I)V
|
||||
public final fun setLetterSpacing (F)V
|
||||
public final fun setLineHeight (F)V
|
||||
protected final fun setLineThroughTextDecorationSet (Z)V
|
||||
public final fun setMaxFontSizeMultiplier (F)V
|
||||
public final fun setMinimumFontScale (F)V
|
||||
public final fun setNumberOfLines (I)V
|
||||
protected final fun setReactTextViewManagerCallback (Lcom/facebook/react/views/text/ReactTextViewManagerCallback;)V
|
||||
protected final fun setRole (Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;)V
|
||||
public final fun setRole (Ljava/lang/String;)V
|
||||
public final fun setTextAlign (Ljava/lang/String;)V
|
||||
protected final fun setTextAttributes (Lcom/facebook/react/views/text/TextAttributes;)V
|
||||
protected final fun setTextBreakStrategy (I)V
|
||||
public fun setAccessibilityRole (Ljava/lang/String;)V
|
||||
public fun setAdjustFontSizeToFit (Z)V
|
||||
public fun setAllowFontScaling (Z)V
|
||||
public fun setBackgroundColor (Ljava/lang/Integer;)V
|
||||
public fun setColor (Ljava/lang/Integer;)V
|
||||
public fun setFontFamily (Ljava/lang/String;)V
|
||||
public fun setFontSize (F)V
|
||||
public fun setFontStyle (Ljava/lang/String;)V
|
||||
public fun setFontVariant (Lcom/facebook/react/bridge/ReadableArray;)V
|
||||
public fun setFontWeight (Ljava/lang/String;)V
|
||||
public fun setIncludeFontPadding (Z)V
|
||||
public fun setLetterSpacing (F)V
|
||||
public fun setLineHeight (F)V
|
||||
public fun setMaxFontSizeMultiplier (F)V
|
||||
public fun setMinimumFontScale (F)V
|
||||
public fun setNumberOfLines (I)V
|
||||
public fun setRole (Ljava/lang/String;)V
|
||||
public fun setTextAlign (Ljava/lang/String;)V
|
||||
public fun setTextBreakStrategy (Ljava/lang/String;)V
|
||||
public final fun setTextDecorationLine (Ljava/lang/String;)V
|
||||
public final fun setTextShadowColor (I)V
|
||||
public final fun setTextShadowOffset (Lcom/facebook/react/bridge/ReadableMap;)V
|
||||
protected final fun setTextShadowOffsetDx (F)V
|
||||
protected final fun setTextShadowOffsetDy (F)V
|
||||
public final fun setTextShadowRadius (F)V
|
||||
public final fun setTextTransform (Ljava/lang/String;)V
|
||||
protected final fun setUnderlineTextDecorationSet (Z)V
|
||||
protected final fun spannedFromShadowNode (Lcom/facebook/react/views/text/ReactBaseTextShadowNode;Ljava/lang/String;ZLcom/facebook/react/uimanager/NativeViewHierarchyOptimizer;)Landroid/text/Spannable;
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/text/ReactBaseTextShadowNode$Companion {
|
||||
public fun setTextDecorationLine (Ljava/lang/String;)V
|
||||
public fun setTextShadowColor (I)V
|
||||
public fun setTextShadowOffset (Lcom/facebook/react/bridge/ReadableMap;)V
|
||||
public fun setTextShadowRadius (F)V
|
||||
public fun setTextTransform (Ljava/lang/String;)V
|
||||
protected fun spannedFromShadowNode (Lcom/facebook/react/views/text/ReactBaseTextShadowNode;Ljava/lang/String;ZLcom/facebook/react/uimanager/NativeViewHierarchyOptimizer;)Landroid/text/Spannable;
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/text/ReactFontManager {
|
||||
@@ -6237,74 +6213,97 @@ public final class com/facebook/react/views/text/ReactTypefaceUtils {
|
||||
public static final fun parseFontWeight (Ljava/lang/String;)I
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/text/TextAttributeProps {
|
||||
public static final field Companion Lcom/facebook/react/views/text/TextAttributeProps$Companion;
|
||||
public static final field TA_KEY_ACCESSIBILITY_ROLE I
|
||||
public static final field TA_KEY_ALIGNMENT I
|
||||
public static final field TA_KEY_ALLOW_FONT_SCALING I
|
||||
public static final field TA_KEY_BACKGROUND_COLOR I
|
||||
public static final field TA_KEY_BEST_WRITING_DIRECTION I
|
||||
public static final field TA_KEY_FONT_FAMILY I
|
||||
public static final field TA_KEY_FONT_SIZE I
|
||||
public static final field TA_KEY_FONT_SIZE_MULTIPLIER I
|
||||
public static final field TA_KEY_FONT_STYLE I
|
||||
public static final field TA_KEY_FONT_VARIANT I
|
||||
public static final field TA_KEY_FONT_WEIGHT I
|
||||
public static final field TA_KEY_FOREGROUND_COLOR I
|
||||
public static final field TA_KEY_IS_HIGHLIGHTED I
|
||||
public static final field TA_KEY_LAYOUT_DIRECTION I
|
||||
public static final field TA_KEY_LETTER_SPACING I
|
||||
public static final field TA_KEY_LINE_BREAK_STRATEGY I
|
||||
public static final field TA_KEY_LINE_HEIGHT I
|
||||
public static final field TA_KEY_MAX_FONT_SIZE_MULTIPLIER I
|
||||
public static final field TA_KEY_OPACITY I
|
||||
public static final field TA_KEY_ROLE I
|
||||
public static final field TA_KEY_TEXT_DECORATION_COLOR I
|
||||
public static final field TA_KEY_TEXT_DECORATION_LINE I
|
||||
public static final field TA_KEY_TEXT_DECORATION_STYLE I
|
||||
public static final field TA_KEY_TEXT_SHADOW_COLOR I
|
||||
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DX I
|
||||
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DY I
|
||||
public static final field TA_KEY_TEXT_SHADOW_RADIUS I
|
||||
public static final field TA_KEY_TEXT_TRANSFORM I
|
||||
public class com/facebook/react/views/text/TextAttributeProps {
|
||||
public static final field TA_KEY_ACCESSIBILITY_ROLE S
|
||||
public static final field TA_KEY_ALIGNMENT S
|
||||
public static final field TA_KEY_ALLOW_FONT_SCALING S
|
||||
public static final field TA_KEY_BACKGROUND_COLOR S
|
||||
public static final field TA_KEY_BEST_WRITING_DIRECTION S
|
||||
public static final field TA_KEY_FONT_FAMILY S
|
||||
public static final field TA_KEY_FONT_SIZE S
|
||||
public static final field TA_KEY_FONT_SIZE_MULTIPLIER S
|
||||
public static final field TA_KEY_FONT_STYLE S
|
||||
public static final field TA_KEY_FONT_VARIANT S
|
||||
public static final field TA_KEY_FONT_WEIGHT S
|
||||
public static final field TA_KEY_FOREGROUND_COLOR S
|
||||
public static final field TA_KEY_IS_HIGHLIGHTED S
|
||||
public static final field TA_KEY_LAYOUT_DIRECTION S
|
||||
public static final field TA_KEY_LETTER_SPACING S
|
||||
public static final field TA_KEY_LINE_BREAK_STRATEGY S
|
||||
public static final field TA_KEY_LINE_HEIGHT S
|
||||
public static final field TA_KEY_MAX_FONT_SIZE_MULTIPLIER S
|
||||
public static final field TA_KEY_OPACITY S
|
||||
public static final field TA_KEY_ROLE S
|
||||
public static final field TA_KEY_TEXT_DECORATION_COLOR S
|
||||
public static final field TA_KEY_TEXT_DECORATION_LINE S
|
||||
public static final field TA_KEY_TEXT_DECORATION_STYLE S
|
||||
public static final field TA_KEY_TEXT_SHADOW_COLOR S
|
||||
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DX S
|
||||
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DY S
|
||||
public static final field TA_KEY_TEXT_SHADOW_RADIUS S
|
||||
public static final field TA_KEY_TEXT_TRANSFORM S
|
||||
public static final field UNSET I
|
||||
public final fun getAccessibilityRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
||||
public final fun getAllowFontScaling ()Z
|
||||
public final fun getBackgroundColor ()Ljava/lang/Integer;
|
||||
public final fun getColor ()Ljava/lang/Integer;
|
||||
public final fun getEffectiveLetterSpacing ()F
|
||||
public final fun getEffectiveLineHeight ()F
|
||||
public final fun getFontFamily ()Ljava/lang/String;
|
||||
public final fun getFontFeatureSettings ()Ljava/lang/String;
|
||||
public final fun getFontSize ()I
|
||||
public final fun getFontStyle ()I
|
||||
public final fun getFontWeight ()I
|
||||
public final fun getLayoutDirection ()I
|
||||
public final fun getLetterSpacing ()F
|
||||
public final fun getLineHeight ()F
|
||||
public final fun getMaxFontSizeMultiplier ()F
|
||||
public final fun getNumberOfLines ()I
|
||||
public final fun getOpacity ()F
|
||||
public final fun getRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
||||
public final fun getTextShadowColor ()I
|
||||
public final fun getTextShadowOffsetDx ()F
|
||||
public final fun getTextShadowOffsetDy ()F
|
||||
public final fun getTextShadowRadius ()F
|
||||
public final fun isBackgroundColorSet ()Z
|
||||
public final fun isColorSet ()Z
|
||||
public final fun isLineThroughTextDecorationSet ()Z
|
||||
public final fun isUnderlineTextDecorationSet ()Z
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/text/TextAttributeProps$Companion {
|
||||
public final fun fromMapBuffer (Lcom/facebook/react/common/mapbuffer/MapBuffer;)Lcom/facebook/react/views/text/TextAttributeProps;
|
||||
public final fun fromReadableMap (Lcom/facebook/react/uimanager/ReactStylesDiffMap;)Lcom/facebook/react/views/text/TextAttributeProps;
|
||||
public final fun getEllipsizeMode (Ljava/lang/String;)Landroid/text/TextUtils$TruncateAt;
|
||||
public final fun getHyphenationFrequency (Ljava/lang/String;)I
|
||||
public final fun getJustificationMode (Lcom/facebook/react/uimanager/ReactStylesDiffMap;I)I
|
||||
public final fun getLayoutDirection (Ljava/lang/String;)I
|
||||
public final fun getTextAlignment (Lcom/facebook/react/uimanager/ReactStylesDiffMap;ZI)I
|
||||
public final fun getTextBreakStrategy (Ljava/lang/String;)I
|
||||
protected field mAccessibilityRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
||||
protected field mAllowFontScaling Z
|
||||
protected field mBackgroundColor I
|
||||
protected field mColor I
|
||||
protected field mContainsImages Z
|
||||
protected field mFontFamily Ljava/lang/String;
|
||||
protected field mFontFeatureSettings Ljava/lang/String;
|
||||
protected field mFontSize I
|
||||
protected field mFontSizeInput F
|
||||
protected field mFontStyle I
|
||||
protected field mFontWeight I
|
||||
protected field mHeightOfTallestInlineImage F
|
||||
protected field mIncludeFontPadding Z
|
||||
protected field mIsBackgroundColorSet Z
|
||||
protected field mIsColorSet Z
|
||||
protected field mIsLineThroughTextDecorationSet Z
|
||||
protected field mIsUnderlineTextDecorationSet Z
|
||||
protected field mLayoutDirection I
|
||||
protected field mLetterSpacingInput F
|
||||
protected field mLineHeight F
|
||||
protected field mLineHeightInput F
|
||||
protected field mMaxFontSizeMultiplier F
|
||||
protected field mNumberOfLines I
|
||||
protected field mOpacity F
|
||||
protected field mRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
||||
protected field mTextAlign I
|
||||
protected field mTextShadowColor I
|
||||
protected field mTextShadowOffsetDx F
|
||||
protected field mTextShadowOffsetDy F
|
||||
protected field mTextShadowRadius F
|
||||
protected field mTextTransform Lcom/facebook/react/views/text/TextTransform;
|
||||
public static fun fromMapBuffer (Lcom/facebook/react/common/mapbuffer/MapBuffer;)Lcom/facebook/react/views/text/TextAttributeProps;
|
||||
public static fun fromReadableMap (Lcom/facebook/react/uimanager/ReactStylesDiffMap;)Lcom/facebook/react/views/text/TextAttributeProps;
|
||||
public fun getAccessibilityRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
||||
public fun getBackgroundColor ()I
|
||||
public fun getColor ()I
|
||||
public fun getEffectiveFontSize ()I
|
||||
public fun getEffectiveLetterSpacing ()F
|
||||
public fun getEffectiveLineHeight ()F
|
||||
public static fun getEllipsizeMode (Ljava/lang/String;)Landroid/text/TextUtils$TruncateAt;
|
||||
public fun getFontFamily ()Ljava/lang/String;
|
||||
public fun getFontFeatureSettings ()Ljava/lang/String;
|
||||
public fun getFontStyle ()I
|
||||
public fun getFontWeight ()I
|
||||
public static fun getHyphenationFrequency (Ljava/lang/String;)I
|
||||
public static fun getJustificationMode (Lcom/facebook/react/uimanager/ReactStylesDiffMap;I)I
|
||||
public static fun getLayoutDirection (Ljava/lang/String;)I
|
||||
public fun getLetterSpacing ()F
|
||||
public fun getOpacity ()F
|
||||
public fun getRole ()Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
||||
public static fun getTextAlignment (Lcom/facebook/react/uimanager/ReactStylesDiffMap;ZI)I
|
||||
public static fun getTextBreakStrategy (Ljava/lang/String;)I
|
||||
public fun getTextShadowColor ()I
|
||||
public fun getTextShadowOffsetDx ()F
|
||||
public fun getTextShadowOffsetDy ()F
|
||||
public fun getTextShadowRadius ()F
|
||||
public fun getTextTransform ()Lcom/facebook/react/views/text/TextTransform;
|
||||
public fun isBackgroundColorSet ()Z
|
||||
public fun isColorSet ()Z
|
||||
public fun isLineThroughTextDecorationSet ()Z
|
||||
public fun isUnderlineTextDecorationSet ()Z
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/text/TextAttributes {
|
||||
|
||||
@@ -630,6 +630,7 @@ dependencies {
|
||||
api(libs.androidx.autofill)
|
||||
api(libs.androidx.swiperefreshlayout)
|
||||
api(libs.androidx.tracing)
|
||||
api(libs.androidx.window)
|
||||
|
||||
api(libs.fbjni)
|
||||
api(libs.fresco)
|
||||
|
||||
+8
-13
@@ -30,6 +30,7 @@ import com.facebook.react.modules.debug.DevSettingsModule
|
||||
import com.facebook.react.modules.debug.SourceCodeModule
|
||||
import com.facebook.react.modules.deviceinfo.DeviceInfoModule
|
||||
import com.facebook.react.modules.systeminfo.AndroidInfoModule
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.ViewManager
|
||||
import com.facebook.react.uimanager.ViewManagerResolver
|
||||
import com.facebook.systrace.Systrace
|
||||
@@ -37,7 +38,6 @@ import com.facebook.systrace.Systrace
|
||||
/**
|
||||
* This is the basic module to support React Native. The debug modules are now in DebugCorePackage.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@ReactModuleList(
|
||||
// WARNING: If you modify this list, ensure that the list below in method
|
||||
// getReactModuleInfoByInitialization is also updated
|
||||
@@ -53,11 +53,9 @@ import com.facebook.systrace.Systrace
|
||||
HeadlessJsTaskSupportModule::class,
|
||||
SourceCodeModule::class,
|
||||
TimingModule::class,
|
||||
com.facebook.react.uimanager.UIManagerModule::class])
|
||||
UIManagerModule::class])
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
@Suppress("DEPRECATION")
|
||||
internal class CoreModulesPackage(
|
||||
private val reactInstanceManager: ReactInstanceManager,
|
||||
private val hardwareBackBtnHandler: DefaultHardwareBackBtnHandler,
|
||||
@@ -105,7 +103,7 @@ internal class CoreModulesPackage(
|
||||
HeadlessJsTaskSupportModule::class.java,
|
||||
SourceCodeModule::class.java,
|
||||
TimingModule::class.java,
|
||||
com.facebook.react.uimanager.UIManagerModule::class.java,
|
||||
UIManagerModule::class.java,
|
||||
)
|
||||
|
||||
val reactModuleInfoMap: MutableMap<String, ReactModuleInfo> = HashMap<String, ReactModuleInfo>()
|
||||
@@ -142,7 +140,7 @@ internal class CoreModulesPackage(
|
||||
HeadlessJsTaskSupportModule.NAME -> HeadlessJsTaskSupportModule(reactContext)
|
||||
SourceCodeModule.NAME -> SourceCodeModule(reactContext)
|
||||
TimingModule.NAME -> TimingModule(reactContext, reactInstanceManager.devSupportManager)
|
||||
com.facebook.react.uimanager.UIManagerModule.NAME -> createUIManager(reactContext)
|
||||
UIManagerModule.NAME -> createUIManager(reactContext)
|
||||
DeviceInfoModule.NAME -> DeviceInfoModule(reactContext)
|
||||
else ->
|
||||
throw IllegalArgumentException(
|
||||
@@ -150,9 +148,7 @@ internal class CoreModulesPackage(
|
||||
}
|
||||
}
|
||||
|
||||
private fun createUIManager(
|
||||
reactContext: ReactApplicationContext
|
||||
): com.facebook.react.uimanager.UIManagerModule {
|
||||
private fun createUIManager(reactContext: ReactApplicationContext): UIManagerModule {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_START)
|
||||
Systrace.beginSection(Systrace.TRACE_TAG_REACT, "createUIManagerModule")
|
||||
|
||||
@@ -169,10 +165,9 @@ internal class CoreModulesPackage(
|
||||
}
|
||||
}
|
||||
|
||||
return com.facebook.react.uimanager.UIManagerModule(
|
||||
reactContext, resolver, minTimeLeftInFrameForNonBatchedOperationMs)
|
||||
return UIManagerModule(reactContext, resolver, minTimeLeftInFrameForNonBatchedOperationMs)
|
||||
} else {
|
||||
return com.facebook.react.uimanager.UIManagerModule(
|
||||
return UIManagerModule(
|
||||
reactContext,
|
||||
reactInstanceManager.getOrCreateViewManagers(reactContext),
|
||||
minTimeLeftInFrameForNonBatchedOperationMs)
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.bridge.ModuleHolder
|
||||
@@ -18,9 +16,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
|
||||
/** Helper class to build NativeModuleRegistry. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public class NativeModuleRegistryBuilder(
|
||||
private val reactApplicationContext: ReactApplicationContext,
|
||||
) {
|
||||
|
||||
+12
-1
@@ -262,7 +262,11 @@ public class ReactInstanceManager {
|
||||
FLog.d(TAG, "ReactInstanceManager.ctor()");
|
||||
initializeSoLoaderIfNecessary(applicationContext);
|
||||
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(applicationContext);
|
||||
DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized(applicationContext);
|
||||
|
||||
if (currentActivity != null) {
|
||||
DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized(currentActivity);
|
||||
}
|
||||
|
||||
// See {@code ReactInstanceManagerBuilder} for description of all flags here.
|
||||
mApplicationContext = applicationContext;
|
||||
@@ -927,6 +931,13 @@ public class ReactInstanceManager {
|
||||
|
||||
ReactContext currentReactContext = getCurrentReactContext();
|
||||
if (currentReactContext != null) {
|
||||
DisplayMetricsHolder.initScreenDisplayMetrics(currentReactContext);
|
||||
Activity currentActivity = currentReactContext.getCurrentActivity();
|
||||
|
||||
if (currentActivity != null) {
|
||||
DisplayMetricsHolder.initWindowDisplayMetrics(currentActivity);
|
||||
}
|
||||
|
||||
AppearanceModule appearanceModule =
|
||||
currentReactContext.getNativeModule(AppearanceModule.class);
|
||||
|
||||
|
||||
+6
-5
@@ -136,9 +136,8 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
setRootViewTag(ReactRootViewTagGenerator.getNextRootViewTag());
|
||||
setClipChildren(false);
|
||||
|
||||
if (ReactNativeFeatureFlags.enableFontScaleChangesUpdatingLayout()) {
|
||||
DisplayMetricsHolder.initDisplayMetrics(getContext().getApplicationContext());
|
||||
}
|
||||
DisplayMetricsHolder.initScreenDisplayMetrics(getContext());
|
||||
DisplayMetricsHolder.initWindowDisplayMetrics(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -883,7 +882,8 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
private int mDeviceRotation = 0;
|
||||
|
||||
/* package */ CustomGlobalLayoutListener() {
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(getContext().getApplicationContext());
|
||||
DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized(getContext());
|
||||
DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized(getContext());
|
||||
mVisibleViewArea = new Rect();
|
||||
mMinKeyboardHeightDetected = (int) PixelUtil.toPixelFromDIP(60);
|
||||
}
|
||||
@@ -1006,7 +1006,8 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
return;
|
||||
}
|
||||
mDeviceRotation = rotation;
|
||||
DisplayMetricsHolder.initDisplayMetrics(getContext().getApplicationContext());
|
||||
DisplayMetricsHolder.initScreenDisplayMetrics(getContext());
|
||||
DisplayMetricsHolder.initWindowDisplayMetrics(getContext());
|
||||
emitOrientationChanged(rotation);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -28,6 +28,7 @@ import com.facebook.react.modules.core.ReactChoreographer
|
||||
import com.facebook.react.uimanager.GuardedFrameCallback
|
||||
import com.facebook.react.uimanager.UIBlock
|
||||
import com.facebook.react.uimanager.UIManagerHelper
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.common.UIManagerType
|
||||
import com.facebook.react.uimanager.common.ViewUtil
|
||||
import java.util.ArrayList
|
||||
@@ -73,9 +74,9 @@ import kotlin.concurrent.Volatile
|
||||
* that coordinates all the action: [NativeAnimatedNodesManager]. Since all the methods from
|
||||
* [NativeAnimatedNodesManager] need to be called from the UI thread, we we create a queue of
|
||||
* animated graph operations that is then enqueued to be executed in the UI Thread at the end of the
|
||||
* batch of JS->native calls (similarly to how it's handled in
|
||||
* [com.facebook.react.uimanager.UIManagerModule]). This isolates us from the problems that may be
|
||||
* caused by concurrent updates of animated graph while UI thread is "executing" the animation loop.
|
||||
* batch of JS->native calls (similarly to how it's handled in [UIManagerModule]). This isolates us
|
||||
* from the problems that may be caused by concurrent updates of animated graph while UI thread is
|
||||
* "executing" the animation loop.
|
||||
*/
|
||||
@OptIn(UnstableReactNativeAPI::class)
|
||||
@ReactModule(name = NativeAnimatedModuleSpec.NAME)
|
||||
@@ -305,7 +306,6 @@ public class NativeAnimatedModule(reactContext: ReactApplicationContext) :
|
||||
}
|
||||
|
||||
// For non-FabricUIManager only
|
||||
@Suppress("DEPRECATION")
|
||||
@UiThread
|
||||
override fun willDispatchViewUpdates(uiManager: UIManager) {
|
||||
if (operations.isEmpty && preOperations.isEmpty) {
|
||||
@@ -325,8 +325,8 @@ public class NativeAnimatedModule(reactContext: ReactApplicationContext) :
|
||||
|
||||
val operationsUIBlock = UIBlock { operations.executeBatch(frameNo, nodesManager) }
|
||||
|
||||
assert(uiManager is com.facebook.react.uimanager.UIManagerModule)
|
||||
val uiManagerModule = uiManager as com.facebook.react.uimanager.UIManagerModule
|
||||
assert(uiManager is UIManagerModule)
|
||||
val uiManagerModule = uiManager as UIManagerModule
|
||||
uiManagerModule.prependUIBlock(preOperationsUIBlock)
|
||||
uiManagerModule.addUIBlock(operationsUIBlock)
|
||||
}
|
||||
|
||||
+1
-2
@@ -40,8 +40,7 @@ import java.util.Objects;
|
||||
*/
|
||||
@VisibleForTesting
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
@Deprecated
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public class BridgeReactContext extends ReactApplicationContext {
|
||||
static {
|
||||
|
||||
+7
-1
@@ -7,9 +7,15 @@
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
internal object ReactNativeJNISoLoader {
|
||||
@LegacyArchitecture
|
||||
internal object BridgeSoLoader {
|
||||
init {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture("BridgeSoLoader")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Synchronized
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
@@ -15,9 +13,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
|
||||
/** Implementation of javascript callback function that uses Bridge to schedule method execution. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class CallbackImpl(private val jsInstance: JSInstance, private val callbackId: Int) :
|
||||
Callback {
|
||||
private var invoked = false
|
||||
|
||||
-2
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
|
||||
+1
-3
@@ -48,11 +48,9 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*/
|
||||
@DoNotStrip
|
||||
@LegacyArchitecture
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class CatalystInstanceImpl implements CatalystInstance {
|
||||
static {
|
||||
ReactNativeJNISoLoader.staticInit();
|
||||
BridgeSoLoader.staticInit();
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
"CatalystInstanceImpl", LegacyArchitectureLogLevel.WARNING);
|
||||
}
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ protected constructor(
|
||||
|
||||
private companion object {
|
||||
init {
|
||||
ReactNativeJNISoLoader.staticInit()
|
||||
BridgeSoLoader.staticInit()
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
"CxxModuleWrapperBase", LegacyArchitectureLogLevel.WARNING)
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ private constructor(@Suppress("NoHungarianNotation") private val mHybridData: Hy
|
||||
|
||||
public companion object {
|
||||
init {
|
||||
ReactNativeJNISoLoader.staticInit()
|
||||
BridgeSoLoader.staticInit()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
|
||||
+1
-16
@@ -17,9 +17,6 @@ import com.facebook.systrace.SystraceMessage
|
||||
import java.lang.reflect.InvocationTargetException
|
||||
import java.lang.reflect.Method
|
||||
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
internal class JavaMethodWrapper(
|
||||
private val moduleWrapper: JavaModuleWrapper,
|
||||
@@ -29,7 +26,6 @@ internal class JavaMethodWrapper(
|
||||
private abstract class ArgumentExtractor<T> {
|
||||
open fun getJSArgumentsNeeded(): Int = 1
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
abstract fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -161,7 +157,6 @@ internal class JavaMethodWrapper(
|
||||
"$startIndex"
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
override fun invoke(jsInstance: JSInstance, parameters: ReadableArray) {
|
||||
val traceName = moduleWrapper.name + "." + method.name
|
||||
SystraceMessage.beginSection(TRACE_TAG_REACT, "callJavaModuleMethod")
|
||||
@@ -245,7 +240,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_BOOLEAN: ArgumentExtractor<Boolean> =
|
||||
object : ArgumentExtractor<Boolean>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -255,7 +249,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_DOUBLE: ArgumentExtractor<Double> =
|
||||
object : ArgumentExtractor<Double>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -265,7 +258,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_FLOAT: ArgumentExtractor<Float> =
|
||||
object : ArgumentExtractor<Float>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -275,7 +267,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_INTEGER: ArgumentExtractor<Int> =
|
||||
object : ArgumentExtractor<Int>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -285,7 +276,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_STRING: ArgumentExtractor<String> =
|
||||
object : ArgumentExtractor<String>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -295,7 +285,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_ARRAY: ArgumentExtractor<ReadableArray> =
|
||||
object : ArgumentExtractor<ReadableArray>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -305,7 +294,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_DYNAMIC: ArgumentExtractor<Dynamic> =
|
||||
object : ArgumentExtractor<Dynamic>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -315,7 +303,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_MAP: ArgumentExtractor<ReadableMap> =
|
||||
object : ArgumentExtractor<ReadableMap>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -325,7 +312,6 @@ internal class JavaMethodWrapper(
|
||||
|
||||
private val ARGUMENT_EXTRACTOR_CALLBACK: ArgumentExtractor<Callback> =
|
||||
object : ArgumentExtractor<Callback>() {
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
@@ -335,7 +321,7 @@ internal class JavaMethodWrapper(
|
||||
null
|
||||
} else {
|
||||
val id = jsArguments.getDouble(atIndex).toInt()
|
||||
@Suppress("DEPRECATION") CallbackImpl(jsInstance, id)
|
||||
CallbackImpl(jsInstance, id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +329,6 @@ internal class JavaMethodWrapper(
|
||||
object : ArgumentExtractor<Promise>() {
|
||||
override fun getJSArgumentsNeeded(): Int = 2
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
override fun extractArgument(
|
||||
jsInstance: JSInstance,
|
||||
jsArguments: ReadableArray,
|
||||
|
||||
+2
-3
@@ -25,11 +25,11 @@ import java.lang.reflect.Method
|
||||
@DoNotStrip
|
||||
@InteropLegacyArchitecture
|
||||
internal class JavaModuleWrapper(
|
||||
@Suppress("DEPRECATION") private val jsInstance: JSInstance,
|
||||
private val jsInstance: JSInstance,
|
||||
private val moduleHolder: ModuleHolder
|
||||
) {
|
||||
interface NativeMethod {
|
||||
@Suppress("DEPRECATION") fun invoke(jsInstance: JSInstance, parameters: ReadableArray)
|
||||
fun invoke(jsInstance: JSInstance, parameters: ReadableArray)
|
||||
|
||||
val type: String
|
||||
}
|
||||
@@ -74,7 +74,6 @@ internal class JavaModuleWrapper(
|
||||
targetMethod.getAnnotation(ReactMethod::class.java)?.let { annotation ->
|
||||
val methodName = targetMethod.name
|
||||
val md = MethodDescriptor()
|
||||
@Suppress("DEPRECATION")
|
||||
val method = JavaMethodWrapper(this, targetMethod, annotation.isBlockingSynchronousMethod)
|
||||
md.name = methodName
|
||||
md.type = method.type
|
||||
|
||||
-3
@@ -13,9 +13,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
|
||||
/** Exception thrown when a native module method call receives unexpected arguments from JS. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class NativeArgumentsParseException : JSApplicationCausedNativeException {
|
||||
|
||||
constructor(detailMessage: String) : super(detailMessage)
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.react.bridge.ReactMarker.logMarker
|
||||
@@ -21,9 +19,6 @@ import com.facebook.systrace.Systrace.endSection
|
||||
|
||||
/** A set of Java APIs to expose to a particular JavaScript instance. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public class NativeModuleRegistry(
|
||||
private val reactApplicationContext: ReactApplicationContext,
|
||||
private val modules: MutableMap<String, ModuleHolder>
|
||||
|
||||
-3
@@ -12,9 +12,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
|
||||
/** Interface for a module that will be notified when a batch of JS->Java calls has finished. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public fun interface OnBatchCompleteListener {
|
||||
public fun onBatchComplete()
|
||||
}
|
||||
|
||||
-3
@@ -16,9 +16,6 @@ import java.lang.reflect.Method
|
||||
|
||||
@DoNotStrip
|
||||
@LegacyArchitecture
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal object ReactCxxErrorHandler {
|
||||
init {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
|
||||
+1
-6
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.jni.HybridData
|
||||
@@ -19,9 +17,6 @@ import java.util.concurrent.Executor
|
||||
|
||||
@DoNotStripAny
|
||||
@LegacyArchitecture
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class ReactInstanceManagerInspectorTarget(delegate: TargetDelegate) : AutoCloseable {
|
||||
|
||||
@DoNotStripAny
|
||||
@@ -68,7 +63,7 @@ internal class ReactInstanceManagerInspectorTarget(delegate: TargetDelegate) : A
|
||||
init {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
"ReactInstanceManagerInspectorTarget", LegacyArchitectureLogLevel.WARNING)
|
||||
ReactNativeJNISoLoader.staticInit()
|
||||
BridgeSoLoader.staticInit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -15,9 +15,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
* Native.
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public fun interface UIManagerProvider {
|
||||
|
||||
/* Provides a [com.facebook.react.bridge.UIManager] for the context received as a parameter. */
|
||||
|
||||
-3
@@ -46,9 +46,6 @@ import com.facebook.react.packagerconnection.RequestHandler
|
||||
* when all the views has been detached from the instance (through `setDevSupportEnabled` method).
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public class BridgeDevSupportManager(
|
||||
applicationContext: Context,
|
||||
reactInstanceManagerHelper: ReactInstanceDevHelper,
|
||||
|
||||
-19
@@ -70,7 +70,6 @@ import com.facebook.react.internal.featureflags.ReactNativeNewArchitectureFeatur
|
||||
import com.facebook.react.internal.interop.InteropEventEmitter;
|
||||
import com.facebook.react.modules.core.ReactChoreographer;
|
||||
import com.facebook.react.modules.i18nmanager.I18nUtil;
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder;
|
||||
import com.facebook.react.uimanager.GuardedFrameCallback;
|
||||
import com.facebook.react.uimanager.IllegalViewOperationException;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
@@ -98,7 +97,6 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
@@ -727,23 +725,6 @@ public class FabricUIManager
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to get the encoded screen size without vertical insets for a given surface.
|
||||
* It's used by the Modal component to determine the size of the screen without vertical insets.
|
||||
* The method is private as it's accessed via JNI from C++.
|
||||
*
|
||||
* @param surfaceId The surface ID of the surface for which the Modal is going to render.
|
||||
* @return The encoded screen size as a long (both width and height) are represented without
|
||||
* vertical insets.
|
||||
*/
|
||||
private long getEncodedScreenSizeWithoutVerticalInsets(int surfaceId) {
|
||||
SurfaceMountingManager surfaceMountingManager = mMountingManager.getSurfaceManager(surfaceId);
|
||||
Objects.requireNonNull(surfaceMountingManager);
|
||||
ThemedReactContext context = Objects.requireNonNull(surfaceMountingManager.getContext());
|
||||
return DisplayMetricsHolder.getEncodedScreenSizeWithoutVerticalInsets(
|
||||
context.getCurrentActivity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addUIManagerEventListener(UIManagerListener listener) {
|
||||
mListeners.add(listener);
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.fabric
|
||||
|
||||
import com.facebook.react.bridge.ReactApplicationContext
|
||||
@@ -22,9 +20,6 @@ import com.facebook.systrace.Systrace
|
||||
* @param [componentFactory] The factory for creating components.
|
||||
* @param [viewManagerRegistry] The registry of view managers.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public class FabricUIManagerProviderImpl(
|
||||
private val componentFactory: ComponentFactory,
|
||||
private val viewManagerRegistry: ViewManagerRegistry
|
||||
|
||||
+3
-4
@@ -11,6 +11,7 @@ import android.view.Choreographer
|
||||
import com.facebook.react.bridge.ReactContext
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import com.facebook.react.common.build.ReactBuildConfig
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
|
||||
/**
|
||||
* Each time a frame is drawn, records whether it should have expected any more callbacks since the
|
||||
@@ -61,8 +62,7 @@ internal class FpsDebugFrameCallback(private val reactContext: ReactContext) :
|
||||
// removeBridgeIdleDebugListener for Bridgeless
|
||||
@Suppress("DEPRECATION")
|
||||
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
|
||||
val uiManagerModule =
|
||||
reactContext.getNativeModule(com.facebook.react.uimanager.UIManagerModule::class.java)
|
||||
val uiManagerModule = reactContext.getNativeModule(UIManagerModule::class.java)
|
||||
if (!reactContext.isBridgeless) {
|
||||
reactContext.catalystInstance.addBridgeIdleDebugListener(didJSUpdateUiDuringFrameDetector)
|
||||
isRunningOnFabric = false
|
||||
@@ -83,8 +83,7 @@ internal class FpsDebugFrameCallback(private val reactContext: ReactContext) :
|
||||
fun stop() {
|
||||
@Suppress("DEPRECATION")
|
||||
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE) {
|
||||
val uiManagerModule =
|
||||
reactContext.getNativeModule(com.facebook.react.uimanager.UIManagerModule::class.java)
|
||||
val uiManagerModule = reactContext.getNativeModule(UIManagerModule::class.java)
|
||||
if (!reactContext.isBridgeless) {
|
||||
reactContext.catalystInstance.removeBridgeIdleDebugListener(
|
||||
didJSUpdateUiDuringFrameDetector)
|
||||
|
||||
+4
-2
@@ -15,7 +15,8 @@ import com.facebook.react.bridge.ReactSoftExceptionLogger
|
||||
import com.facebook.react.bridge.ReadableMap
|
||||
import com.facebook.react.module.annotations.ReactModule
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.getDisplayMetricsWritableMap
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.initDisplayMetricsIfNotInitialized
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized
|
||||
import com.facebook.react.views.view.isEdgeToEdgeFeatureFlagOn
|
||||
|
||||
/** Module that exposes Android Constants to JS. */
|
||||
@@ -26,7 +27,8 @@ internal class DeviceInfoModule(reactContext: ReactApplicationContext) :
|
||||
private var previousDisplayMetrics: ReadableMap? = null
|
||||
|
||||
init {
|
||||
initDisplayMetricsIfNotInitialized(reactContext)
|
||||
initScreenDisplayMetricsIfNotInitialized(reactContext)
|
||||
reactContext.currentActivity?.let { initWindowDisplayMetricsIfNotInitialized(it) }
|
||||
reactContext.addLifecycleEventListener(this)
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -61,6 +61,7 @@ import com.facebook.react.runtime.internal.bolts.Task
|
||||
import com.facebook.react.runtime.internal.bolts.TaskCompletionSource
|
||||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.events.BlackHoleEventDispatcher
|
||||
import com.facebook.react.uimanager.events.EventDispatcher
|
||||
import com.facebook.react.views.imagehelper.ResourceDrawableIdHelper
|
||||
@@ -522,10 +523,9 @@ public class ReactHostImpl(
|
||||
internal val nativeModules: Collection<NativeModule>
|
||||
get() = reactInstance?.nativeModules ?: listOf()
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
internal fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? {
|
||||
if (!ReactBuildConfig.UNSTABLE_ENABLE_MINIFY_LEGACY_ARCHITECTURE &&
|
||||
nativeModuleInterface == com.facebook.react.uimanager.UIManagerModule::class.java) {
|
||||
nativeModuleInterface == UIManagerModule::class.java) {
|
||||
ReactSoftExceptionLogger.logSoftExceptionVerbose(
|
||||
TAG,
|
||||
ReactNoCrashSoftException(
|
||||
@@ -625,9 +625,8 @@ public class ReactHostImpl(
|
||||
override fun onConfigurationChanged(context: Context) {
|
||||
val currentReactContext = this.currentReactContext
|
||||
if (currentReactContext != null) {
|
||||
if (ReactNativeFeatureFlags.enableFontScaleChangesUpdatingLayout()) {
|
||||
DisplayMetricsHolder.initDisplayMetrics(currentReactContext)
|
||||
}
|
||||
DisplayMetricsHolder.initScreenDisplayMetrics(currentReactContext)
|
||||
currentReactContext.currentActivity?.let { DisplayMetricsHolder.initWindowDisplayMetrics(it) }
|
||||
|
||||
val appearanceModule = currentReactContext.getNativeModule(AppearanceModule::class.java)
|
||||
appearanceModule?.onConfigurationChanged(context)
|
||||
@@ -918,6 +917,7 @@ public class ReactHostImpl(
|
||||
val instance =
|
||||
ReactInstance(
|
||||
reactContext,
|
||||
currentActivity,
|
||||
reactHostDelegate,
|
||||
componentFactory,
|
||||
devSupportManager,
|
||||
|
||||
+4
-1
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.facebook.react.runtime
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.res.AssetManager
|
||||
import android.view.View
|
||||
import com.facebook.common.logging.FLog
|
||||
@@ -88,6 +89,7 @@ import kotlin.jvm.JvmStatic
|
||||
@UnstableReactNativeAPI
|
||||
internal class ReactInstance(
|
||||
private val context: BridgelessReactContext,
|
||||
private val activity: Activity?,
|
||||
delegate: ReactHostDelegate,
|
||||
componentFactory: ComponentFactory,
|
||||
devSupportManager: DevSupportManager,
|
||||
@@ -240,7 +242,8 @@ internal class ReactInstance(
|
||||
FabricUIManager(context, ViewManagerRegistry(viewManagerResolver), eventBeatManager)
|
||||
|
||||
// Misc initialization that needs to be done before Fabric init
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(context)
|
||||
DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized(context)
|
||||
activity?.let { DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized(it) }
|
||||
|
||||
val binding = FabricUIManagerBinding()
|
||||
binding.register(
|
||||
|
||||
+7
-10
@@ -56,7 +56,9 @@ import com.facebook.react.views.scroll.ReactScrollViewManager
|
||||
import com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
|
||||
import com.facebook.react.views.switchview.ReactSwitchManager
|
||||
import com.facebook.react.views.text.PreparedLayoutTextViewManager
|
||||
import com.facebook.react.views.text.ReactRawTextManager
|
||||
import com.facebook.react.views.text.ReactTextViewManager
|
||||
import com.facebook.react.views.text.ReactVirtualTextViewManager
|
||||
import com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
|
||||
import com.facebook.react.views.textinput.ReactTextInputManager
|
||||
import com.facebook.react.views.unimplementedview.ReactUnimplementedViewManager
|
||||
@@ -131,7 +133,6 @@ constructor(private val config: MainPackageConfig? = null) :
|
||||
else -> null
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> =
|
||||
listOf(
|
||||
ReactDrawerLayoutManager(),
|
||||
@@ -146,19 +147,18 @@ constructor(private val config: MainPackageConfig? = null) :
|
||||
FrescoBasedReactTextInlineImageViewManager(),
|
||||
ReactImageManager(),
|
||||
ReactModalHostManager(),
|
||||
com.facebook.react.views.text.ReactRawTextManager(),
|
||||
ReactRawTextManager(),
|
||||
ReactTextInputManager(),
|
||||
if (ReactNativeFeatureFlags.enablePreparedTextLayout()) PreparedLayoutTextViewManager()
|
||||
else ReactTextViewManager(),
|
||||
ReactViewManager(),
|
||||
com.facebook.react.views.text.ReactVirtualTextViewManager(),
|
||||
ReactVirtualTextViewManager(),
|
||||
ReactUnimplementedViewManager())
|
||||
|
||||
/**
|
||||
* A map of view managers that should be registered with
|
||||
* [com.facebook.react.uimanager.UIManagerModule]
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@SuppressLint("VisibleForTests")
|
||||
public val viewManagersMap: Map<String, ModuleSpec> =
|
||||
mapOf(
|
||||
@@ -182,8 +182,7 @@ constructor(private val config: MainPackageConfig? = null) :
|
||||
ReactImageManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactImageManager() },
|
||||
ReactModalHostManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec { ReactModalHostManager() },
|
||||
com.facebook.react.views.text.ReactRawTextManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec { com.facebook.react.views.text.ReactRawTextManager() },
|
||||
ReactRawTextManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactRawTextManager() },
|
||||
ReactTextInputManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec { ReactTextInputManager() },
|
||||
ReactTextViewManager.REACT_CLASS to
|
||||
@@ -193,10 +192,8 @@ constructor(private val config: MainPackageConfig? = null) :
|
||||
else ReactTextViewManager()
|
||||
},
|
||||
ReactViewManager.REACT_CLASS to ModuleSpec.viewManagerSpec { ReactViewManager() },
|
||||
com.facebook.react.views.text.ReactVirtualTextViewManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec {
|
||||
com.facebook.react.views.text.ReactVirtualTextViewManager()
|
||||
},
|
||||
ReactVirtualTextViewManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec { ReactVirtualTextViewManager() },
|
||||
ReactUnimplementedViewManager.REACT_CLASS to
|
||||
ModuleSpec.viewManagerSpec { ReactUnimplementedViewManager() })
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import com.facebook.yoga.YogaConstants
|
||||
* every view should support, such as rotation, background color, etc.
|
||||
*/
|
||||
public abstract class BaseViewManagerDelegate<
|
||||
T : View, @Suppress("DEPRECATION") U : BaseViewManager<T, out LayoutShadowNode>>(
|
||||
T : View, U : BaseViewManager<T, out LayoutShadowNode>>(
|
||||
@Suppress("NoHungarianNotation") @JvmField protected val mViewManager: U
|
||||
) : ViewManagerDelegate<T> {
|
||||
@Suppress("ACCIDENTAL_OVERRIDE", "DEPRECATION")
|
||||
|
||||
+46
-47
@@ -13,17 +13,20 @@ import android.util.DisplayMetrics
|
||||
import android.view.WindowManager
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.window.layout.WindowMetricsCalculator
|
||||
import com.facebook.react.bridge.WritableMap
|
||||
import com.facebook.react.bridge.WritableNativeMap
|
||||
import com.facebook.react.uimanager.PixelUtil.pxToDp
|
||||
import com.facebook.react.views.view.isEdgeToEdgeFeatureFlagOn
|
||||
|
||||
/**
|
||||
* Holds an instance of the current DisplayMetrics so we don't have to thread it through all the
|
||||
* classes that need it.
|
||||
*/
|
||||
public object DisplayMetricsHolder {
|
||||
private const val INITIALIZATION_MISSING_MESSAGE =
|
||||
"DisplayMetricsHolder must be initialized with initDisplayMetricsIfNotInitialized or initDisplayMetrics"
|
||||
private const val SCREEN_INITIALIZATION_MISSING_MESSAGE =
|
||||
"DisplayMetricsHolder must be initialized with initScreenDisplayMetricsIfNotInitialized or initScreenDisplayMetrics"
|
||||
private const val WINDOW_INITIALIZATION_MISSING_MESSAGE =
|
||||
"DisplayMetricsHolder must be initialized with initWindowDisplayMetricsIfNotInitialized or initWindowDisplayMetrics"
|
||||
|
||||
@JvmStatic private var windowDisplayMetrics: DisplayMetrics? = null
|
||||
@JvmStatic private var screenDisplayMetrics: DisplayMetrics? = null
|
||||
@@ -31,7 +34,7 @@ public object DisplayMetricsHolder {
|
||||
/** The metrics of the window associated to the Context used to initialize ReactNative */
|
||||
@JvmStatic
|
||||
public fun getWindowDisplayMetrics(): DisplayMetrics {
|
||||
checkNotNull(windowDisplayMetrics) { INITIALIZATION_MISSING_MESSAGE }
|
||||
checkNotNull(windowDisplayMetrics) { WINDOW_INITIALIZATION_MISSING_MESSAGE }
|
||||
return windowDisplayMetrics as DisplayMetrics
|
||||
}
|
||||
|
||||
@@ -43,7 +46,7 @@ public object DisplayMetricsHolder {
|
||||
/** Screen metrics returns the metrics of the default screen on the device. */
|
||||
@JvmStatic
|
||||
public fun getScreenDisplayMetrics(): DisplayMetrics {
|
||||
checkNotNull(screenDisplayMetrics) { INITIALIZATION_MISSING_MESSAGE }
|
||||
checkNotNull(screenDisplayMetrics) { SCREEN_INITIALIZATION_MISSING_MESSAGE }
|
||||
return screenDisplayMetrics as DisplayMetrics
|
||||
}
|
||||
|
||||
@@ -53,33 +56,58 @@ public object DisplayMetricsHolder {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun initDisplayMetricsIfNotInitialized(context: Context) {
|
||||
if (screenDisplayMetrics != null) {
|
||||
return
|
||||
public fun initScreenDisplayMetricsIfNotInitialized(context: Context) {
|
||||
if (screenDisplayMetrics == null) {
|
||||
initScreenDisplayMetrics(context)
|
||||
}
|
||||
initDisplayMetrics(context)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun initDisplayMetrics(context: Context) {
|
||||
val displayMetrics = context.resources.displayMetrics
|
||||
windowDisplayMetrics = displayMetrics
|
||||
val screenDisplayMetrics = DisplayMetrics()
|
||||
screenDisplayMetrics.setTo(displayMetrics)
|
||||
public fun initWindowDisplayMetricsIfNotInitialized(context: Context) {
|
||||
if (windowDisplayMetrics == null) {
|
||||
initWindowDisplayMetrics(context)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun initScreenDisplayMetrics(context: Context) {
|
||||
val displayMetrics = DisplayMetrics()
|
||||
displayMetrics.setTo(context.resources.displayMetrics)
|
||||
|
||||
val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
|
||||
// Get the real display metrics if we are using API level 17 or higher.
|
||||
// The real metrics include system decor elements (e.g. soft menu bar).
|
||||
//
|
||||
// See:
|
||||
// http://developer.android.com/reference/android/view/Display.html#getRealMetrics(android.util.DisplayMetrics)
|
||||
@Suppress("DEPRECATION") wm.defaultDisplay.getRealMetrics(screenDisplayMetrics)
|
||||
DisplayMetricsHolder.screenDisplayMetrics = screenDisplayMetrics
|
||||
@Suppress("DEPRECATION") wm.defaultDisplay.getRealMetrics(displayMetrics)
|
||||
screenDisplayMetrics = displayMetrics
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: Unlike [initScreenDisplayMetrics], this method needs a UiContext (Activity of
|
||||
* InputMethodService) else WindowMetircsCalculator will throw an exception.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun initWindowDisplayMetrics(context: Context) {
|
||||
val displayMetrics = DisplayMetrics()
|
||||
displayMetrics.setTo(context.resources.displayMetrics)
|
||||
|
||||
if (isEdgeToEdgeFeatureFlagOn) {
|
||||
WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context).let { windowMetrics
|
||||
->
|
||||
displayMetrics.widthPixels = windowMetrics.bounds.width()
|
||||
displayMetrics.heightPixels = windowMetrics.bounds.height()
|
||||
}
|
||||
}
|
||||
|
||||
windowDisplayMetrics = displayMetrics
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public fun getDisplayMetricsWritableMap(fontScale: Double): WritableMap {
|
||||
checkNotNull(windowDisplayMetrics) { INITIALIZATION_MISSING_MESSAGE }
|
||||
checkNotNull(screenDisplayMetrics) { INITIALIZATION_MISSING_MESSAGE }
|
||||
checkNotNull(windowDisplayMetrics) { WINDOW_INITIALIZATION_MISSING_MESSAGE }
|
||||
checkNotNull(screenDisplayMetrics) { SCREEN_INITIALIZATION_MISSING_MESSAGE }
|
||||
|
||||
return WritableNativeMap().apply {
|
||||
putMap(
|
||||
@@ -112,33 +140,4 @@ public object DisplayMetricsHolder {
|
||||
WindowInsetsCompat.Type.displayCutout())
|
||||
.top
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the encoded screen size without vertical insets.
|
||||
*
|
||||
* This is needed to render components that needs to be correctly positioned on the screen on
|
||||
* their first frame. Modal is one of such components.
|
||||
*
|
||||
* @param activity the [Activity] to get the insets from.
|
||||
* @return the encoded screen size as a [Long] value, where the first 32 bits represent the width
|
||||
* and the last 32 bits represent the height in dp (density-independent pixels).
|
||||
*/
|
||||
// This annotation can be removed once FabricUIManager is migrated to Kotlin
|
||||
@JvmName("getEncodedScreenSizeWithoutVerticalInsets")
|
||||
@JvmStatic
|
||||
internal fun getEncodedScreenSizeWithoutVerticalInsets(activity: Activity?): Long {
|
||||
val windowInsets = activity?.window?.decorView?.let(ViewCompat::getRootWindowInsets) ?: return 0
|
||||
val insets =
|
||||
windowInsets.getInsets(
|
||||
WindowInsetsCompat.Type.statusBars() or
|
||||
WindowInsetsCompat.Type.navigationBars() or
|
||||
WindowInsetsCompat.Type.displayCutout())
|
||||
val verticalInsets = insets.top + insets.bottom
|
||||
return encodeFloatsToLong(
|
||||
(checkNotNull(screenDisplayMetrics).widthPixels).toFloat().pxToDp(),
|
||||
(checkNotNull(screenDisplayMetrics).heightPixels - verticalInsets).toFloat().pxToDp())
|
||||
}
|
||||
|
||||
internal fun encodeFloatsToLong(width: Float, height: Float): Long =
|
||||
(width.toRawBits().toLong()) shl 32 or (height.toRawBits().toLong())
|
||||
}
|
||||
|
||||
-3
@@ -14,9 +14,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.yoga.YogaDirection
|
||||
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal object LayoutDirectionUtil {
|
||||
init {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
|
||||
-2
@@ -38,8 +38,6 @@ import com.facebook.yoga.YogaWrap;
|
||||
* explored, namely using the VirtualText class in JS and setting the correct set of validAttributes
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class LayoutShadowNode extends ReactShadowNodeImpl {
|
||||
static {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
|
||||
-3
@@ -14,9 +14,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
// - `kind == PARENT` checks whether the node can host children in the native tree.
|
||||
// - `kind != NONE` checks whether the node appears in the native tree.
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal enum class NativeKind {
|
||||
// Node is in the native hierarchy and the HierarchyOptimizer should assume it can host children
|
||||
// (e.g. because it's a ViewGroup). Note that it's okay if the node doesn't support children. When
|
||||
|
||||
-2
@@ -68,8 +68,6 @@ import javax.annotation.concurrent.NotThreadSafe;
|
||||
*/
|
||||
@NotThreadSafe
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class NativeViewHierarchyManager {
|
||||
|
||||
static {
|
||||
|
||||
-2
@@ -49,8 +49,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
* depending on where the views being added/removed are attached in the optimized hierarchy
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class NativeViewHierarchyOptimizer {
|
||||
|
||||
static {
|
||||
|
||||
-3
@@ -16,9 +16,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
* associated with it.
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class NoSuchNativeViewException(detailMessage: String) :
|
||||
IllegalViewOperationException(detailMessage) {
|
||||
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import androidx.core.util.Pools.SynchronizedPool
|
||||
@@ -22,9 +20,6 @@ import com.facebook.react.uimanager.events.Event
|
||||
|
||||
/** Event used to notify JS component about changes of its position or dimensions. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.WARNING)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
public class OnLayoutEvent private constructor() : Event<OnLayoutEvent>() {
|
||||
@VisibleForTesting internal var x: Int = 0
|
||||
@VisibleForTesting internal var y: Int = 0
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ public object PixelUtil {
|
||||
}
|
||||
|
||||
return TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP, value, DisplayMetricsHolder.getWindowDisplayMetrics())
|
||||
TypedValue.COMPLEX_UNIT_DIP, value, DisplayMetricsHolder.getScreenDisplayMetrics())
|
||||
}
|
||||
|
||||
/** Convert from DIP to PX */
|
||||
@@ -37,7 +37,7 @@ public object PixelUtil {
|
||||
return Float.NaN
|
||||
}
|
||||
|
||||
val displayMetrics = DisplayMetricsHolder.getWindowDisplayMetrics()
|
||||
val displayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics()
|
||||
val scaledValue = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, value, displayMetrics)
|
||||
|
||||
if (maxFontScale >= 1) {
|
||||
@@ -60,13 +60,13 @@ public object PixelUtil {
|
||||
return Float.NaN
|
||||
}
|
||||
|
||||
return value / DisplayMetricsHolder.getWindowDisplayMetrics().density
|
||||
return value / DisplayMetricsHolder.getScreenDisplayMetrics().density
|
||||
}
|
||||
|
||||
/** @return [Float] that represents the density of the display metrics for device screen. */
|
||||
@JvmStatic
|
||||
public fun getDisplayMetricDensity(): Float =
|
||||
DisplayMetricsHolder.getWindowDisplayMetrics().density
|
||||
DisplayMetricsHolder.getScreenDisplayMetrics().density
|
||||
|
||||
/* Kotlin extensions */
|
||||
public fun Int.dpToPx(): Float = toPixelFromDIP(this.toFloat())
|
||||
|
||||
-2
@@ -46,8 +46,6 @@ import com.facebook.yoga.YogaWrap;
|
||||
* NativeViewHierarchyOptimizer} for more information.
|
||||
*/
|
||||
@LegacyArchitecture
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public interface ReactShadowNode<T extends ReactShadowNode> {
|
||||
|
||||
/**
|
||||
|
||||
-2
@@ -60,8 +60,6 @@ import java.util.Arrays;
|
||||
*/
|
||||
@ReactPropertyHolder
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl> {
|
||||
|
||||
private static final YogaConfig sYogaConfig;
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import android.util.SparseArray
|
||||
@@ -22,9 +20,6 @@ import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
* UIManagerModule instance.
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class ShadowNodeRegistry {
|
||||
private val tagsToCSSNodes = SparseArray<ReactShadowNode<*>>()
|
||||
private val rootTags = SparseBooleanArray()
|
||||
|
||||
-1
@@ -17,7 +17,6 @@ import android.view.View
|
||||
*
|
||||
* @param <T> the view handled by this manager
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
public abstract class SimpleViewManager<T : View> : BaseViewManager<T, LayoutShadowNode>() {
|
||||
|
||||
public override fun createShadowNodeInstance(): LayoutShadowNode {
|
||||
|
||||
+1
-3
@@ -9,7 +9,5 @@ package com.facebook.react.uimanager
|
||||
|
||||
/** A task to execute on the UI View for third party libraries. */
|
||||
public fun interface UIBlock {
|
||||
public fun execute(
|
||||
@Suppress("DEPRECATION") nativeViewHierarchyManager: NativeViewHierarchyManager
|
||||
)
|
||||
public fun execute(nativeViewHierarchyManager: NativeViewHierarchyManager)
|
||||
}
|
||||
|
||||
-2
@@ -42,8 +42,6 @@ import java.util.Map;
|
||||
* hierarchy that is then mapped to a native view hierarchy.
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class UIImplementation {
|
||||
static {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
|
||||
+11
-4
@@ -12,6 +12,7 @@ import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_M
|
||||
import static com.facebook.react.uimanager.common.UIManagerType.FABRIC;
|
||||
import static com.facebook.react.uimanager.common.UIManagerType.LEGACY;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.View;
|
||||
@@ -88,8 +89,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
*/
|
||||
@ReactModule(name = UIManagerModule.NAME)
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class UIManagerModule extends ReactContextBaseJavaModule
|
||||
implements OnBatchCompleteListener, LifecycleEventListener, UIManager {
|
||||
static {
|
||||
@@ -128,7 +127,11 @@ public class UIManagerModule extends ReactContextBaseJavaModule
|
||||
ViewManagerResolver viewManagerResolver,
|
||||
int minTimeLeftInFrameForNonBatchedOperationMs) {
|
||||
super(reactContext);
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
|
||||
DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized(reactContext);
|
||||
Activity currentActivity = reactContext.getCurrentActivity();
|
||||
if (currentActivity != null) {
|
||||
DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized(currentActivity);
|
||||
}
|
||||
mEventDispatcher = new EventDispatcherImpl(reactContext);
|
||||
mModuleConstants = createConstants(viewManagerResolver);
|
||||
mCustomDirectEvents = UIManagerModuleConstants.directEventTypeConstants;
|
||||
@@ -148,7 +151,11 @@ public class UIManagerModule extends ReactContextBaseJavaModule
|
||||
List<ViewManager> viewManagersList,
|
||||
int minTimeLeftInFrameForNonBatchedOperationMs) {
|
||||
super(reactContext);
|
||||
DisplayMetricsHolder.initDisplayMetricsIfNotInitialized(reactContext);
|
||||
DisplayMetricsHolder.initScreenDisplayMetricsIfNotInitialized(reactContext);
|
||||
Activity currentActivity = reactContext.getCurrentActivity();
|
||||
if (currentActivity != null) {
|
||||
DisplayMetricsHolder.initWindowDisplayMetricsIfNotInitialized(currentActivity);
|
||||
}
|
||||
mEventDispatcher = new EventDispatcherImpl(reactContext);
|
||||
mCustomDirectEvents = MapBuilder.newHashMap();
|
||||
mModuleConstants = createConstants(viewManagersList, null, mCustomDirectEvents);
|
||||
|
||||
-2
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
|
||||
-2
@@ -49,8 +49,6 @@ import java.util.Map;
|
||||
* for operations queue to save on allocations
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
since = "This class is part of Legacy Architecture and will be removed in a future release")
|
||||
public class UIViewOperationQueue {
|
||||
|
||||
static {
|
||||
|
||||
-5
@@ -5,8 +5,6 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.facebook.react.uimanager
|
||||
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
@@ -19,9 +17,6 @@ import java.util.Objects
|
||||
* operation.
|
||||
*/
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class ViewAtIndex(
|
||||
@Suppress("NoHungarianNotation") @JvmField public val mTag: Int,
|
||||
@Suppress("NoHungarianNotation") @JvmField public val mIndex: Int
|
||||
|
||||
-1
@@ -13,7 +13,6 @@ import com.facebook.react.bridge.ReactApplicationContext
|
||||
import com.facebook.react.bridge.UiThreadUtil
|
||||
import java.util.WeakHashMap
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
public abstract class ViewGroupManager<T : ViewGroup>
|
||||
@JvmOverloads
|
||||
constructor(reactContext: ReactApplicationContext? = null) :
|
||||
|
||||
+6
-10
@@ -13,7 +13,6 @@ import com.facebook.react.bridge.ReadableArray
|
||||
import com.facebook.react.uimanager.ViewManagersPropertyCache.PropSetter
|
||||
import java.util.HashMap
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
public object ViewManagerPropertyUpdater {
|
||||
public fun interface Settable {
|
||||
public fun getProperties(props: MutableMap<String, String>)
|
||||
@@ -25,7 +24,7 @@ public object ViewManagerPropertyUpdater {
|
||||
}
|
||||
|
||||
@Suppress("FINITE_BOUNDS_VIOLATION_IN_JAVA")
|
||||
public interface ShadowNodeSetter<@Suppress("DEPRECATION") in T : ReactShadowNode<*>> : Settable {
|
||||
public interface ShadowNodeSetter<in T : ReactShadowNode<*>> : Settable {
|
||||
public fun setProperty(node: T, name: String, value: Any?)
|
||||
}
|
||||
|
||||
@@ -72,10 +71,7 @@ public object ViewManagerPropertyUpdater {
|
||||
|
||||
@JvmStatic
|
||||
@Deprecated("Use ViewManager#updateProperties to update a view's properties")
|
||||
public fun <@Suppress("DEPRECATION") T : ReactShadowNode<T>> updateProps(
|
||||
node: T,
|
||||
props: ReactStylesDiffMap
|
||||
) {
|
||||
public fun <T : ReactShadowNode<T>> updateProps(node: T, props: ReactStylesDiffMap) {
|
||||
val setter = findNodeSetter(node.javaClass)
|
||||
val iterator = props.backingMap.entryIterator
|
||||
while (iterator.hasNext()) {
|
||||
@@ -112,7 +108,7 @@ public object ViewManagerPropertyUpdater {
|
||||
return setter as ViewManagerSetter<ViewManager<V, *>, V>
|
||||
}
|
||||
|
||||
private fun <@Suppress("DEPRECATION") T : ReactShadowNode<T>> findNodeSetter(
|
||||
private fun <T : ReactShadowNode<T>> findNodeSetter(
|
||||
nodeClass: Class<out T>
|
||||
): ShadowNodeSetter<T> {
|
||||
var setter = SHADOW_NODE_SETTER_MAP[nodeClass]
|
||||
@@ -147,16 +143,16 @@ public object ViewManagerPropertyUpdater {
|
||||
private class FallbackViewManagerSetter<V : View>(
|
||||
viewManagerClass: Class<out ViewManager<V, *>>
|
||||
) : ViewManagerSetter<ViewManager<V, *>, V> {
|
||||
private val propSetters: Map<String, PropSetter> =
|
||||
private val mPropSetters: Map<String, PropSetter> =
|
||||
ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(viewManagerClass)
|
||||
|
||||
override fun setProperty(manager: ViewManager<V, *>, view: V, name: String, value: Any?) {
|
||||
val setter = propSetters[name]
|
||||
val setter = mPropSetters[name]
|
||||
setter?.updateViewProp(manager, view, value)
|
||||
}
|
||||
|
||||
override fun getProperties(props: MutableMap<String, String>) {
|
||||
for (setter in propSetters.values) {
|
||||
for (setter in mPropSetters.values) {
|
||||
props[setter.propName] = setter.propType
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -15,9 +15,6 @@ import com.facebook.yoga.YogaNode
|
||||
|
||||
/** Static holder for a recycling pool of YogaNodes. */
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal object YogaNodePool {
|
||||
init {
|
||||
LegacyArchitectureLogger.assertLegacyArchitecture(
|
||||
|
||||
+26
@@ -41,6 +41,8 @@ import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
||||
import com.facebook.react.common.annotations.VisibleForTesting
|
||||
import com.facebook.react.common.build.ReactBuildConfig
|
||||
import com.facebook.react.config.ReactFeatureFlags
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder
|
||||
import com.facebook.react.uimanager.DisplayMetricsHolder.getStatusBarHeightPx
|
||||
import com.facebook.react.uimanager.JSPointerDispatcher
|
||||
import com.facebook.react.uimanager.JSTouchDispatcher
|
||||
import com.facebook.react.uimanager.PixelUtil.pxToDp
|
||||
@@ -50,11 +52,13 @@ import com.facebook.react.uimanager.ThemedReactContext
|
||||
import com.facebook.react.uimanager.UIManagerModule
|
||||
import com.facebook.react.uimanager.events.EventDispatcher
|
||||
import com.facebook.react.views.common.ContextUtils
|
||||
import com.facebook.react.views.modal.ReactModalHostView.DialogRootViewGroup
|
||||
import com.facebook.react.views.view.ReactViewGroup
|
||||
import com.facebook.react.views.view.disableEdgeToEdge
|
||||
import com.facebook.react.views.view.enableEdgeToEdge
|
||||
import com.facebook.react.views.view.isEdgeToEdgeFeatureFlagOn
|
||||
import com.facebook.react.views.view.setStatusBarTranslucency
|
||||
import com.facebook.yoga.annotations.DoNotStrip
|
||||
|
||||
/**
|
||||
* ReactModalHostView is a view that sits in the view hierarchy representing a Modal view.
|
||||
@@ -69,6 +73,7 @@ import com.facebook.react.views.view.setStatusBarTranslucency
|
||||
* addition and removal of views to the DialogRootViewGroup.
|
||||
*/
|
||||
@SuppressLint("ViewConstructor")
|
||||
@DoNotStrip
|
||||
public class ReactModalHostView(context: ThemedReactContext) :
|
||||
ViewGroup(context), LifecycleEventListener {
|
||||
|
||||
@@ -127,6 +132,7 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
private var createNewDialog = false
|
||||
|
||||
init {
|
||||
initStatusBarHeight(context)
|
||||
dialogRootViewGroup = DialogRootViewGroup(context)
|
||||
}
|
||||
|
||||
@@ -479,6 +485,26 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
||||
|
||||
private companion object {
|
||||
private const val TAG = "ReactModalHost"
|
||||
|
||||
// We store the status bar height to be able to properly position
|
||||
// the modal on the first render.
|
||||
private var statusBarHeight = 0
|
||||
|
||||
private fun initStatusBarHeight(reactContext: ReactContext) {
|
||||
statusBarHeight = getStatusBarHeightPx(reactContext.currentActivity)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@DoNotStrip
|
||||
private fun getScreenDisplayMetricsWithoutInsets(): Long {
|
||||
val displayMetrics = DisplayMetricsHolder.getScreenDisplayMetrics()
|
||||
return encodeFloatsToLong(
|
||||
displayMetrics.widthPixels.toFloat().pxToDp(),
|
||||
(displayMetrics.heightPixels - statusBarHeight).toFloat().pxToDp())
|
||||
}
|
||||
|
||||
private fun encodeFloatsToLong(width: Float, height: Float): Long =
|
||||
(width.toRawBits().toLong()) shl 32 or (height.toRawBits().toLong())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-6
@@ -14,6 +14,7 @@ import com.facebook.react.common.annotations.LegacyArchitectureShadowNodeWithCxx
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitecture
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogLevel
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger
|
||||
import com.facebook.react.uimanager.LayoutShadowNode
|
||||
import com.facebook.react.uimanager.annotations.ReactProp
|
||||
import com.facebook.yoga.YogaMeasureFunction
|
||||
import com.facebook.yoga.YogaMeasureMode
|
||||
@@ -24,14 +25,9 @@ import com.facebook.yoga.YogaNode
|
||||
* Node responsible for holding the style of the ProgressBar, see under [ ] for possible styles.
|
||||
* ReactProgressBarViewManager manages how this style is applied to the ProgressBar.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@LegacyArchitecture(logLevel = LegacyArchitectureLogLevel.ERROR)
|
||||
@LegacyArchitectureShadowNodeWithCxxImpl
|
||||
@Deprecated(
|
||||
message = "This class is part of Legacy Architecture and will be removed in a future release",
|
||||
level = DeprecationLevel.WARNING)
|
||||
internal class ProgressBarShadowNode :
|
||||
com.facebook.react.uimanager.LayoutShadowNode(), YogaMeasureFunction {
|
||||
internal class ProgressBarShadowNode : LayoutShadowNode(), YogaMeasureFunction {
|
||||
private val height: SparseIntArray = SparseIntArray()
|
||||
private val width: SparseIntArray = SparseIntArray()
|
||||
private val measured: MutableSet<Int> = HashSet()
|
||||
|
||||
-1
@@ -33,7 +33,6 @@ import java.util.WeakHashMap
|
||||
* a [ProgressBar] changes, we have to drop the existing [ProgressBar] (if there is one) and create
|
||||
* a new one with the style given.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
@ReactModule(name = ReactProgressBarViewManager.REACT_CLASS)
|
||||
internal class ReactProgressBarViewManager :
|
||||
BaseViewManager<ProgressBarContainerView, ProgressBarShadowNode>(),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user