diff --git a/frontend-admin/app.json b/frontend-admin/app.json index 89c61f85..fc677764 100644 --- a/frontend-admin/app.json +++ b/frontend-admin/app.json @@ -6,7 +6,7 @@ "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "dark", - "newArchEnabled": false, + "newArchEnabled": true, "splash": { "image": "./assets/splash-icon.png", "resizeMode": "contain", diff --git a/frontend-admin/node_modules/.package-lock.json b/frontend-admin/node_modules/.package-lock.json index 261cf3fd..5d9c3cd7 100644 --- a/frontend-admin/node_modules/.package-lock.json +++ b/frontend-admin/node_modules/.package-lock.json @@ -441,41 +441,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", - "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -1019,20 +984,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-object-assign": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.27.1.tgz", - "integrity": "sha512-LP6tsnirA6iy13uBKiYgjJsfQrodmlSrpZModtlo1Vk8sOO68gfo7dfA9TGJyEgxTiO7czK4EGZm8FJEZtk4kQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-transform-object-rest-spread": { "version": "7.28.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.28.6.tgz", @@ -6650,24 +6601,29 @@ } }, "node_modules/react-native-reanimated": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.6.3.tgz", - "integrity": "sha512-2KkkPozoIvDbJcHuf8qeyoLROXQxizSi+2CTCkuNVkVZOxxY4B0Omvgq61aOQhSZUh/649x1YHoAaTyGMGDJUw==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.1.6.tgz", + "integrity": "sha512-F+ZJBYiok/6Jzp1re75F/9aLzkgoQCOh4yxrnwATa8392RvM3kx+fiXXFvwcgE59v48lMwd9q0nzF1oJLXpfxQ==", "dependencies": { - "@babel/plugin-transform-object-assign": "^7.16.7", - "@babel/preset-typescript": "^7.16.7", - "convert-source-map": "^2.0.0", - "invariant": "^2.2.4" + "react-native-is-edge-to-edge": "^1.2.1", + "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0", - "@babel/plugin-proposal-optional-chaining": "^7.0.0-0", - "@babel/plugin-transform-arrow-functions": "^7.0.0-0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", - "@babel/plugin-transform-template-literals": "^7.0.0-0", "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-worklets": ">=0.5.0" + } + }, + "node_modules/react-native-reanimated/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/react-native-safe-area-context": { diff --git a/frontend-admin/node_modules/react-native-reanimated/README.md b/frontend-admin/node_modules/react-native-reanimated/README.md index b8ac3a74..fd1efcc5 100644 --- a/frontend-admin/node_modules/react-native-reanimated/README.md +++ b/frontend-admin/node_modules/react-native-reanimated/README.md @@ -1,33 +1,32 @@ React Native Reanimated by Software Mansion -### React Native's Animated library reimplemented +### Create smooth animations with an excellent developer experience. -> Reanimated 3 is here! Check out our [documentation page](https://docs.swmansion.com/react-native-reanimated/) for more information - -React Native Reanimated provides a more comprehensive, -low level abstraction for the Animated library API to be built -on top of and hence allow for much greater flexibility especially when it -comes to gesture based interactions. +> Reanimated 4 is here! Check out our [documentation page](https://docs.swmansion.com/react-native-reanimated/) for more information ### Nightly CI state -[![Build nightly npm package](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-nightly-npm-package.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-nightly-npm-package.yml) -[![Run nightly monorepo test](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-monorepo-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-monorepo-nightly.yml) -[![Check static framework nightly build](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-static-framework-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-static-framework-nightly.yml) -[![Check React Native nightly build](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-react-native-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-react-native-nightly.yml) -[![Check Expo dev-client nightly build](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-expo-dev-client-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-expo-dev-client-nightly.yml) -[![Check TypeScript nightly build](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-TS-react-native.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/check-TS-react-native.yml) -[![Test V8 on Android nightly](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-v8-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-v8-nightly.yml) -[![Test build on Windows nightly](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-on-windows-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/build-on-windows-nightly.yml) -[![Validate urls in source code](https://github.com/software-mansion/react-native-reanimated/actions/workflows/detect-broken-urls-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/detect-broken-urls-nightly.yml) +[![NPM Reanimated publish nightly](https://github.com/software-mansion/react-native-reanimated/actions/workflows/npm-reanimated-publish-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/npm-reanimated-publish-nightly.yml) +[![NPM Worklets publish [Nightly]](https://github.com/software-mansion/react-native-reanimated/actions/workflows/npm-worklets-publish-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/npm-worklets-publish-nightly.yml) +[![Lint clang-tidy [Nightly]](https://github.com/software-mansion/react-native-reanimated/actions/workflows/lint-clang-tidy-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/lint-clang-tidy-nightly.yml) +[![Reanimated compatibility check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-compatibility-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-compatibility-check-nightly.yml) +[![Use frameworks Reanimated build check [Nightly]](https://github.com/software-mansion/react-native-reanimated/actions/workflows/use-frameworks-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/use-frameworks-reanimated-build-check-nightly.yml) +[![React Native nightly Reanimated build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/react-native-nightly-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/react-native-nightly-reanimated-build-check-nightly.yml) +[![Expo DevClient build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/expo-devclient-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/expo-devclient-build-check-nightly.yml) +[![Reanimated TypeScript compatibility test](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-typescript-compatibility-test-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/reanimated-typescript-compatibility-test-nightly.yml) +[![Windows hosted app Reanimated build check](https://github.com/software-mansion/react-native-reanimated/actions/workflows/windows-hosted-app-reanimated-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/windows-hosted-app-reanimated-build-check-nightly.yml) +[![Worklets Bundle Mode build check [Nightly]](https://github.com/software-mansion/react-native-reanimated/actions/workflows/worklets-bundle-mode-build-check-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/worklets-bundle-mode-build-check-nightly.yml) +[![URL validation](https://github.com/software-mansion/react-native-reanimated/actions/workflows/url-validation-nightly.yml/badge.svg)](https://github.com/software-mansion/react-native-reanimated/actions/workflows/url-validation-nightly.yml) ## Installation Check out the [installation](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/#installation) section of our docs for the detailed installation instructions. -## Fabric +## Compatibility -To learn how to use `react-native-reanimated` with Fabric architecture, head over to [Fabric README](README-Fabric.md). Instructions on how to run Fabric Example within this repo can be found in the [FabricExample README](FabricExample/README.md). +React Native Reanimated 4.x supports only the [New React Native architecture](https://reactnative.dev/architecture/landing-page) and three latest React Native versions. + +If your app still runs on the old architecture, please consider adopting the New Architecture or stay with latest 3.x release. ## Documentation @@ -35,8 +34,8 @@ Check out our dedicated documentation page for info about this library, API refe ## Examples -The source code for the example (showcase) app is under the [`Example/`](https://github.com/software-mansion/react-native-reanimated/blob/main/Example/) directory. -If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Check Example/ directory README for installation instructions. +The source code for the example (showcase) app is under the [`apps/common-app`](https://github.com/software-mansion/react-native-reanimated/blob/main/apps/common-app/) directory. +If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Check [Example README](apps/fabric-example/README.md) for installation instructions. ## License @@ -49,3 +48,11 @@ This project has been built and is maintained thanks to the support from [Shopif [![shopify](https://avatars1.githubusercontent.com/u/8085?v=3&s=100 'Shopify.com')](https://shopify.com) [![expo](https://avatars2.githubusercontent.com/u/12504344?v=3&s=100 'Expo.io')](https://expo.io) [![swm](https://logo.swmansion.com/logo?color=white&variant=desktop&width=150&tag=react-native-reanimated-github 'Software Mansion')](https://swmansion.com) + +## Community Discord + +[Join the Software Mansion Community Discord](https://discord.swmansion.com) to chat about Reanimated or other Software Mansion libraries. + +## Reanimated is created by Software Mansion + +Since 2012 [Software Mansion](https://swmansion.com) is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – [Hire us](https://swmansion.com/contact/projects?utm_source=reanimated&utm_medium=readme). diff --git a/frontend-admin/node_modules/react-native-reanimated/RNReanimated.podspec b/frontend-admin/node_modules/react-native-reanimated/RNReanimated.podspec index 8e539f56..dba0fade 100644 --- a/frontend-admin/node_modules/react-native-reanimated/RNReanimated.podspec +++ b/frontend-admin/node_modules/react-native-reanimated/RNReanimated.podspec @@ -3,65 +3,22 @@ require_relative './scripts/reanimated_utils' reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json"))) $config = find_config() -assert_latest_react_native_with_new_architecture($config, reanimated_package_json) assert_minimal_react_native_version($config) -$new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' -is_release = ENV['PRODUCTION'] == '1' +$new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] != '0' +assert_new_architecture_enabled($new_arch_enabled) -folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DREACT_NATIVE_MINOR_VERSION=' + $config[:react_native_minor_version].to_s -folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32' boost_compiler_flags = '-Wno-documentation' -fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : '' example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' -version_flag = '-DREANIMATED_VERSION=' + reanimated_package_json["version"] -debug_flag = is_release ? '-DNDEBUG' : '' -ios_min_version = $config[:react_native_minor_version] >= 73 ? '13.4' : '9.0' +version_flags = "-DREACT_NATIVE_MINOR_VERSION=#{$config[:react_native_minor_version]} -DREANIMATED_VERSION=#{reanimated_package_json['version']}" +ios_min_version = '13.4' -def self.install_modules_dependencies_legacy(s) - using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' - s.dependency "React-Core" - if $new_arch_enabled - s.dependency "React-RCTFabric" - s.dependency "React-Codegen" - end - s.dependency "RCT-Folly" - s.dependency "RCTRequired" - s.dependency "RCTTypeSafety" - s.dependency 'FBLazyVector' - if $config[:react_native_minor_version] <= 71 - s.dependency 'FBReactNativeSpec' - end - s.dependency 'React-Core' - s.dependency 'React-CoreModules' - s.dependency 'React-Core/DevSupport' - if !$config[:is_tvos_target] - s.dependency 'React-RCTActionSheet' - end - s.dependency 'React-RCTNetwork' - s.dependency 'React-RCTAnimation' - s.dependency 'React-RCTLinking' - s.dependency 'React-RCTBlob' - s.dependency 'React-RCTSettings' - s.dependency 'React-RCTText' - s.dependency 'React-RCTImage' - s.dependency 'React-Core/RCTWebSocket' - s.dependency 'React-cxxreact' - s.dependency 'React-jsi' - s.dependency 'React-jsiexecutor' - s.dependency 'React-jsinspector' - s.dependency 'Yoga' - s.dependency 'DoubleConversion' - s.dependency 'glog' - if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70 - s.dependency 'React-hermes' - s.dependency 'hermes-engine' - end - s.dependency 'React-callinvoker' - if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled - s.dependency 'React-RCTAppDelegate' - end -end +# Directory in which data for further processing for clangd will be stored. +compilation_metadata_dir = "CompilationDatabase" +# We want generate the metadata only within the monorepo of Reanimated. +compilation_metadata_generation_flag = $config[:is_reanimated_example_app] ? "-gen-cdb-fragment-path #{compilation_metadata_dir}" : '' + +feature_flags = "-DREANIMATED_FEATURE_FLAGS=\"#{get_static_feature_flags()}\"" Pod::Spec.new do |s| @@ -74,42 +31,68 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/software-mansion/react-native-reanimated" s.license = "MIT" s.author = { "author" => "author@domain.cn" } - s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" } + s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14", :visionos => "1.0" } s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } - s.source_files = [ - "apple/**/*.{mm,h,m}", - "Common/cpp/**/*.{cpp,h}" - ] + s.dependency "RNWorklets" - s.preserve_paths = [ - "Common/cpp/hidden_headers/**" - ] + s.subspec "reanimated" do |ss| + ss.source_files = "Common/cpp/reanimated/**/*.{cpp,h}" + ss.header_dir = "reanimated" + ss.header_mappings_dir = "Common/cpp/reanimated" - gcc_debug_definitions = "$(inherited)" - if $config[:react_native_minor_version] >= 73 || !is_release - gcc_debug_definitions << " HERMES_ENABLE_DEBUGGER=1" + ss.subspec "apple" do |sss| + sss.source_files = "apple/reanimated/**/*.{mm,h,m}" + sss.header_dir = "reanimated" + sss.header_mappings_dir = "apple/reanimated" + end end s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", "DEFINES_MODULE" => "YES", - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Private/Yoga\"", - "FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"", - "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", - "GCC_PREPROCESSOR_DEFINITIONS[config=Debug]" => gcc_debug_definitions, - "GCC_PREPROCESSOR_DEFINITIONS[config=Release]" => "$(inherited) NDEBUG=1", + "HEADER_SEARCH_PATHS" => [ + '"$(PODS_TARGET_SRCROOT)/ReactCommon"', + '"$(PODS_TARGET_SRCROOT)"', + '"$(PODS_ROOT)/RCT-Folly"', + '"$(PODS_ROOT)/boost"', + '"$(PODS_ROOT)/boost-for-react-native"', + '"$(PODS_ROOT)/DoubleConversion"', + '"$(PODS_ROOT)/Headers/Private/React-Core"', + '"$(PODS_ROOT)/Headers/Private/Yoga"', + '"$(PODS_ROOT)/Headers/Public/RNWorklets"', + ].join(' '), + "FRAMEWORK_SEARCH_PATHS" => '"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes"', + "CLANG_CXX_LANGUAGE_STANDARD" => "c++20", + "GCC_PREPROCESSOR_DEFINITIONS[config=*Debug*]" => '$(inherited)', + "GCC_PREPROCESSOR_DEFINITIONS[config=*Release*]" => '$(inherited)', } - s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + s.compiler_flags = boost_compiler_flags s.xcconfig = { - "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\" \"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"", - "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags + " " + example_flag + " " + version_flag + " " + debug_flag + "HEADER_SEARCH_PATHS" => [ + '"$(PODS_ROOT)/boost"', + '"$(PODS_ROOT)/boost-for-react-native"', + '"$(PODS_ROOT)/glog"', + '"$(PODS_ROOT)/RCT-Folly"', + '"$(PODS_ROOT)/Headers/Public/React-hermes"', + '"$(PODS_ROOT)/Headers/Public/hermes-engine"', + '"$(PODS_ROOT)/Headers/Public/RNWorklets"', + "\"$(PODS_ROOT)/#{$config[:react_native_common_dir]}\"", + "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_reanimated_dir]}/apple\"", + "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_reanimated_dir]}/Common/cpp\"", + "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_reanimated_dir]}/Common/NativeView\"", + "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/apple\"", + "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/Common/cpp\"", + ].join(' '), + "OTHER_CFLAGS" => "$(inherited) #{example_flag} #{version_flags} #{compilation_metadata_generation_flag} #{feature_flags}", } s.requires_arc = true - s.dependency "ReactCommon/turbomodule/core" - if defined?(install_modules_dependencies()) != nil - install_modules_dependencies(s) - else - install_modules_dependencies_legacy(s) + + install_modules_dependencies(s) + + s.dependency 'React-jsi' + using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1' + if using_hermes && !$config[:is_tvos_target] + s.dependency 'React-hermes' end end diff --git a/frontend-admin/node_modules/react-native-reanimated/android/CMakeLists.txt b/frontend-admin/node_modules/react-native-reanimated/android/CMakeLists.txt index 8ba41221..c4e4df92 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/CMakeLists.txt +++ b/frontend-admin/node_modules/react-native-reanimated/android/CMakeLists.txt @@ -1,319 +1,102 @@ project(Reanimated) cmake_minimum_required(VERSION 3.8) -set (CMAKE_VERBOSE_MAKEFILE ON) -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 73) - set (CMAKE_CXX_STANDARD 20) -else() - set (CMAKE_CXX_STANDARD 17) -endif() +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# default CMAKE_CXX_FLAGS: "-g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-protector-all" +set(CMAKE_CXX_STANDARD 20) -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake") - add_compile_options(${folly_FLAGS}) -else() - set(folly_FLAGS "-DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1") - string(APPEND CMAKE_CXX_FLAGS " ${folly_FLAGS}") -endif() +# default CMAKE_CXX_FLAGS: "-g -DANDROID -fdata-sections -ffunction-sections +# -funwind-tables -fstack-protector-strong -no-canonical-prefixes +# -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-protector-all" +include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake") +add_compile_options(${folly_FLAGS}) -string(APPEND CMAKE_CXX_FLAGS " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION} -DREANIMATED_VERSION=${REANIMATED_VERSION} -DHERMES_ENABLE_DEBUGGER=${HERMES_ENABLE_DEBUGGER}") +string( + APPEND + CMAKE_CXX_FLAGS + " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}\ + -DREANIMATED_VERSION=${REANIMATED_VERSION}\ + -DREANIMATED_FEATURE_FLAGS=\"${REANIMATED_FEATURE_FLAGS}\"") +string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -fstack-protector-all") +# flags to optimize the binary size +string(APPEND CMAKE_CXX_FLAGS " -fvisibility=hidden -ffunction-sections -fdata-sections") -string(APPEND CMAKE_CXX_FLAGS " -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++${CMAKE_CXX_STANDARD} -Wall -Werror") - -if(${IS_NEW_ARCHITECTURE_ENABLED}) - string(APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED") +if(${REANIMATED_PROFILING}) + string(APPEND CMAKE_CXX_FLAGS " -DREANIMATED_PROFILING") endif() if(${IS_REANIMATED_EXAMPLE_APP}) - string(APPEND CMAKE_CXX_FLAGS " -DIS_REANIMATED_EXAMPLE_APP") + string(APPEND CMAKE_CXX_FLAGS " -DIS_REANIMATED_EXAMPLE_APP -Wpedantic") endif() if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") - string(APPEND CMAKE_CXX_FLAGS " -DNDEBUG") + string(APPEND CMAKE_CXX_FLAGS " -DNDEBUG") endif() -set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "") +set(BUILD_DIR "${CMAKE_SOURCE_DIR}/build") +set(ANDROID_CPP_DIR "${CMAKE_SOURCE_DIR}/src/main/cpp") +set(COMMON_CPP_DIR "${CMAKE_SOURCE_DIR}/../Common/cpp") -set (PACKAGE_NAME "reanimated") -set (BUILD_DIR ${CMAKE_SOURCE_DIR}/build) -set (SRC_DIR ${CMAKE_SOURCE_DIR}/src) -set (COMMON_SRC_DIR "${CMAKE_SOURCE_DIR}/../Common") +file(GLOB_RECURSE REANIMATED_COMMON_CPP_SOURCES CONFIGURE_DEPENDS + "${COMMON_CPP_DIR}/reanimated/*.cpp") +file(GLOB_RECURSE REANIMATED_ANDROID_CPP_SOURCES CONFIGURE_DEPENDS + "${ANDROID_CPP_DIR}/reanimated/*.cpp") -file(GLOB_RECURSE SOURCES_COMMON CONFIGURE_DEPENDS "${COMMON_SRC_DIR}/cpp/**.cpp") -file(GLOB_RECURSE SOURCES_ANDROID CONFIGURE_DEPENDS "${SRC_DIR}/main/cpp/**.cpp") +find_package(fbjni REQUIRED CONFIG) +find_package(ReactAndroid REQUIRED CONFIG) -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - # Consume shared libraries and headers from prefabs - find_package(fbjni REQUIRED CONFIG) - find_package(ReactAndroid REQUIRED CONFIG) - if(${JS_RUNTIME} STREQUAL "hermes") - find_package(hermes-engine REQUIRED CONFIG) - endif() +add_library(reanimated SHARED ${REANIMATED_COMMON_CPP_SOURCES} + ${REANIMATED_ANDROID_CPP_SOURCES}) + +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 80) + include( + "${REACT_NATIVE_DIR}/ReactCommon/cmake-utils/react-native-flags.cmake") + target_compile_reactnative_options(reanimated PUBLIC) else() - # Consume shared libraries from found .so files - if(${IS_NEW_ARCHITECTURE_ENABLED}) - message(FATAL_ERROR "not supported") - else() - set (RN_SO_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/react/jni") - set (FBJNI_HEADERS_DIR "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/first-party/fbjni/headers") - endif() - file (GLOB LIBRN_DIR "${RN_SO_DIR}/${ANDROID_ABI}") + string(APPEND CMAKE_CXX_FLAGS + " -fexceptions -frtti -std=c++${CMAKE_CXX_STANDARD} -Wall -Werror") endif() -add_library( - ${PACKAGE_NAME} - SHARED - ${SOURCES_COMMON} - ${SOURCES_ANDROID} - ${INCLUDE_JSI_CPP} - ${INCLUDE_JSIDYNAMIC_CPP} -) - -# includes - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${COMMON_SRC_DIR}/cpp/AnimatedSensor" - "${COMMON_SRC_DIR}/cpp/Fabric" - "${COMMON_SRC_DIR}/cpp/hidden_headers" - "${COMMON_SRC_DIR}/cpp/LayoutAnimations" - "${COMMON_SRC_DIR}/cpp/NativeModules" - "${COMMON_SRC_DIR}/cpp/ReanimatedRuntime" - "${COMMON_SRC_DIR}/cpp/Registries" - "${COMMON_SRC_DIR}/cpp/SharedItems" - "${COMMON_SRC_DIR}/cpp/Tools" - "${SRC_DIR}/main/cpp" + reanimated + PRIVATE "${COMMON_CPP_DIR}" + "${ANDROID_CPP_DIR}" + "${REACT_NATIVE_DIR}/ReactCommon" + "${REACT_NATIVE_DIR}/ReactCommon/yoga" + "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/react/turbomodule" + "${REACT_NATIVE_DIR}/ReactCommon/callinvoker" + "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor" + "${REACT_NATIVE_DIR}/ReactCommon/jsiexecutor" + "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" + "${REACT_NATIVE_WORKLETS_DIR}/Common/cpp" + "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp") + +set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) + +if(${CMAKE_BUILD_TYPE} MATCHES "Debug") + set(BUILD_TYPE "debug") +else() + set(BUILD_TYPE "release") +endif() + +add_library(worklets SHARED IMPORTED) + +set_target_properties( + worklets + PROPERTIES + IMPORTED_LOCATION + "${REACT_NATIVE_WORKLETS_DIR}/android/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libworklets.so" ) -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni/react/turbomodule" - "${REACT_NATIVE_DIR}/ReactCommon" - "${REACT_NATIVE_DIR}/ReactCommon/callinvoker" - "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" - "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor" - "${REACT_NATIVE_DIR}/ReactCommon/yoga" - ) +set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) +# remove dead code sections +set_target_properties(reanimated PROPERTIES LINK_FLAGS "-Wl,--gc-sections") + +target_link_libraries(reanimated log ReactAndroid::jsi fbjni::fbjni android + worklets) + +if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries(reanimated ReactAndroid::reactnative) else() - file(GLOB LIBFBJNI_INCLUDE_DIR ${FBJNI_HEADERS_DIR}) - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${LIBFBJNI_INCLUDE_DIR}" - "${BUILD_DIR}/third-party-ndk/boost/boost_${BOOST_VERSION}" - "${BUILD_DIR}/third-party-ndk/double-conversion" - "${BUILD_DIR}/third-party-ndk/folly" - "${BUILD_DIR}/third-party-ndk/glog/exported" - "${REACT_NATIVE_DIR}/React" - "${REACT_NATIVE_DIR}/React/Base" - "${REACT_NATIVE_DIR}/ReactAndroid/src/main/jni" - "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni" - "${REACT_NATIVE_DIR}/ReactAndroid/src/main/java/com/facebook/react/fabric/jni" - "${REACT_NATIVE_DIR}/ReactCommon" - "${REACT_NATIVE_DIR}/ReactCommon/callinvoker" - "${REACT_NATIVE_DIR}/ReactCommon/jsi" - "${REACT_NATIVE_DIR}/ReactCommon/hermes" - "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" - "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor" - "${REACT_NATIVE_DIR}/ReactCommon/turbomodule/core" - "${REACT_NATIVE_DIR}/ReactCommon/turbomodule" - "${REACT_NATIVE_DIR}/ReactCommon/yoga" - ) + target_link_libraries(reanimated ReactAndroid::react_nativemodule_core) endif() - -# build shared lib - -set_target_properties(${PACKAGE_NAME} PROPERTIES LINKER_LANGUAGE CXX) - -target_link_libraries( - ${PACKAGE_NAME} - log - android -) - -if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - target_link_libraries( - ${PACKAGE_NAME} - ReactAndroid::folly_runtime - ReactAndroid::glog - ReactAndroid::jsi - ReactAndroid::reactnativejni - fbjni::fbjni - ) -else() - find_library( - JSI_LIB - jsi - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - find_library( - GLOG_LIB - glog - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - - find_library( - FBJNI_LIB - fbjni - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - - if(${REACT_NATIVE_MINOR_VERSION} LESS 69) - find_library( - FOLLY_LIB - folly_json - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - else() - find_library( - FOLLY_LIB - folly_runtime - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - endif() - - find_library( - REACTNATIVEJNI_LIB - reactnativejni - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - - target_link_libraries( - ${PACKAGE_NAME} - ${JSI_LIB} - ${GLOG_LIB} - ${FBJNI_LIB} - ${FOLLY_LIB} - ${REACTNATIVEJNI_LIB} - ) -endif() - -if(${JS_RUNTIME} STREQUAL "hermes") - string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1") - if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - # From prefab from module `com.facebook.react:hermes-android` - set(HERMES_LIB hermes-engine::libhermes) - elseif(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 69) - # Bundled Hermes from module `com.facebook.react:hermes-engine` or project `:ReactAndroid:hermes-engine` - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${JS_RUNTIME_DIR}/API" - "${JS_RUNTIME_DIR}/public" - ) - set(HERMES_LIB "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so") - else() - # From `hermes-engine` npm package - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${JS_RUNTIME_DIR}/android/include" - ) - set(HERMES_LIB "${BUILD_DIR}/third-party-ndk/hermes/jni/${ANDROID_ABI}/libhermes.so") - endif() - target_link_libraries( - ${PACKAGE_NAME} - ${HERMES_LIB} - ) - if (${HERMES_ENABLE_DEBUGGER}) - if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - set(HERMES_EXECUTOR_LIB ReactAndroid::hermes_executor) - else() - find_library( - HERMES_EXECUTOR_LIB - hermes-executor-debug - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - endif() - if(${REACT_NATIVE_MINOR_VERSION} LESS_EQUAL 67) - find_library( - HERMES_INSPECTOR_LIB - hermes-inspector - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - target_link_libraries( - ${PACKAGE_NAME} - ${HERMES_INSPECTOR_LIB} - ) - endif() - target_link_libraries( - ${PACKAGE_NAME} - ${HERMES_EXECUTOR_LIB} - ) - endif() -elseif(${JS_RUNTIME} STREQUAL "v8") - string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_V8=1") - target_include_directories( - ${PACKAGE_NAME} - PRIVATE - "${JS_RUNTIME_DIR}/src" - ) - file (GLOB V8_SO_DIR "${JS_RUNTIME_DIR}/android/build/intermediates/library_jni/*/jni/${ANDROID_ABI}") - find_library( - V8EXECUTOR_LIB - v8executor - PATHS ${V8_SO_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - target_link_libraries( - ${PACKAGE_NAME} - ${V8EXECUTOR_LIB} - ) -elseif(${JS_RUNTIME} STREQUAL "jsc") - string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_JSC=1") - if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71) - set(JSEXECUTOR_LIB ReactAndroid::jscexecutor) - else() - find_library( - JSEXECUTOR_LIB - jscexecutor - PATHS ${LIBRN_DIR} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH - ) - endif() - target_link_libraries(${PACKAGE_NAME} ${JSEXECUTOR_LIB}) -else() - message(FATAL_ERROR "Unknown JS runtime ${JS_RUNTIME}.") -endif() - -if(${IS_NEW_ARCHITECTURE_ENABLED}) - target_link_libraries( - ${PACKAGE_NAME} - ReactAndroid::fabricjni - ReactAndroid::react_debug - ReactAndroid::react_render_core - ReactAndroid::react_render_mounting - ReactAndroid::react_render_scheduler - ReactAndroid::react_render_uimanager - ReactAndroid::rrc_view - ) -endif() - -# Resolves "CMake Warning: Manually-specified variables were not used by the project" -# when any of the following variables is not used in some build configuration. -set (ignoreMe "${JS_RUNTIME_DIR}") -set (ignoreMe "${BOOST_VERSION}") diff --git a/frontend-admin/node_modules/react-native-reanimated/android/build.gradle b/frontend-admin/node_modules/react-native-reanimated/android/build.gradle index 3de90e57..6b73a69d 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/build.gradle +++ b/frontend-admin/node_modules/react-native-reanimated/android/build.gradle @@ -1,46 +1,7 @@ -import com.android.Version -import org.apache.tools.ant.filters.ReplaceTokens -import org.apache.tools.ant.taskdefs.condition.Os +import com.android.build.gradle.tasks.ExternalNativeBuildJsonTask import groovy.json.JsonSlurper - -import javax.inject.Inject -import java.nio.file.Files import java.nio.file.Paths - -/** - * Finds the path of the installed npm package with the given name using Node's - * module resolution algorithm, which searches "node_modules" directories up to - * the file system root. This handles various cases, including: - * - * - Working in the open-source RN repo: - * Gradle: /path/to/react-native/ReactAndroid - * Node module: /path/to/react-native/node_modules/[package] - * - * - Installing RN as a dependency of an app and searching for hoisted - * dependencies: - * Gradle: /path/to/app/node_modules/react-native/ReactAndroid - * Node module: /path/to/app/node_modules/[package] - * - * - Working in a larger repo (e.g., Facebook) that contains RN: - * Gradle: /path/to/repo/path/to/react-native/ReactAndroid - * Node module: /path/to/repo/node_modules/[package] - * - * The search begins at the given base directory (a File object). The returned - * path is a string. - */ -static def findNodeModulePath(baseDir, packageName) { - def basePath = baseDir.toPath().normalize() - // Node's module resolution algorithm searches up to the root directory, - // after which the base path will be null - while (basePath) { - def candidatePath = Paths.get(basePath.toString(), "node_modules", packageName) - if (candidatePath.toFile().exists()) { - return candidatePath.toString() - } - basePath = basePath.getParent() - } - return null -} +import org.apache.tools.ant.taskdefs.condition.Os def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback @@ -51,16 +12,6 @@ def safeAppExtGet(prop, fallback) { appProject?.ext?.has(prop) ? appProject.ext.get(prop) : fallback } -def resolveBuildType() { - Gradle gradle = getGradle() - String tskReqStr = gradle.getStartParameter().getTaskRequests()['args'].toString() - return tskReqStr.contains('Release') ? 'release' : 'debug' -} - -def isReanimatedExampleApp() { - return safeAppExtGet("isReanimatedExampleApp", false) -} - def isNewArchitectureEnabled() { // To opt-in for the New Architecture, you can either: // - Set `newArchEnabled` to true inside the `gradle.properties` file @@ -75,41 +26,54 @@ def resolveReactNativeDirectory() { return file(reactNativeLocation) } - if (isReanimatedExampleApp()) { - return file("$projectDir/../${getPlaygroundAppName()}/node_modules/react-native") - } - - // monorepo workaround - // react-native can be hoisted or in project's own node_modules - def reactNativeFromProjectNodeModules = file("${rootProject.projectDir}/../node_modules/react-native") - if (reactNativeFromProjectNodeModules.exists()) { - return reactNativeFromProjectNodeModules - } - - def reactNativeFromNodeModulesWithReanimated = file("${projectDir}/../../react-native") - if (reactNativeFromNodeModulesWithReanimated.exists()) { - return reactNativeFromNodeModulesWithReanimated + // Fallback to node resolver for custom directory structures like monorepos. + def reactNativePackage = file( + providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('react-native/package.json')") + }.standardOutput.asText.get().trim() + ) + if (reactNativePackage.exists()) { + return reactNativePackage.parentFile } throw new GradleException( - "[Reanimated] Unable to resolve react-native location in node_modules. You should project extension property (in `app/build.gradle`) `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." + "[Reanimated] Unable to resolve react-native location in node_modules. You should set project extension property (in `app/build.gradle`) named `REACT_NATIVE_NODE_MODULES_DIR` with the path to react-native in node_modules." ) } -def getPlaygroundAppName() { // only for the development - String playgroundAppName = "" - try { - rootProject.getSubprojects().forEach({project -> - if (project.plugins.hasPlugin("com.android.application")) { - var projectCatalogAbsolutePath = project.projectDir.toString().replace("/android/app", "") - var slashPosition = projectCatalogAbsolutePath.lastIndexOf("/") - playgroundAppName = projectCatalogAbsolutePath.substring(slashPosition + 1) - } - }) - } catch (_) { - throw new GradleException("[Reanimated] Couldn't determine playground app name.") +def resolveReactNativeWorkletsDirectory() { + def reactNativeWorkletsLocation = safeAppExtGet("REACT_NATIVE_WORKLETS_NODE_MODULES_DIR", null) + if (reactNativeWorkletsLocation != null) { + return file(reactNativeWorkletsLocation) } - return playgroundAppName + + // Fallback to node resolver for custom directory structures like monorepos. + def reactNativeWorkletsPackage = file( + providers.exec { + workingDir(rootDir) + commandLine("node", "--print", "require.resolve('react-native-worklets/package.json')") + }.standardOutput.asText.get().trim() + ) + if (reactNativeWorkletsPackage.exists()) { + return reactNativeWorkletsPackage.parentFile + } + + throw new GradleException( + "[Reanimated] Unable to resolve react-native-worklets location in node_modules. You should set project extension property (in `app/build.gradle`) named `REACT_NATIVE_WORKLETS_NODE_MODULES_DIR` with the path to react-native-worklets in node_modules." + ) +} + +def getReactNativeVersion() { + def reactNativeRootDir = resolveReactNativeDirectory() + def reactProperties = new Properties() + file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } + return reactProperties.getProperty("VERSION_NAME") +} + +def getReactNativeMinorVersion() { + def reactNativeVersion = getReactNativeVersion() + return reactNativeVersion.startsWith("0.0.0-") ? 1000 : reactNativeVersion.split("\\.")[1].toInteger() } def getReanimatedVersion() { @@ -118,11 +82,6 @@ def getReanimatedVersion() { return json.version } -def getReanimatedMajorVersion() { - def (major, minor, patch) = getReanimatedVersion().tokenize('.') - return major.toInteger() -} - def toPlatformFileString(String path) { if (Os.isFamily(Os.FAMILY_WINDOWS)) { path = path.replace(File.separatorChar, '/' as char) @@ -130,72 +89,47 @@ def toPlatformFileString(String path) { return path } -def reactNativeRootDir = resolveReactNativeDirectory() +def getReanimatedStaticFeatureFlags() { + def featureFlags = new HashMap() -def reactProperties = new Properties() -file("$reactNativeRootDir/ReactAndroid/gradle.properties").withInputStream { reactProperties.load(it) } - -def REACT_NATIVE_VERSION = reactProperties.getProperty("VERSION_NAME") -def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION.startsWith("0.0.0-") ? 1000 : REACT_NATIVE_VERSION.split("\\.")[1].toInteger() -def REANIMATED_VERSION = getReanimatedVersion() -def REANIMATED_MAJOR_VERSION = getReanimatedMajorVersion() -def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled() - -// for React Native <= 0.70 -def BOOST_VERSION = reactProperties.getProperty("BOOST_VERSION") -def DOUBLE_CONVERSION_VERSION = reactProperties.getProperty("DOUBLE_CONVERSION_VERSION") -def FOLLY_VERSION = reactProperties.getProperty("FOLLY_VERSION") -def GLOG_VERSION = reactProperties.getProperty("GLOG_VERSION") -def FBJNI_VERSION = "0.3.0" - -// We download various C++ open-source dependencies into downloads. -// We then copy both the downloaded code and our custom makefiles and headers into third-party-ndk. -// After that we build native code from src/main/jni with module path pointing at third-party-ndk. - -def customDownloadsDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR") -def downloadsDir = customDownloadsDir ? new File(customDownloadsDir) : new File("$buildDir/downloads") -def thirdPartyNdkDir = new File("$buildDir/third-party-ndk") - -def reactNativeThirdParty = new File("$reactNativeRootDir/ReactAndroid/src/main/jni/third-party") -def reactNativeAndroidDownloadDir = new File("$reactNativeRootDir/ReactAndroid/build/downloads") - -def prefabHeadersDir = project.file("$buildDir/prefab-headers/reanimated") - -def JS_RUNTIME = { - // Override JS runtime with environment variable - if (System.getenv("JS_RUNTIME")) { - return System.getenv("JS_RUNTIME") + def staticFeatureFlagsFile = file(projectDir.path + "/../src/featureFlags/staticFlags.json") + if (!staticFeatureFlagsFile.exists()) { + throw new GradleException("[Reanimated] Feature flags file not found at ${staticFeatureFlagsFile.absolutePath}.") + } + new JsonSlurper().parseText(staticFeatureFlagsFile.text).each { key, value -> + featureFlags[key] = value.toString() } - // Enable V8 runtime if react-native-v8 is installed - def v8Project = rootProject.getSubprojects().find { project -> project.name == "react-native-v8" } - if (v8Project != null) { - return "v8" - } - - // Check if Hermes is enabled in app setup - def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') } - if ((REACT_NATIVE_MINOR_VERSION >= 71 && appProject?.hermesEnabled?.toBoolean()) || appProject?.ext?.react?.enableHermes?.toBoolean()) { - return "hermes" - } - - // Use JavaScriptCore (JSC) by default - return "jsc" -}.call() - -def jsRuntimeDir = { - if (JS_RUNTIME == "hermes") { - if (REACT_NATIVE_MINOR_VERSION >= 69) { - return Paths.get(reactNativeRootDir.path, "sdks", "hermes") - } else { - return Paths.get(reactNativeRootDir.path, "..", "hermes-engine") + def packageJsonFile = file(rootDir.path + "/../package.json") + if (packageJsonFile.exists()) { + def packageJson = new JsonSlurper().parseText(packageJsonFile.text) + packageJson.reanimated?.staticFeatureFlags?.each { key, value -> + featureFlags[key] = value.toString() } - } else if (JS_RUNTIME == "v8") { - return findProject(":react-native-v8").getProjectDir().getParent() - } else { - return Paths.get(reactNativeRootDir.path, "ReactCommon", "jsi") } -}.call() + + return featureFlags.collect { key, value -> "[${key}:${value}]" }.join("") +} + +if (isNewArchitectureEnabled()) { + apply plugin: "com.facebook.react" +} + +def packageDir = project.projectDir.parentFile +def reactNativeRootDir = resolveReactNativeDirectory() +def reactNativeWorkletsRootDir = resolveReactNativeWorkletsDirectory() +def REACT_NATIVE_MINOR_VERSION = getReactNativeMinorVersion() +def REACT_NATIVE_VERSION = getReactNativeVersion() +def REANIMATED_VERSION = getReanimatedVersion() +def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled() +def IS_REANIMATED_EXAMPLE_APP = safeAppExtGet("isReanimatedExampleApp", false) +def REANIMATED_PROFILING = safeAppExtGet("enableReanimatedProfiling", false) +def REANIMATED_FEATURE_FLAGS = getReanimatedStaticFeatureFlags() + +// Set version for prefab +version REANIMATED_VERSION + +def reanimatedPrefabHeadersDir = project.file("$buildDir/prefab-headers/reanimated") def reactNativeArchitectures() { def value = project.getProperties().get("reactNativeArchitectures") @@ -206,14 +140,11 @@ buildscript { repositories { google() mavenCentral() - maven { - url "https://plugins.gradle.org/m2/" - } } dependencies { - classpath "com.android.tools.build:gradle:7.3.1" - classpath "de.undercouch:gradle-download-task:5.0.1" - classpath "com.diffplug.spotless:spotless-plugin-gradle:6.11.0" + classpath "com.android.tools.build:gradle:8.2.1" + classpath "de.undercouch:gradle-download-task:5.6.0" + classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0" } } @@ -226,12 +157,9 @@ apply plugin: "maven-publish" apply plugin: "de.undercouch.download" android { - compileSdkVersion safeExtGet("compileSdkVersion", 30) + compileSdkVersion safeExtGet("compileSdkVersion", 34) - def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION - if (agpVersion.tokenize('.')[0].toInteger() >= 7) { - namespace "com.swmansion.reanimated" - } + namespace "com.swmansion.reanimated" if (rootProject.hasProperty("ndkPath")) { ndkPath rootProject.ext.ndkPath @@ -241,70 +169,58 @@ android { } buildFeatures { - if (REACT_NATIVE_MINOR_VERSION > 68) { - prefab true - prefabPublishing true - buildConfig true - } + prefab true + prefabPublishing true + buildConfig true } prefab { reanimated { - headers prefabHeadersDir.absolutePath + headers reanimatedPrefabHeadersDir.absolutePath } } defaultConfig { - minSdkVersion safeExtGet("minSdkVersion", 16) - targetSdkVersion safeExtGet("targetSdkVersion", 30) + minSdkVersion safeExtGet("minSdkVersion", 23) + targetSdkVersion safeExtGet("targetSdkVersion", 34) versionCode 1 - versionName "1.0" - buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", IS_NEW_ARCHITECTURE_ENABLED.toString()) + versionName REANIMATED_VERSION + + buildConfigField("boolean", "REANIMATED_PROFILING", REANIMATED_PROFILING.toString()) buildConfigField("String", "REANIMATED_VERSION_JAVA", "\"${REANIMATED_VERSION}\"") + buildConfigField("boolean", "IS_INTERNAL_BUILD", "false") + buildConfigField("int", "EXOPACKAGE_FLAGS", "0") + buildConfigField("int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()) + externalNativeBuild { cmake { arguments "-DANDROID_STL=c++_shared", "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", "-DANDROID_TOOLCHAIN=clang", - REACT_NATIVE_MINOR_VERSION < 71 ? "-DBOOST_VERSION=${BOOST_VERSION}" : "-DBOOST_VERSION=", "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}", - "-DJS_RUNTIME=${JS_RUNTIME}", - "-DJS_RUNTIME_DIR=${jsRuntimeDir}", - "-DIS_NEW_ARCHITECTURE_ENABLED=${IS_NEW_ARCHITECTURE_ENABLED}", - "-DIS_REANIMATED_EXAMPLE_APP=${isReanimatedExampleApp()}", - "-DREANIMATED_VERSION=${REANIMATED_VERSION}" + "-DREACT_NATIVE_WORKLETS_DIR=${toPlatformFileString(reactNativeWorkletsRootDir.path)}", + "-DIS_REANIMATED_EXAMPLE_APP=${IS_REANIMATED_EXAMPLE_APP}", + "-DREANIMATED_PROFILING=${REANIMATED_PROFILING}", + "-DREANIMATED_VERSION=${REANIMATED_VERSION}", + "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", + "-DREANIMATED_FEATURE_FLAGS=${REANIMATED_FEATURE_FLAGS}" abiFilters (*reactNativeArchitectures()) + targets("reanimated") } } - buildConfigField("boolean", "IS_INTERNAL_BUILD", "false") - buildConfigField("int", "EXOPACKAGE_FLAGS", "0") - buildConfigField("int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()) - consumerProguardFiles 'proguard-rules.pro' } externalNativeBuild { cmake { + version = System.getenv("CMAKE_VERSION") ?: "3.22.1" path "CMakeLists.txt" } } buildTypes { debug { - externalNativeBuild { - cmake { - if (JS_RUNTIME == "hermes") { - arguments "-DHERMES_ENABLE_DEBUGGER=1" - } else { - arguments "-DHERMES_ENABLE_DEBUGGER=0" - } - } - } - } - release { - externalNativeBuild { - cmake { - arguments "-DHERMES_ENABLE_DEBUGGER=0" - } + packagingOptions { + doNotStrip "**/**/*.so" } } } @@ -312,7 +228,10 @@ android { abortOnError false } packagingOptions { - doNotStrip resolveBuildType() == 'debug' ? "**/**/*.so" : '' + // For some reason gradle only complains about the duplicated version of librrc_root and libreact_render libraries + // while there are more libraries copied in intermediates folder of the lib build directory, we exclude + // only the ones that make the build fail (ideally we should only include libreanimated but we + // are only allowed to specify exclude patterns) excludes = [ "META-INF", "META-INF/**", @@ -323,107 +242,86 @@ android { "**/libfolly_runtime.so", "**/libglog.so", "**/libhermes.so", + "**/libhermesvm.so", "**/libhermes-executor-debug.so", "**/libhermes_executor.so", + "**/libhermestooling.so", "**/libreactnativejni.so", "**/libturbomodulejsijni.so", + "**/libreactnative.so", "**/libreact_nativemodule_core.so", + "**/libreact_render*.so", + "**/librrc_root.so", "**/libjscexecutor.so", - "**/libv8executor.so", ] } - tasks.withType(JavaCompile) { - compileTask -> - compileTask.dependsOn(packageNdkLibs) - } - configurations { - extractHeaders - extractSO - } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } - packagingOptions { - // For some reason gradle only complains about the duplicated version of librrc_root and libreact_render libraries - // while there are more libraries copied in intermediates folder of the lib build directory, we exclude - // only the ones that make the build fail (ideally we should only include libreanimated but we - // are only allowed to specify exlude patterns) - exclude "**/libreact_render*.so" - exclude "**/librrc_root.so" + tasks.withType(ExternalNativeBuildJsonTask) { + compileTask -> + compileTask.doLast { + if (!IS_REANIMATED_EXAMPLE_APP) { + return + } + + def generated = new File("${compileTask.abi.getCxxBuildFolder()}/compile_commands.json") + def output = new File("${packageDir}/compile_commands.json") + + output.text = generated.text + + println("Generated clangd metadata.") + } } - sourceSets.main { - java { - if (IS_NEW_ARCHITECTURE_ENABLED) { - srcDirs += "src/fabric/java" - } else { - srcDirs += "src/paper/java" - } +} - // messageQueueThread - if (REANIMATED_MAJOR_VERSION > 2) { - if (REACT_NATIVE_MINOR_VERSION <= 67) { - srcDirs += "src/reactNativeVersionPatch/messageQueueThread/67" - } else if (REACT_NATIVE_MINOR_VERSION <= 72) { - srcDirs += "src/reactNativeVersionPatch/messageQueueThread/72" - } else { - srcDirs += "src/reactNativeVersionPatch/messageQueueThread/latest" - } - } +def validateReactNativeVersionResult = providers.exec { + workingDir(projectDir.path) + commandLine("node", "./../scripts/validate-react-native-version.js", REACT_NATIVE_VERSION.toString()) + ignoreExitValue = true +} - // ReanimatedUIManager & ReanimatedUIImplementation - if (REACT_NATIVE_MINOR_VERSION <= 70) { - srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/70" - } else { - srcDirs += "src/reactNativeVersionPatch/ReanimatedUIManager/latest" - } - - // ReactFeatureFlags - if (IS_NEW_ARCHITECTURE_ENABLED) { - if (REACT_NATIVE_MINOR_VERSION <= 72) { - srcDirs += "src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/72" - } else { - srcDirs += "src/reactNativeVersionPatch/ReactFeatureFlagsWrapper/latest" - } - } +task assertMinimalReactNativeVersionTask { + doFirst { + if (validateReactNativeVersionResult.getResult().get().exitValue != 0) { + throw new GradleException(validateReactNativeVersionResult.getStandardError().getAsText().get().trim()) } } } -def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWithNewArchitectureTask { - onlyIf { IS_NEW_ARCHITECTURE_ENABLED && REANIMATED_MAJOR_VERSION == 3 && REACT_NATIVE_MINOR_VERSION < 72 } +preBuild.dependsOn(assertMinimalReactNativeVersionTask) + +task assertNewArchitectureEnabledTask { + onlyIf { !IS_NEW_ARCHITECTURE_ENABLED } doFirst { - // If you change the minimal React Native version remember to update Compatibility Table in docs - throw new GradleException( - "[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + REANIMATED_VERSION + " supports the New Architecture on React Native 0.72.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information." - ) + throw new GradleException("[Reanimated] Reanimated requires new architecture to be enabled. Please enable it by setting `newArchEnabled` to `true` in `gradle.properties`.") } } -def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask { - onlyIf { REACT_NATIVE_MINOR_VERSION < 66 } +preBuild.dependsOn(assertNewArchitectureEnabledTask) + +def validateWorkletsBuildResult = providers.exec { + workingDir(projectDir.path) + commandLine("node", "./../scripts/validate-worklets-build.js") + ignoreExitValue = true +} + +task assertWorkletsVersionTask { doFirst { - // If you change the minimal React Native version remember to update Compatibility Table in docs - throw new GradleException("[Reanimated] Unsupported React Native version. Please use 0.66 or newer.") + if (validateWorkletsBuildResult.getResult().get().exitValue != 0) { + throw new GradleException(validateWorkletsBuildResult.getStandardError().getAsText().get().trim()) + } } } -task prepareHeadersForPrefab(type: Copy) { +preBuild.dependsOn(assertWorkletsVersionTask) + +task prepareReanimatedHeadersForPrefabs(type: Copy) { from("$projectDir/src/main/cpp") - from("$projectDir/../Common/cpp/AnimatedSensor") - from("$projectDir/../Common/cpp/Fabric") - from("$projectDir/../Common/cpp/LayoutAnimations") - from("$projectDir/../Common/cpp/NativeModules") - from("$projectDir/../Common/cpp/ReanimatedRuntime") - from("$projectDir/../Common/cpp/Registries") - from("$projectDir/../Common/cpp/SharedItems") - from("$projectDir/../Common/cpp/Tools") - include("*.h") - into(prefabHeadersDir) -} - -tasks.preBuild { - dependsOn assertLatestReactNativeWithNewArchitecture, assertMinimalReactNativeVersion + from("$projectDir/../Common/cpp") + include("reanimated/**/*.h") + into(reanimatedPrefabHeadersDir) } task cleanCmakeCache() { @@ -433,404 +331,8 @@ task cleanCmakeCache() { } } -task printVersions { - println "Android gradle plugin: ${Version.ANDROID_GRADLE_PLUGIN_VERSION}" - println "Gradle: ${project.gradle.gradleVersion}" -} - -task createNativeDepsDirectories() { - downloadsDir.mkdirs() - thirdPartyNdkDir.mkdirs() - prefabHeadersDir.mkdirs() -} - -def resolveTaskFactory(String taskName, String artifactLocalName, File reactNativeAndroidDownloadDir, File reanimatedDownloadDir) { - return tasks.create(name: taskName, dependsOn: createNativeDepsDirectories, type: Copy) { - from reactNativeAndroidDownloadDir - include artifactLocalName - into reanimatedDownloadDir - - onlyIf { - // First we check whether the file is already in our download directory - if (file("$reanimatedDownloadDir/$artifactLocalName").isFile()) { - return false - } - - // If it is not the case we check whether it was downloaded by ReactAndroid project - if (file("$reactNativeAndroidDownloadDir/$artifactLocalName").isFile()) { - return true - } - - return false - } - } -} - -/* -Reanimated includes "hermes/hermes.h" header file in `NativeProxy.cpp`. -Previously, we used header files from `hermes-engine` package in `node_modules`. -In React Native 0.69 and 0.70, Hermes is no longer distributed as package on NPM. -On the new architecture, Hermes is downloaded from GitHub and then compiled from sources. -However, on the old architecture, we need to download Hermes header files on our own -as well as unzip Hermes AAR in order to obtain `libhermes.so` shared library. -For more details, see https://reactnative.dev/architecture/bundled-hermes -or https://github.com/reactwg/react-native-new-architecture/discussions/4 -*/ -if (REACT_NATIVE_MINOR_VERSION in [69, 70] && !IS_NEW_ARCHITECTURE_ENABLED) { - // copied from `react-native/ReactAndroid/hermes-engine/build.gradle` - - def downloadDir = customDownloadsDir ? new File(customDownloadsDir) : new File(reactNativeRootDir, "sdks/download") - - // By default we are going to download and unzip hermes inside the /sdks/hermes folder - // but you can provide an override for where the hermes source code is located. - def hermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") ?: new File(reactNativeRootDir, "sdks/hermes") - - def hermesVersion = "main" - def hermesVersionFile = new File(reactNativeRootDir, "sdks/.hermesversion") - if (hermesVersionFile.exists()) { - hermesVersion = hermesVersionFile.text - } - - task downloadHermes(type: Download) { - src("https://github.com/facebook/hermes/tarball/${hermesVersion}") - onlyIfNewer(true) - overwrite(false) - dest(new File(downloadDir, "hermes.tar.gz")) - } - - task unzipHermes(dependsOn: downloadHermes, type: Copy) { - from(tarTree(downloadHermes.dest)) { - eachFile { file -> - // We flatten the unzip as the tarball contains a `facebook-hermes-` - // folder at the top level. - if (file.relativePath.segments.size() > 1) { - file.relativePath = new RelativePath(!file.isDirectory(), file.relativePath.segments.drop(1)) - } - } - } - into(hermesDir) - } -} - -if (REACT_NATIVE_MINOR_VERSION < 71) { - // You need to have following folders in this directory: - // - boost_1_63_0 - // - double-conversion-1.1.6 - // - folly-deprecate-dynamic-initializer - // - glog-0.3.5 - def dependenciesPath = System.getenv("REACT_NATIVE_DEPENDENCIES") - - // The Boost library is a very large download (>100MB). - // If Boost is already present on your system, define the REACT_NATIVE_BOOST_PATH env variable - // and the build will use that. - def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH") - - def follyReplaceContent = ''' - ssize_t r; - do { - r = open(name, flags, mode); - } while (r == -1 && errno == EINTR); - return r; - ''' - - Task resolveBoost = resolveTaskFactory("resolveBoost", "boost_${BOOST_VERSION}.tar.gz", reactNativeAndroidDownloadDir, downloadsDir) - Task resolveDoubleConversion = resolveTaskFactory( - "resolveDoubleConversion", - "double-conversion-${DOUBLE_CONVERSION_VERSION}.tar.gz", - reactNativeAndroidDownloadDir, - downloadsDir - ) - Task resolveFolly = resolveTaskFactory("resolveFolly", "folly-${FOLLY_VERSION}.tar.gz", reactNativeAndroidDownloadDir, downloadsDir) - Task resolveGlog = resolveTaskFactory("resolveGlog", "glog-${GLOG_VERSION}.tar.gz", reactNativeAndroidDownloadDir, downloadsDir) - - if (IS_NEW_ARCHITECTURE_ENABLED) { - def reactNativeAndroidProject = findProject(":ReactAndroid") - if (reactNativeAndroidProject != null) { - reactNativeAndroidProject.afterEvaluate { - def resolveTasks = [resolveBoost, resolveGlog, resolveDoubleConversion, resolveFolly] - resolveTasks.forEach({ task -> - String reactAndroidDownloadTaskName = "download" + task.name.replace("resolve", "") - def reactAndroidDownloadTask = reactNativeAndroidProject.getTasks().findByName(reactAndroidDownloadTaskName) - if (reactAndroidDownloadTask != null) { - task.dependsOn(reactAndroidDownloadTask) - } else { - logger.warn("[Reanimated] Failed to find task named `$reactAndroidDownloadTaskName` in `:ReactAndroid` project." + - " Explicit dependency between it and $task.name task can not be set.") - } - }) - } - } else { - throw new GradleException("[Reanimated] Failed to find `:ReactAndroid` project. Explicit dependency between download tasks can not be set.") - } - } - - task downloadBoost(dependsOn: resolveBoost, type: Download) { - def transformedVersion = BOOST_VERSION.replace("_", ".") - def artifactLocalName = "boost_${BOOST_VERSION}.tar.gz" - def srcUrl = "https://boostorg.jfrog.io/artifactory/main/release/${transformedVersion}/source/${artifactLocalName}" - if (REACT_NATIVE_MINOR_VERSION < 69) { - srcUrl = "https://github.com/react-native-community/boost-for-react-native/releases/download/v${transformedVersion}-0/${artifactLocalName}" - } - src(srcUrl) - onlyIfNewer(true) - overwrite(false) - dest(new File(downloadsDir, artifactLocalName)) - } - - task prepareBoost(dependsOn: boostPath ? [] : [downloadBoost], type: Copy) { - from(boostPath ?: tarTree(resources.gzip(downloadBoost.dest))) - from("$reactNativeThirdParty/boost/Android.mk") - include("Android.mk", "boost_${BOOST_VERSION}/boost/**/*.hpp", "boost/boost/**/*.hpp") - includeEmptyDirs = false - into("$thirdPartyNdkDir/boost") - doLast { - file("$thirdPartyNdkDir/boost/boost").renameTo("$thirdPartyNdkDir/boost/boost_${BOOST_VERSION}") - } - } - - task downloadDoubleConversion(dependsOn: resolveDoubleConversion, type: Download) { - src("https://github.com/google/double-conversion/archive/v${DOUBLE_CONVERSION_VERSION}.tar.gz") - onlyIfNewer(true) - overwrite(false) - dest(new File(downloadsDir, "double-conversion-${DOUBLE_CONVERSION_VERSION}.tar.gz")) - } - - task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) { - from(dependenciesPath ?: tarTree(downloadDoubleConversion.dest)) - from("$reactNativeThirdParty/double-conversion/Android.mk") - include("double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", "Android.mk") - filesMatching("*/src/**/*", { fname -> fname.path = "double-conversion/${fname.name}" }) - includeEmptyDirs = false - into("$thirdPartyNdkDir/double-conversion") - } - - task downloadFolly(dependsOn: resolveFolly, type: Download) { - src("https://github.com/facebook/folly/archive/v${FOLLY_VERSION}.tar.gz") - onlyIfNewer(true) - overwrite(false) - dest(new File(downloadsDir, "folly-${FOLLY_VERSION}.tar.gz")) - } - - task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) { - from(dependenciesPath ?: tarTree(downloadFolly.dest)) - from("$reactNativeThirdParty/folly/Android.mk") - include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk") - eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") } - // Fixes problem with Folly failing to build on certain systems. See - // https://github.com/software-mansion/react-native-reanimated/issues/1024 - filter { line -> line.replaceAll("return int\\(wrapNoInt\\(open, name, flags, mode\\)\\);", follyReplaceContent) } - includeEmptyDirs = false - into("$thirdPartyNdkDir/folly") - } - - task downloadGlog(dependsOn: resolveGlog, type: Download) { - src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz") - onlyIfNewer(true) - overwrite(false) - dest(new File(downloadsDir, "glog-${GLOG_VERSION}.tar.gz")) - } - - // Prepare glog sources to be compiled, this task will perform steps that normally should've been - // executed by automake. This way we can avoid dependencies on make/automake - task prepareGlog(dependsOn: dependenciesPath ? [] : [downloadGlog], type: Copy) { - duplicatesStrategy = "include" - from(dependenciesPath ?: tarTree(downloadGlog.dest)) - from("$reactNativeThirdParty/glog/") - include("glog-${GLOG_VERSION}/src/**/*", "Android.mk", "config.h") - includeEmptyDirs = false - filesMatching("**/*.h.in") { - filter(ReplaceTokens, tokens: [ - ac_cv_have_unistd_h : "1", - ac_cv_have_stdint_h : "1", - ac_cv_have_systypes_h : "1", - ac_cv_have_inttypes_h : "1", - ac_cv_have_libgflags : "0", - ac_google_start_namespace : "namespace google {", - ac_cv_have_uint16_t : "1", - ac_cv_have_u_int16_t : "1", - ac_cv_have___uint16 : "0", - ac_google_end_namespace : "}", - ac_cv_have___builtin_expect : "1", - ac_google_namespace : "google", - ac_cv___attribute___noinline : "__attribute__ ((noinline))", - ac_cv___attribute___noreturn : "__attribute__ ((noreturn))", - ac_cv___attribute___printf_4_5: "__attribute__((__format__ (__printf__, 4, 5)))" - ]) - it.path = (it.name - ".in") - } - into("$thirdPartyNdkDir/glog") - - doLast { - copy { - from(fileTree(dir: "$thirdPartyNdkDir/glog", includes: ["stl_logging.h", "logging.h", "raw_logging.h", "vlog_is_on.h", "**/src/glog/log_severity.h"]).files) - includeEmptyDirs = false - into("$thirdPartyNdkDir/glog/exported/glog") - } - } - } - - task prepareHermes { - if (REACT_NATIVE_MINOR_VERSION >= 69) { - if (!IS_NEW_ARCHITECTURE_ENABLED) { - dependsOn(unzipHermes) - } - - doLast { - // e.g. hermes-engine-0.70.0-rc.1-debug.aar - def hermesAAR = file( - "$reactNativeRootDir/android/com/facebook/react/hermes-engine/" + - "${REACT_NATIVE_VERSION}/hermes-engine-${REACT_NATIVE_VERSION}-" + - "${resolveBuildType()}.aar" - ) - if (!hermesAAR.exists()) { - throw new GradleException("[Reanimated] Could not find hermes-engine AAR.", null) - } - - def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" }) - - copy { - from soFiles - from "$reactNativeRootDir/ReactAndroid/src/main/jni/first-party/hermes/Android.mk" - into "$thirdPartyNdkDir/hermes" - } - } - } else { - doLast { - def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine") - if (!hermesPackagePath) { - throw new GradleException("[Reanimated] Could not find the hermes-engine npm package.", null) - } - - def hermesAAR = file("$hermesPackagePath/android/hermes-${resolveBuildType()}.aar") // e.g. hermes-debug.aar - if (!hermesAAR.exists()) { - throw new GradleException("[Reanimated] The hermes-engine npm package is missing \"android/hermes-${resolveBuildType()}.aar\".", null) - } - - def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" }) - - copy { - from soFiles - from "$reactNativeRootDir/ReactAndroid/src/main/jni/first-party/hermes/Android.mk" - into "$thirdPartyNdkDir/hermes" - } - } - } - } - - task prepareJSC { - if (REACT_NATIVE_MINOR_VERSION >= 71) { - // do nothing - } else { - doLast { - def jscPackagePath = findNodeModulePath(projectDir, "jsc-android") - if (!jscPackagePath) { - throw new GradleException("[Reanimated] Could not find the jsc-android npm package.", null) - } - - def jscDist = file("$jscPackagePath/dist") - if (!jscDist.exists()) { - throw new GradleException("[Reanimated] The jsc-android npm package is missing its \"dist\" directory.", null) - } - - def jscAAR = fileTree(jscDist).matching({ it.include "**/android-jsc/**/*.aar" }).singleFile - def soFiles = zipTree(jscAAR).matching({ it.include "**/*.so" }) - - def headerFiles = fileTree(jscDist).matching({ it.include "**/include/*.h" }) - - copy { - from(soFiles) - from(headerFiles) - from("$reactNativeRootDir/ReactAndroid/src/main/jni/third-party/jsc/Android.mk") - - filesMatching("**/*.h", { it.path = "JavaScriptCore/${it.name}" }) - - includeEmptyDirs(false) - into("$thirdPartyNdkDir/jsc") - } - } - } - } - - task extractAARHeaders { - doLast { - configurations.extractHeaders.files.each { - def file = it.absoluteFile - def packageName = file.name.tokenize('-')[0] - copy { - from zipTree(file) - into "$reactNativeRootDir/ReactAndroid/src/main/jni/first-party/$packageName/headers" - include "**/*.h" - } - } - } - } - - task extractSOFiles { - doLast { - configurations.extractSO.files.each { - def file = it.absoluteFile - def packageName = file.name.tokenize('-')[0] - copy { - from zipTree(file) - into "$reactNativeRootDir/ReactAndroid/src/main/jni/first-party/$packageName/" - include "jni/**/*.so" - } - } - } - } - - task unpackReactNativeAAR { - def buildType = resolveBuildType() - def rnAarMatcher = "**/react-native/**/*${buildType}.aar" - if (REACT_NATIVE_MINOR_VERSION < 69) { - rnAarMatcher = "**/**/*.aar" - } - def rnAAR = fileTree("$reactNativeRootDir/android").matching({ it.include rnAarMatcher }).singleFile - def file = rnAAR.absoluteFile - def packageName = file.name.tokenize('-')[0] - copy { - from zipTree(file) - into "$reactNativeRootDir/ReactAndroid/src/main/jni/first-party/$packageName/" - include "jni/**/*.so" - } - } - - task downloadNdkBuildDependencies { - if (!boostPath) { - dependsOn(downloadBoost) - } - dependsOn(downloadDoubleConversion) - dependsOn(downloadFolly) - dependsOn(downloadGlog) - } - - task prepareThirdPartyNdkHeaders(dependsOn:[ - downloadNdkBuildDependencies, - prepareBoost, - prepareDoubleConversion, - prepareFolly, - prepareGlog, - unpackReactNativeAAR] - ) {} -} - -task packageNdkLibs(type: Copy) { - from("$buildDir/reanimated-ndk/all") - include("**/libreanimated.so") - into("$projectDir/src/main/jniLibs") -} - repositories { mavenCentral() - mavenLocal() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$reactNativeRootDir/android" - } - maven { - // Android JSC is installed from npm - url "$reactNativeRootDir/../jsc-android/dist" - } google() } @@ -839,71 +341,26 @@ dependencies { implementation "androidx.transition:transition:1.1.0" implementation "androidx.core:core:1.6.0" - if (REACT_NATIVE_MINOR_VERSION >= 71) { - implementation "com.facebook.react:react-android" // version substituted by RNGP - if (JS_RUNTIME == "hermes") { - implementation "com.facebook.react:hermes-android" // version substituted by RNGP - } + implementation "com.facebook.react:react-android" // version substituted by RNGP + + if (project == rootProject) { + // This is needed for linting in Reanimated's repo. } else { - // noinspection GradleDynamicVersion - implementation "com.facebook.react:react-native:+" // From node_modules - implementation "com.facebook.fbjni:fbjni-java-only:" + FBJNI_VERSION - - extractHeaders("com.facebook.fbjni:fbjni:" + FBJNI_VERSION + ":headers") - extractSO("com.facebook.fbjni:fbjni:" + FBJNI_VERSION) - - def jscAAR = fileTree("$reactNativeRootDir/../jsc-android/dist/org/webkit/android-jsc").matching({ it.include "**/**/*.aar" }).singleFile - extractSO(files(jscAAR)) + if (rootProject.subprojects.find { it.name == "react-native-worklets" }) { + implementation project(":react-native-worklets") + } else { + throw new GradleException("[Reanimated] `react-native-worklets` library not found. Please install it as a dependency in your project. Install `react-native-worklets` with your package manager, i.e. `yarn add react-native-worklets` or `npm i react-native-worklets`. Read the documentation for more details: https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#unable-to-find-a-specification-for-rnworklets-depended-upon-by-rnreanimated") + } } } -def nativeBuildDependsOn(dependsOnTask) { - def buildTasks = tasks.findAll({ task -> ( - !task.name.contains("Clean") - && (task.name.contains("externalNative") - || task.name.contains("CMake") - || task.name.contains("generateJsonModel") - ) - ) }) - buildTasks.forEach { task -> task.dependsOn(dependsOnTask) } -} +preBuild.dependsOn(prepareReanimatedHeadersForPrefabs) -afterEvaluate { - if (REACT_NATIVE_MINOR_VERSION < 71) { - extractAARHeaders.dependsOn(prepareThirdPartyNdkHeaders) - extractSOFiles.dependsOn(prepareThirdPartyNdkHeaders) +if (project != rootProject) { + evaluationDependsOn(":react-native-worklets") - nativeBuildDependsOn(prepareThirdPartyNdkHeaders) - nativeBuildDependsOn(extractAARHeaders) - nativeBuildDependsOn(extractSOFiles) - } - - preBuild.dependsOn(prepareHeadersForPrefab) - - tasks.forEach({ task -> - if (task.name.contains("JniLibFolders")) { - task.dependsOn(packageNdkLibs) - } - }) - - if (JS_RUNTIME == "hermes") { - if (REACT_NATIVE_MINOR_VERSION < 71) { - extractAARHeaders.dependsOn(prepareHermes) - extractSOFiles.dependsOn(prepareHermes) - } - } else if (JS_RUNTIME == "v8") { - def buildTasks = tasks.findAll({ task -> - !task.name.contains("Clean") && (task.name.contains("externalNative") || task.name.contains("CMake") || task.name.startsWith("generateJsonModel")) }) - buildTasks.forEach { task -> - def buildType = task.name.endsWith('Debug') ? 'Debug' : 'Release' - task.dependsOn(":react-native-v8:copy${buildType}JniLibsProjectOnly") - } - } else if (JS_RUNTIME == "jsc") { - if (REACT_NATIVE_MINOR_VERSION < 71) { - extractAARHeaders.dependsOn(prepareJSC) - extractSOFiles.dependsOn(prepareJSC) - } - } else { - throw GradleScriptException("[Reanimated] Unknown JS runtime ${JS_RUNTIME}.") + afterEvaluate { + tasks.getByName("externalNativeBuildDebug").dependsOn(findProject(":react-native-worklets").tasks.getByName("externalNativeBuildDebug")) + tasks.getByName("externalNativeBuildRelease").dependsOn(findProject(":react-native-worklets").tasks.getByName("externalNativeBuildRelease")) } } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.jar b/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.jar index 7454180f..9bbc975c 100644 Binary files a/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.jar and b/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.properties b/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.properties index 8fad3f5a..2733ed5d 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.properties +++ b/frontend-admin/node_modules/react-native-reanimated/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/frontend-admin/node_modules/react-native-reanimated/android/proguard-rules.pro b/frontend-admin/node_modules/react-native-reanimated/android/proguard-rules.pro index 118a2c3f..c6e18e23 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/proguard-rules.pro +++ b/frontend-admin/node_modules/react-native-reanimated/android/proguard-rules.pro @@ -1,2 +1,3 @@ -keep class com.swmansion.reanimated.** { *; } -keep class com.facebook.react.turbomodule.** { *; } +-keep class com.facebook.react.fabric.** { *; } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/spotless.gradle b/frontend-admin/node_modules/react-native-reanimated/android/spotless.gradle index 21a5517a..906dc16e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/spotless.gradle +++ b/frontend-admin/node_modules/react-native-reanimated/android/spotless.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.diffplug.spotless' spotless { java { - target 'src/main/java/**/*.java' + target 'src/**/*.java' googleJavaFormat() } } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/AndroidManifest.xml b/frontend-admin/node_modules/react-native-reanimated/android/src/main/AndroidManifest.xml index 586ffb97..c1d65e41 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/AndroidManifest.xml +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/AndroidManifest.xml @@ -1,5 +1,2 @@ - - - + diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java index 5db6885b..a322746b 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/NodesManager.java @@ -1,103 +1,49 @@ package com.swmansion.reanimated; -import static java.lang.Float.NaN; - -import android.view.View; -import com.facebook.react.bridge.Arguments; -import com.facebook.react.bridge.GuardedRunnable; -import com.facebook.react.bridge.JavaOnlyMap; +import android.os.SystemClock; +import androidx.tracing.Trace; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContext; -import com.facebook.react.bridge.ReadableArray; -import com.facebook.react.bridge.ReadableMap; -import com.facebook.react.bridge.ReadableType; +import com.facebook.react.bridge.UIManager; import com.facebook.react.bridge.UiThreadUtil; -import com.facebook.react.bridge.WritableArray; import com.facebook.react.bridge.WritableMap; +import com.facebook.react.fabric.FabricUIManager; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.facebook.react.modules.core.ReactChoreographer; import com.facebook.react.uimanager.GuardedFrameCallback; -import com.facebook.react.uimanager.IllegalViewOperationException; -import com.facebook.react.uimanager.ReactShadowNode; -import com.facebook.react.uimanager.ReactStylesDiffMap; -import com.facebook.react.uimanager.UIImplementation; +import com.facebook.react.uimanager.UIManagerHelper; import com.facebook.react.uimanager.UIManagerModule; -import com.facebook.react.uimanager.UIManagerReanimatedHelper; +import com.facebook.react.uimanager.common.UIManagerType; import com.facebook.react.uimanager.events.Event; import com.facebook.react.uimanager.events.EventDispatcherListener; import com.facebook.react.uimanager.events.RCTEventEmitter; -import com.swmansion.reanimated.layoutReanimation.AnimationsManager; import com.swmansion.reanimated.nativeProxy.NoopEventHandler; +import com.swmansion.worklets.WorkletsModule; import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; import java.util.List; -import java.util.Map; -import java.util.Queue; -import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; -import java.util.concurrent.Semaphore; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import javax.annotation.Nullable; public class NodesManager implements EventDispatcherListener { - public void scrollTo(int viewTag, double x, double y, boolean animated) { - View view; - try { - view = mUIManager.resolveView(viewTag); - } catch (IllegalViewOperationException e) { - e.printStackTrace(); - return; - } - NativeMethodsHelper.scrollTo(view, x, y, animated); - } - - public void dispatchCommand(int viewTag, String commandId, ReadableArray commandArgs) { - // mUIManager.dispatchCommand must be called from native modules queue thread - // because of an assert in ShadowNodeRegistry.getNode - mContext.runOnNativeModulesQueueThread( - new GuardedRunnable(mContext.getExceptionHandler()) { - @Override - public void runGuarded() { - mUIManager.dispatchCommand(viewTag, commandId, commandArgs); - } - }); - } - - public float[] measure(int viewTag) { - View view; - try { - view = mUIManager.resolveView(viewTag); - } catch (IllegalViewOperationException e) { - e.printStackTrace(); - return (new float[] {NaN, NaN, NaN, NaN, NaN, NaN}); - } - return NativeMethodsHelper.measure(view); - } + private Long mFirstUptime = SystemClock.uptimeMillis(); + private boolean mSlowAnimationsEnabled = false; + private int mAnimationsDragFactor; public interface OnAnimationFrame { void onAnimationFrame(double timestampMs); } - private AnimationsManager mAnimationManager; - private final UIImplementation mUIImplementation; private final DeviceEventManagerModule.RCTDeviceEventEmitter mEventEmitter; private final ReactChoreographer mReactChoreographer; private final GuardedFrameCallback mChoreographerCallback; protected final UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver; private final AtomicBoolean mCallbackPosted = new AtomicBoolean(); - private final ReactContext mContext; - private final UIManagerModule mUIManager; - private ReactApplicationContext mReactApplicationContext; private RCTEventEmitter mCustomEventHandler = new NoopEventHandler(); private List mFrameCallbacks = new ArrayList<>(); private ConcurrentLinkedQueue mEventQueue = new ConcurrentLinkedQueue<>(); private double lastFrameTimeMs; - public Set uiProps = Collections.emptySet(); - public Set nativeProps = Collections.emptySet(); - private ReaCompatibility compatibility; + private FabricUIManager mFabricUIManager; public NativeProxy getNativeProxy() { return mNativeProxy; @@ -105,47 +51,23 @@ public class NodesManager implements EventDispatcherListener { private NativeProxy mNativeProxy; - public AnimationsManager getAnimationsManager() { - return mAnimationManager; - } - - public void onCatalystInstanceDestroy() { - if (mAnimationManager != null) { - mAnimationManager.onCatalystInstanceDestroy(); - } - + public void invalidate() { if (mNativeProxy != null) { - mNativeProxy.onCatalystInstanceDestroy(); + mNativeProxy.invalidate(); mNativeProxy = null; } - } - public void initWithContext(ReactApplicationContext reactApplicationContext) { - mReactApplicationContext = reactApplicationContext; - mNativeProxy = new NativeProxy(reactApplicationContext); - mAnimationManager.setAndroidUIScheduler(getNativeProxy().getAndroidUIScheduler()); - compatibility = new ReaCompatibility(reactApplicationContext); - compatibility.registerFabricEventListener(this); - } - - private final class NativeUpdateOperation { - public int mViewTag; - public WritableMap mNativeProps; - - public NativeUpdateOperation(int viewTag, WritableMap nativeProps) { - mViewTag = viewTag; - mNativeProps = nativeProps; + if (mFabricUIManager != null) { + mFabricUIManager.getEventDispatcher().removeListener(this); } } - private Queue mOperationsInBatch = new LinkedList<>(); - private boolean mTryRunBatchUpdatesSynchronously = false; + public NodesManager(ReactApplicationContext context, WorkletsModule workletsModule) { + context.assertOnJSQueueThread(); - public NodesManager(ReactContext context) { - mContext = context; - mUIManager = context.getNativeModule(UIManagerModule.class); - mUIImplementation = mUIManager.getUIImplementation(); - mCustomEventNamesResolver = mUIManager.getDirectEventNamesResolver(); + UIManager uiManager = UIManagerHelper.getUIManager(context, UIManagerType.FABRIC); + assert uiManager != null; + mCustomEventNamesResolver = uiManager::resolveCustomDirectEventName; mEventEmitter = context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class); mReactChoreographer = ReactChoreographer.getInstance(); @@ -157,17 +79,9 @@ public class NodesManager implements EventDispatcherListener { } }; - // We register as event listener at the end, because we pass `this` and we haven't finished - // contructing an object yet. - // This lead to a crash described in - // https://github.com/software-mansion/react-native-reanimated/issues/604 which was caused by - // Nodes Manager being constructed on UI thread and registering for events. - // Events are handled in the native modules thread in the `onEventDispatch()` method. - // This method indirectly uses `mChoreographerCallback` which was created after event - // registration, creating race condition - mUIManager.getEventDispatcher().addListener(this); - - mAnimationManager = new AnimationsManager(mContext, mUIManager); + mNativeProxy = new NativeProxy(context, workletsModule, this); + mFabricUIManager = (FabricUIManager) uiManager; + mFabricUIManager.getEventDispatcher().addListener(this); } public void onHostPause() { @@ -202,99 +116,58 @@ public class NodesManager implements EventDispatcherListener { } public void performOperations() { - if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { - if (mNativeProxy != null) { - mNativeProxy.performOperations(); - } - } else if (!mOperationsInBatch.isEmpty()) { - final Queue copiedOperationsQueue = mOperationsInBatch; - mOperationsInBatch = new LinkedList<>(); - final boolean trySynchronously = mTryRunBatchUpdatesSynchronously; - mTryRunBatchUpdatesSynchronously = false; - final Semaphore semaphore = new Semaphore(0); - mContext.runOnNativeModulesQueueThread( - new GuardedRunnable(mContext.getExceptionHandler()) { - @Override - public void runGuarded() { - boolean queueWasEmpty = - UIManagerReanimatedHelper.isOperationQueueEmpty(mUIImplementation); - boolean shouldDispatchUpdates = trySynchronously && queueWasEmpty; - if (!shouldDispatchUpdates) { - semaphore.release(); - } - while (!copiedOperationsQueue.isEmpty()) { - NativeUpdateOperation op = copiedOperationsQueue.remove(); - ReactShadowNode shadowNode = mUIImplementation.resolveShadowNode(op.mViewTag); - if (shadowNode != null) { - mUIManager.updateView(op.mViewTag, shadowNode.getViewClass(), op.mNativeProps); - } - } - if (queueWasEmpty) { - mUIImplementation.dispatchViewUpdates(-1); // no associated batchId - } - if (shouldDispatchUpdates) { - semaphore.release(); - } - } - }); - if (trySynchronously) { - try { - semaphore.tryAcquire(16, TimeUnit.MILLISECONDS); - } catch (InterruptedException e) { - // if the thread is interruped we just continue and let the layout update happen - // asynchronously - } - } + UiThreadUtil.assertOnUiThread(); + if (mNativeProxy != null) { + mNativeProxy.performOperations(); } } private void onAnimationFrame(long frameTimeNanos) { - // Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "onAnimationFrame"); + UiThreadUtil.assertOnUiThread(); - double currentFrameTimeMs = frameTimeNanos / 1000000.; - - if (currentFrameTimeMs > lastFrameTimeMs) { - // It is possible for ChoreographerCallback to be executed twice within the same frame - // due to frame drops. If this occurs, the additional callback execution should be ignored. - lastFrameTimeMs = currentFrameTimeMs; - - while (!mEventQueue.isEmpty()) { - CopiedEvent copiedEvent = mEventQueue.poll(); - handleEvent( - copiedEvent.getTargetTag(), copiedEvent.getEventName(), copiedEvent.getPayload()); + try { + if (BuildConfig.REANIMATED_PROFILING) { + Trace.beginSection("onAnimationFrame"); } - if (!mFrameCallbacks.isEmpty()) { - List frameCallbacks = mFrameCallbacks; - mFrameCallbacks = new ArrayList<>(frameCallbacks.size()); - for (int i = 0, size = frameCallbacks.size(); i < size; i++) { - frameCallbacks.get(i).onAnimationFrame(currentFrameTimeMs); + double currentFrameTimeMs = frameTimeNanos / 1000000.; + if (mSlowAnimationsEnabled) { + currentFrameTimeMs = + mFirstUptime + (currentFrameTimeMs - mFirstUptime) / mAnimationsDragFactor; + } + + if (currentFrameTimeMs > lastFrameTimeMs) { + // It is possible for ChoreographerCallback to be executed twice within the same frame + // due to frame drops. If this occurs, the additional callback execution should be ignored. + lastFrameTimeMs = currentFrameTimeMs; + + while (!mEventQueue.isEmpty()) { + CopiedEvent copiedEvent = mEventQueue.poll(); + handleEvent( + copiedEvent.getTargetTag(), copiedEvent.getEventName(), copiedEvent.getPayload()); } + + if (!mFrameCallbacks.isEmpty()) { + List frameCallbacks = mFrameCallbacks; + mFrameCallbacks = new ArrayList<>(frameCallbacks.size()); + for (int i = 0, size = frameCallbacks.size(); i < size; i++) { + frameCallbacks.get(i).onAnimationFrame(currentFrameTimeMs); + } + } + + performOperations(); } - performOperations(); + mCallbackPosted.set(false); + if (!mFrameCallbacks.isEmpty() || !mEventQueue.isEmpty()) { + // enqueue next frame + startUpdatingOnAnimationFrame(); + } + } finally { + if (BuildConfig.REANIMATED_PROFILING) { + Trace.endSection(); + } } - - mCallbackPosted.set(false); - if (!mFrameCallbacks.isEmpty() || !mEventQueue.isEmpty()) { - // enqueue next frame - startUpdatingOnAnimationFrame(); - } - - // Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); - } - - public void enqueueUpdateViewOnNativeThread( - int viewTag, WritableMap nativeProps, boolean trySynchronously) { - if (trySynchronously) { - mTryRunBatchUpdatesSynchronously = true; - } - mOperationsInBatch.add(new NativeUpdateOperation(viewTag, nativeProps)); - } - - public void configureProps(Set uiPropsSet, Set nativePropsSet) { - uiProps = uiPropsSet; - nativeProps = nativePropsSet; } public void postOnAnimation(OnAnimationFrame onAnimationFrame) { @@ -304,22 +177,32 @@ public class NodesManager implements EventDispatcherListener { @Override public void onEventDispatch(Event event) { - if (mNativeProxy == null) { - return; - } - // Events can be dispatched from any thread so we have to make sure handleEvent is run from the - // UI thread. - if (UiThreadUtil.isOnUiThread()) { - handleEvent(event); - performOperations(); - } else { - String eventName = mCustomEventNamesResolver.resolveCustomEventName(event.getEventName()); - int viewTag = event.getViewTag(); - boolean shouldSaveEvent = mNativeProxy.isAnyHandlerWaitingForEvent(eventName, viewTag); - if (shouldSaveEvent) { - mEventQueue.offer(new CopiedEvent(event)); + try { + if (BuildConfig.REANIMATED_PROFILING) { + Trace.beginSection("onEventDispatch"); + } + + if (mNativeProxy == null) { + return; + } + // Events can be dispatched from any thread so we have to make sure handleEvent is run from + // the UI thread. + if (UiThreadUtil.isOnUiThread()) { + handleEvent(event); + performOperations(); + } else { + String eventName = mCustomEventNamesResolver.resolveCustomEventName(event.getEventName()); + int viewTag = event.getViewTag(); + boolean shouldSaveEvent = mNativeProxy.isAnyHandlerWaitingForEvent(eventName, viewTag); + if (shouldSaveEvent) { + mEventQueue.offer(new CopiedEvent(event)); + } + startUpdatingOnAnimationFrame(); + } + } finally { + if (BuildConfig.REANIMATED_PROFILING) { + Trace.endSection(); } - startUpdatingOnAnimationFrame(); } } @@ -343,128 +226,11 @@ public class NodesManager implements EventDispatcherListener { mEventEmitter.emit(name, body); } - public void updateProps(int viewTag, Map props) { - // TODO: update PropsNode to use this method instead of its own way of updating props - boolean hasUIProps = false; - boolean hasNativeProps = false; - boolean hasJSProps = false; - JavaOnlyMap newUIProps = new JavaOnlyMap(); - WritableMap newJSProps = Arguments.createMap(); - WritableMap newNativeProps = Arguments.createMap(); - - for (Map.Entry entry : props.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - if (uiProps.contains(key)) { - hasUIProps = true; - addProp(newUIProps, key, value); - } else if (nativeProps.contains(key)) { - hasNativeProps = true; - addProp(newNativeProps, key, value); - } else { - hasJSProps = true; - addProp(newJSProps, key, value); - } - } - - if (viewTag != View.NO_ID) { - if (hasUIProps) { - mUIImplementation.synchronouslyUpdateViewOnUIThread( - viewTag, new ReactStylesDiffMap(newUIProps)); - } - if (hasNativeProps) { - enqueueUpdateViewOnNativeThread(viewTag, newNativeProps, true); - } - if (hasJSProps) { - WritableMap evt = Arguments.createMap(); - evt.putInt("viewTag", viewTag); - evt.putMap("props", newJSProps); - sendEvent("onReanimatedPropsChange", evt); - } - } - } - - public void synchronouslyUpdateUIProps(int viewTag, ReadableMap uiProps) { - compatibility.synchronouslyUpdateUIProps(viewTag, uiProps); - } - - public String obtainProp(int viewTag, String propName) { - View view = mUIManager.resolveView(viewTag); - String result = - "error: unknown propName " + propName + ", currently supported: opacity, zIndex"; - if (propName.equals("opacity")) { - Float opacity = view.getAlpha(); - result = Float.toString(opacity); - } else if (propName.equals("zIndex")) { - Float zIndex = view.getElevation(); - result = Float.toString(zIndex); - } - return result; - } - - private static WritableMap copyReadableMap(ReadableMap map) { - WritableMap copy = Arguments.createMap(); - copy.merge(map); - return copy; - } - - private static WritableArray copyReadableArray(ReadableArray array) { - WritableArray copy = Arguments.createArray(); - for (int i = 0; i < array.size(); i++) { - ReadableType type = array.getType(i); - switch (type) { - case Boolean: - copy.pushBoolean(array.getBoolean(i)); - break; - case String: - copy.pushString(array.getString(i)); - break; - case Null: - copy.pushNull(); - break; - case Number: - copy.pushDouble(array.getDouble(i)); - break; - case Map: - copy.pushMap(copyReadableMap(array.getMap(i))); - break; - case Array: - copy.pushArray(copyReadableArray(array.getArray(i))); - break; - default: - throw new IllegalStateException("[Reanimated] Unknown type of ReadableArray."); - } - } - return copy; - } - - private static void addProp(WritableMap propMap, String key, Object value) { - if (value == null) { - propMap.putNull(key); - } else if (value instanceof Double) { - propMap.putDouble(key, (Double) value); - } else if (value instanceof Integer) { - propMap.putInt(key, (Integer) value); - } else if (value instanceof Number) { - propMap.putDouble(key, ((Number) value).doubleValue()); - } else if (value instanceof Boolean) { - propMap.putBoolean(key, (Boolean) value); - } else if (value instanceof String) { - propMap.putString(key, (String) value); - } else if (value instanceof ReadableArray) { - if (!(value instanceof WritableArray)) { - propMap.putArray(key, copyReadableArray((ReadableArray) value)); - } else { - propMap.putArray(key, (ReadableArray) value); - } - } else if (value instanceof ReadableMap) { - if (!(value instanceof WritableMap)) { - propMap.putMap(key, copyReadableMap((ReadableMap) value)); - } else { - propMap.putMap(key, (ReadableMap) value); - } - } else { - throw new IllegalStateException("[Reanimated] Unknown type of animated value."); + public void enableSlowAnimations(boolean slowAnimationsEnabled, int animationsDragFactor) { + mSlowAnimationsEnabled = slowAnimationsEnabled; + mAnimationsDragFactor = animationsDragFactor; + if (slowAnimationsEnabled) { + mFirstUptime = SystemClock.uptimeMillis(); } } } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java index 35b2f960..7d7f1c01 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java @@ -1,55 +1,38 @@ package com.swmansion.reanimated; -import android.util.Log; import com.facebook.react.bridge.LifecycleEventListener; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; import com.facebook.react.module.annotations.ReactModule; -import com.facebook.react.uimanager.NativeViewHierarchyManager; -import com.facebook.react.uimanager.UIBlock; -import com.facebook.react.uimanager.UIManagerModule; -import com.facebook.react.uimanager.UIManagerModuleListener; -import java.util.ArrayList; -import javax.annotation.Nullable; +import com.swmansion.worklets.WorkletsModule; @ReactModule(name = ReanimatedModule.NAME) -public class ReanimatedModule extends ReactContextBaseJavaModule - implements LifecycleEventListener, UIManagerModuleListener { - - public static final String NAME = "ReanimatedModule"; - - private interface UIThreadOperation { - void execute(NodesManager nodesManager); - } - - private ArrayList mOperations = new ArrayList<>(); - private @Nullable NodesManager mNodesManager; +public class ReanimatedModule extends NativeReanimatedModuleSpec implements LifecycleEventListener { + private final NodesManager mNodesManager; + private final WorkletsModule mWorkletsModule; public ReanimatedModule(ReactApplicationContext reactContext) { super(reactContext); + reactContext.assertOnJSQueueThread(); + mWorkletsModule = reactContext.getNativeModule(WorkletsModule.class); + mNodesManager = new NodesManager(reactContext, mWorkletsModule); } @Override public void initialize() { - ReactApplicationContext reactCtx = getReactApplicationContext(); - UIManagerModule uiManager = reactCtx.getNativeModule(UIManagerModule.class); - reactCtx.addLifecycleEventListener(this); - uiManager.addUIManagerListener(this); + ReactApplicationContext reactContext = getReactApplicationContext(); + reactContext.assertOnJSQueueThread(); + reactContext.addLifecycleEventListener(this); } @Override public void onHostPause() { - if (mNodesManager != null) { - mNodesManager.onHostPause(); - } + mNodesManager.onHostPause(); } @Override public void onHostResume() { - if (mNodesManager != null) { - mNodesManager.onHostResume(); - } + mNodesManager.onHostResume(); } @Override @@ -57,70 +40,33 @@ public class ReanimatedModule extends ReactContextBaseJavaModule // do nothing } - @Override - public void willDispatchViewUpdates(final UIManagerModule uiManager) { - if (mOperations.isEmpty()) { - return; - } - final ArrayList operations = mOperations; - mOperations = new ArrayList<>(); - uiManager.addUIBlock( - new UIBlock() { - @Override - public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) { - NodesManager nodesManager = getNodesManager(); - for (UIThreadOperation operation : operations) { - operation.execute(nodesManager); - } - } - }); - } - - @Override - public String getName() { - return NAME; - } - - /*package*/ public NodesManager getNodesManager() { - if (mNodesManager == null) { - mNodesManager = new NodesManager(getReactApplicationContext()); - } - + // This method is called from react-native-gesture-handler. return mNodesManager; } @ReactMethod(isBlockingSynchronousMethod = true) - public void installTurboModule() { - // When debugging in chrome the JS context is not available. - // https://github.com/facebook/react-native/blob/v0.67.0-rc.6/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobCollector.java#L25 - Utils.isChromeDebugger = getReactApplicationContext().getJavaScriptContextHolder().get() == 0; - - if (!Utils.isChromeDebugger) { - this.getNodesManager().initWithContext(getReactApplicationContext()); - } else { - Log.w( - "[REANIMATED]", - "Unable to create Reanimated Native Module. You can ignore this message if you are using Chrome Debugger now."); - } + public boolean installTurboModule() { + getReactApplicationContext().assertOnJSQueueThread(); + mNodesManager.getNativeProxy().installJSIBindings(); + return true; } @ReactMethod - public void addListener(String eventName) { + public void addListener(String ignoredEventName) { // Keep: Required for RN built in Event Emitter Calls. } @ReactMethod - public void removeListeners(Integer count) { + public void removeListeners(Integer ignoredCount) { // Keep: Required for RN built in Event Emitter Calls. } @Override - public void onCatalystInstanceDestroy() { - super.onCatalystInstanceDestroy(); - - if (mNodesManager != null) { - mNodesManager.onCatalystInstanceDestroy(); - } + public void invalidate() { + super.invalidate(); + mNodesManager.invalidate(); + ReactApplicationContext reactContext = getReactApplicationContext(); + reactContext.removeLifecycleEventListener(this); } } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java index 961b585e..eee7e930 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java @@ -1,84 +1,58 @@ package com.swmansion.reanimated; -import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_END; -import static com.facebook.react.bridge.ReactMarkerConstants.CREATE_UI_MANAGER_MODULE_START; - +import androidx.annotation.NonNull; +import com.facebook.react.BaseReactPackage; import com.facebook.react.ReactApplication; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactPackage; -import com.facebook.react.TurboReactPackage; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; -import com.facebook.react.bridge.ReactMarker; import com.facebook.react.module.annotations.ReactModule; +import com.facebook.react.module.annotations.ReactModuleList; import com.facebook.react.module.model.ReactModuleInfo; import com.facebook.react.module.model.ReactModuleInfoProvider; -import com.facebook.react.turbomodule.core.interfaces.TurboModule; -import com.facebook.react.uimanager.ReanimatedUIManager; -import com.facebook.react.uimanager.UIManagerModule; -import com.facebook.react.uimanager.ViewManager; -import com.facebook.systrace.Systrace; import java.util.HashMap; -import java.util.List; import java.util.Map; +import java.util.Objects; -public class ReanimatedPackage extends TurboReactPackage implements ReactPackage { - +@ReactModuleList( + nativeModules = { + ReanimatedModule.class, + }) +public class ReanimatedPackage extends BaseReactPackage implements ReactPackage { @Override - public NativeModule getModule(String name, ReactApplicationContext reactContext) { - if (name.equals(ReanimatedModule.NAME)) { - return new ReanimatedModule(reactContext); - } - if (name.equals(ReanimatedUIManager.NAME)) { - return createUIManager(reactContext); - } - return null; + public NativeModule getModule( + @NonNull String name, @NonNull ReactApplicationContext reactContext) { + return switch (name) { + case ReanimatedModule.NAME -> new ReanimatedModule(reactContext); + default -> null; + }; } @Override public ReactModuleInfoProvider getReactModuleInfoProvider() { Class[] moduleList = new Class[] { - ReanimatedModule.class, ReanimatedUIManager.class, + ReanimatedModule.class, }; final Map reactModuleInfoMap = new HashMap<>(); for (Class moduleClass : moduleList) { - ReactModule reactModule = moduleClass.getAnnotation(ReactModule.class); + ReactModule reactModule = + Objects.requireNonNull(moduleClass.getAnnotation(ReactModule.class)); reactModuleInfoMap.put( reactModule.name(), new ReactModuleInfo( reactModule.name(), moduleClass.getName(), - true, + reactModule.canOverrideExistingModule(), reactModule.needsEagerInit(), - reactModule.hasConstants(), reactModule.isCxxModule(), - TurboModule.class.isAssignableFrom(moduleClass))); + true)); } - return new ReactModuleInfoProvider() { - @Override - public Map getReactModuleInfos() { - return reactModuleInfoMap; - } - }; - } - - private UIManagerModule createUIManager(final ReactApplicationContext reactContext) { - ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_START); - Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "createUIManagerModule"); - final ReactInstanceManager reactInstanceManager = getReactInstanceManager(reactContext); - List viewManagers = reactInstanceManager.getOrCreateViewManagers(reactContext); - int minTimeLeftInFrameForNonBatchedOperationMs = -1; - try { - return ReanimatedUIManagerFactory.create( - reactContext, viewManagers, minTimeLeftInFrameForNonBatchedOperationMs); - } finally { - Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); - ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_END); - } + return () -> reactModuleInfoMap; } /** diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/Utils.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/Utils.java index e5c9767e..40ac4f3c 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/Utils.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/Utils.java @@ -8,8 +8,6 @@ import java.util.Map; public class Utils { - public static boolean isChromeDebugger = false; - public static Map processMapping(ReadableMap style) { ReadableMapKeySetIterator iter = style.keySetIterator(); HashMap mapping = new HashMap<>(); @@ -46,4 +44,14 @@ public class Utils { } return 0; } + + public static Runnable combineRunnables(final Runnable... runnables) { + return new Runnable() { + public void run() { + for (Runnable r : runnables) { + r.run(); + } + } + }; + } } diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.java index 3ed2665a..ec16e44a 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/nativeProxy/EventHandler.java @@ -12,7 +12,8 @@ import com.facebook.react.uimanager.events.RCTEventEmitter; public class EventHandler implements RCTEventEmitter { @DoNotStrip private final HybridData mHybridData; - UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver; + + public UIManagerModule.CustomEventNamesResolver mCustomEventNamesResolver; @DoNotStrip private EventHandler(HybridData hybridData) { diff --git a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java index c26ecdad..4b520bed 100644 --- a/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java +++ b/frontend-admin/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/sensor/ReanimatedSensor.java @@ -17,6 +17,7 @@ public class ReanimatedSensor { Sensor sensor; ReanimatedSensorType sensorType; int interval; + private static final int DEFAULT_INTERVAL = 8; ReanimatedSensor( WeakReference reactContext, @@ -30,7 +31,7 @@ public class ReanimatedSensor { (SensorManager) reactContext.get().getSystemService(reactContext.get().SENSOR_SERVICE); this.sensorType = sensorType; if (interval == -1) { - this.interval = SensorManager.SENSOR_DELAY_UI; + this.interval = DEFAULT_INTERVAL; } else { this.interval = interval; } diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js index e0570ffe..b99c0070 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js @@ -1,61 +1,10 @@ 'use strict'; -export { createAnimatedComponent } from './createAnimatedComponent'; -export { AnimatedText as Text } from './reanimated2/component/Text'; -export { AnimatedView as View } from './reanimated2/component/View'; -export { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView'; -export { AnimatedImage as Image } from './reanimated2/component/Image'; -export { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList'; +export { ReanimatedFlatList as FlatList } from './component/FlatList'; +export { AnimatedImage as Image } from './component/Image'; +export { AnimatedScrollView as ScrollView } from './component/ScrollView'; +export { AnimatedText as Text } from './component/Text'; +export { AnimatedView as View } from './component/View'; export { addWhitelistedNativeProps, addWhitelistedUIProps } from './ConfigHelper'; -/** - * @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -/** - * @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -/** - * @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -/** - * @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -/** - * @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -/** - * @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ - -/** - * @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ +export { createAnimatedComponent } from './createAnimatedComponent'; //# sourceMappingURL=Animated.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js.map index f52f7dd8..51e1394e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/Animated.js.map @@ -1 +1 @@ -{"version":3,"names":["createAnimatedComponent","AnimatedText","Text","AnimatedView","View","AnimatedScrollView","ScrollView","AnimatedImage","Image","ReanimatedFlatList","FlatList","addWhitelistedNativeProps","addWhitelistedUIProps"],"sources":["Animated.ts"],"sourcesContent":["'use strict';\nimport type { Extrapolate as _Extrapolate } from './reanimated2/interpolateColor';\nimport type { SharedValue as _SharedValue } from './reanimated2/commonTypes';\nimport type { DerivedValue as _DerivedValue } from './reanimated2/hook/useDerivedValue';\nimport type {\n TransformStyleTypes as _TransformStyleTypes,\n Adaptable as _Adaptable,\n AdaptTransforms as _AdaptTransforms,\n AnimatedTransform as _AnimatedTransform,\n AnimateStyle as _AnimateStyle,\n StylesOrDefault as _StylesOrDefault,\n AnimateProps as _AnimateProps,\n} from './reanimated2/helperTypes';\nimport type { EasingFunction as _EasingFunction } from './reanimated2/Easing';\n\nimport type { AnimatedScrollViewProps as _AnimatedScrollViewProps } from './reanimated2/component/ScrollView';\nimport type { FlatListPropsWithLayout as _FlatListPropsWithLayout } from './reanimated2/component/FlatList';\n\nexport { createAnimatedComponent } from './createAnimatedComponent';\nexport { AnimatedText as Text } from './reanimated2/component/Text';\nexport { AnimatedView as View } from './reanimated2/component/View';\nexport { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView';\nexport { AnimatedImage as Image } from './reanimated2/component/Image';\nexport { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList';\nexport {\n addWhitelistedNativeProps,\n addWhitelistedUIProps,\n} from './ConfigHelper';\n/**\n * @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type Extrapolate = typeof _Extrapolate;\n/**\n * @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\n\nexport type SharedValue = _SharedValue;\n/**\n * @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type DerivedValue = _DerivedValue;\n/**\n * @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type Adaptable = _Adaptable;\n/**\n * @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type TransformStyleTypes = _TransformStyleTypes;\n/**\n * @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AdaptTransforms = _AdaptTransforms;\n/**\n * @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace.\n */\nexport type AnimatedTransform = _AnimatedTransform;\n/**\n * @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimateStyle = _AnimateStyle;\n/**\n * @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type StylesOrDefault = _StylesOrDefault;\n/**\n * @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimateProps

= _AnimateProps

;\n/**\n * @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type EasingFunction = _EasingFunction;\n/**\n * @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type AnimatedScrollViewProps = _AnimatedScrollViewProps;\n/**\n * @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace.\n * */\nexport type FlatListPropsWithLayout = _FlatListPropsWithLayout;\n"],"mappings":"AAAA,YAAY;;AAkBZ,SAASA,uBAAuB,QAAQ,2BAA2B;AACnE,SAASC,YAAY,IAAIC,IAAI,QAAQ,8BAA8B;AACnE,SAASC,YAAY,IAAIC,IAAI,QAAQ,8BAA8B;AACnE,SAASC,kBAAkB,IAAIC,UAAU,QAAQ,oCAAoC;AACrF,SAASC,aAAa,IAAIC,KAAK,QAAQ,+BAA+B;AACtE,SAASC,kBAAkB,IAAIC,QAAQ,QAAQ,kCAAkC;AACjF,SACEC,yBAAyB,EACzBC,qBAAqB,QAChB,gBAAgB;AACvB;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA"} \ No newline at end of file +{"version":3,"names":["ReanimatedFlatList","FlatList","AnimatedImage","Image","AnimatedScrollView","ScrollView","AnimatedText","Text","AnimatedView","View","addWhitelistedNativeProps","addWhitelistedUIProps","createAnimatedComponent"],"sourceRoot":"../../src","sources":["Animated.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,kBAAkB,IAAIC,QAAQ,QAAQ,sBAAsB;AACrE,SAASC,aAAa,IAAIC,KAAK,QAAQ,mBAAmB;AAC1D,SAASC,kBAAkB,IAAIC,UAAU,QAAQ,wBAAwB;AACzE,SAASC,YAAY,IAAIC,IAAI,QAAQ,kBAAkB;AACvD,SAASC,YAAY,IAAIC,IAAI,QAAQ,kBAAkB;AACvD,SACEC,yBAAyB,EACzBC,qBAAqB,QAChB,gBAAgB;AACvB,SAASC,uBAAuB,QAAQ,2BAA2B","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js index 568ab06f..4dcf50f7 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js @@ -1,61 +1,35 @@ 'use strict'; -import { PropsAllowlists } from './propsAllowlists'; -import { jsiConfigureProps } from './reanimated2/core'; -function assertNoOverlapInLists() { - for (const key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) { - if (key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) { - throw new Error(`[Reanimated] Property \`${key}\` was whitelisted both as UI and native prop. Please remove it from one of the lists.`); - } - } +import { executeOnUIRuntimeSync } from 'react-native-worklets'; +import { getLoggerConfig, SHOULD_BE_USE_WEB, updateLoggerConfig } from './common'; + +/** @deprecated This function is a no-op in Reanimated 4. */ +export function addWhitelistedNativeProps(_props) { + // Do nothing. This is just for backward compatibility. } -function configureProps() { - assertNoOverlapInLists(); - jsiConfigureProps(Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST), Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST)); + +/** @deprecated This function is a no-op in Reanimated 4. */ +export function addWhitelistedUIProps(_props) { + // Do nothing. This is just for backward compatibility. } -export function addWhitelistedNativeProps(props) { - const oldSize = Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length; - PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST = { - ...PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST, - ...props - }; - if (oldSize !== Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length) { - configureProps(); - } -} -export function addWhitelistedUIProps(props) { - const oldSize = Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length; - PropsAllowlists.UI_THREAD_PROPS_WHITELIST = { - ...PropsAllowlists.UI_THREAD_PROPS_WHITELIST, - ...props - }; - if (oldSize !== Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length) { - configureProps(); - } -} -const PROCESSED_VIEW_NAMES = new Set(); + /** - * updates UI props whitelist for given view host instance - * this will work just once for every view name + * Updates Reanimated logger config with the user-provided configuration. Will + * affect Reanimated code executed after call to this function so it should be + * called before any Reanimated code is executed to take effect. Each call to + * this function will override the previous configuration (it's recommended to + * call it only once). + * + * @param config - The new logger configuration to apply. */ - -export function adaptViewConfig(viewConfig) { - const viewName = viewConfig.uiViewClassName; - const props = viewConfig.validAttributes; - - // update whitelist of UI props for this view name only once - if (!PROCESSED_VIEW_NAMES.has(viewName)) { - const propsToAdd = {}; - Object.keys(props).forEach(key => { - // we don't want to add native props as they affect layout - // we also skip props which repeat here - if (!(key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) && !(key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST)) { - propsToAdd[key] = true; - } - }); - addWhitelistedUIProps(propsToAdd); - PROCESSED_VIEW_NAMES.add(viewName); +export function configureReanimatedLogger(config) { + // Get the current config from the React runtime (to have a single source of truth) + const currentConfig = getLoggerConfig(); + // Update the configuration object in the React runtime + updateLoggerConfig(currentConfig, config); + // Register the updated configuration in the UI runtime + if (!SHOULD_BE_USE_WEB) { + executeOnUIRuntimeSync(updateLoggerConfig)(currentConfig, config); } } -configureProps(); //# sourceMappingURL=ConfigHelper.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js.map index e6bc3357..2124f45d 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/ConfigHelper.js.map @@ -1 +1 @@ -{"version":3,"names":["PropsAllowlists","jsiConfigureProps","assertNoOverlapInLists","key","NATIVE_THREAD_PROPS_WHITELIST","UI_THREAD_PROPS_WHITELIST","Error","configureProps","Object","keys","addWhitelistedNativeProps","props","oldSize","length","addWhitelistedUIProps","PROCESSED_VIEW_NAMES","Set","adaptViewConfig","viewConfig","viewName","uiViewClassName","validAttributes","has","propsToAdd","forEach","add"],"sources":["ConfigHelper.ts"],"sourcesContent":["'use strict';\nimport { PropsAllowlists } from './propsAllowlists';\nimport { jsiConfigureProps } from './reanimated2/core';\nfunction assertNoOverlapInLists() {\n for (const key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) {\n if (key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) {\n throw new Error(\n `[Reanimated] Property \\`${key}\\` was whitelisted both as UI and native prop. Please remove it from one of the lists.`\n );\n }\n }\n}\n\nfunction configureProps(): void {\n assertNoOverlapInLists();\n jsiConfigureProps(\n Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST),\n Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST)\n );\n}\n\nexport function addWhitelistedNativeProps(\n props: Record\n): void {\n const oldSize = Object.keys(\n PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST\n ).length;\n PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST = {\n ...PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (\n oldSize !==\n Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length\n ) {\n configureProps();\n }\n}\n\nexport function addWhitelistedUIProps(props: Record): void {\n const oldSize = Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length;\n PropsAllowlists.UI_THREAD_PROPS_WHITELIST = {\n ...PropsAllowlists.UI_THREAD_PROPS_WHITELIST,\n ...props,\n };\n if (\n oldSize !== Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length\n ) {\n configureProps();\n }\n}\n\nconst PROCESSED_VIEW_NAMES = new Set();\n\nexport interface ViewConfig {\n uiViewClassName: string;\n validAttributes: Record;\n}\n/**\n * updates UI props whitelist for given view host instance\n * this will work just once for every view name\n */\n\nexport function adaptViewConfig(viewConfig: ViewConfig): void {\n const viewName = viewConfig.uiViewClassName;\n const props = viewConfig.validAttributes;\n\n // update whitelist of UI props for this view name only once\n if (!PROCESSED_VIEW_NAMES.has(viewName)) {\n const propsToAdd: Record = {};\n Object.keys(props).forEach((key) => {\n // we don't want to add native props as they affect layout\n // we also skip props which repeat here\n if (\n !(key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) &&\n !(key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST)\n ) {\n propsToAdd[key] = true;\n }\n });\n addWhitelistedUIProps(propsToAdd);\n\n PROCESSED_VIEW_NAMES.add(viewName);\n }\n}\n\nconfigureProps();\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,sBAAsBA,CAAA,EAAG;EAChC,KAAK,MAAMC,GAAG,IAAIH,eAAe,CAACI,6BAA6B,EAAE;IAC/D,IAAID,GAAG,IAAIH,eAAe,CAACK,yBAAyB,EAAE;MACpD,MAAM,IAAIC,KAAK,CACZ,2BAA0BH,GAAI,wFAAuF,CACvH;IACH;EACF;AACF;AAEA,SAASI,cAAcA,CAAA,EAAS;EAC9BL,sBAAsB,EAAE;EACxBD,iBAAiB,CACfO,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,EACtDG,MAAM,CAACC,IAAI,CAACT,eAAe,CAACI,6BAA6B,CAAC,CAC3D;AACH;AAEA,OAAO,SAASM,yBAAyBA,CACvCC,KAA8B,EACxB;EACN,MAAMC,OAAO,GAAGJ,MAAM,CAACC,IAAI,CACzBT,eAAe,CAACI,6BAA6B,CAC9C,CAACS,MAAM;EACRb,eAAe,CAACI,6BAA6B,GAAG;IAC9C,GAAGJ,eAAe,CAACI,6BAA6B;IAChD,GAAGO;EACL,CAAC;EACD,IACEC,OAAO,KACPJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACI,6BAA6B,CAAC,CAACS,MAAM,EACjE;IACAN,cAAc,EAAE;EAClB;AACF;AAEA,OAAO,SAASO,qBAAqBA,CAACH,KAA8B,EAAQ;EAC1E,MAAMC,OAAO,GAAGJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,CAACQ,MAAM;EAC7Eb,eAAe,CAACK,yBAAyB,GAAG;IAC1C,GAAGL,eAAe,CAACK,yBAAyB;IAC5C,GAAGM;EACL,CAAC;EACD,IACEC,OAAO,KAAKJ,MAAM,CAACC,IAAI,CAACT,eAAe,CAACK,yBAAyB,CAAC,CAACQ,MAAM,EACzE;IACAN,cAAc,EAAE;EAClB;AACF;AAEA,MAAMQ,oBAAoB,GAAG,IAAIC,GAAG,EAAE;AAMtC;AACA;AACA;AACA;;AAEA,OAAO,SAASC,eAAeA,CAACC,UAAsB,EAAQ;EAC5D,MAAMC,QAAQ,GAAGD,UAAU,CAACE,eAAe;EAC3C,MAAMT,KAAK,GAAGO,UAAU,CAACG,eAAe;;EAExC;EACA,IAAI,CAACN,oBAAoB,CAACO,GAAG,CAACH,QAAQ,CAAC,EAAE;IACvC,MAAMI,UAAmC,GAAG,CAAC,CAAC;IAC9Cf,MAAM,CAACC,IAAI,CAACE,KAAK,CAAC,CAACa,OAAO,CAAErB,GAAG,IAAK;MAClC;MACA;MACA,IACE,EAAEA,GAAG,IAAIH,eAAe,CAACI,6BAA6B,CAAC,IACvD,EAAED,GAAG,IAAIH,eAAe,CAACK,yBAAyB,CAAC,EACnD;QACAkB,UAAU,CAACpB,GAAG,CAAC,GAAG,IAAI;MACxB;IACF,CAAC,CAAC;IACFW,qBAAqB,CAACS,UAAU,CAAC;IAEjCR,oBAAoB,CAACU,GAAG,CAACN,QAAQ,CAAC;EACpC;AACF;AAEAZ,cAAc,EAAE"} \ No newline at end of file +{"version":3,"names":["executeOnUIRuntimeSync","getLoggerConfig","SHOULD_BE_USE_WEB","updateLoggerConfig","addWhitelistedNativeProps","_props","addWhitelistedUIProps","configureReanimatedLogger","config","currentConfig"],"sourceRoot":"../../src","sources":["ConfigHelper.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,sBAAsB,QAAQ,uBAAuB;AAG9D,SACEC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,QACb,UAAU;;AAEjB;AACA,OAAO,SAASC,yBAAyBA,CACvCC,MAA+B,EACzB;EACN;AAAA;;AAGF;AACA,OAAO,SAASC,qBAAqBA,CAACD,MAA+B,EAAQ;EAC3E;AAAA;;AAGF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,yBAAyBA,CAACC,MAAoB,EAAE;EAC9D;EACA,MAAMC,aAAa,GAAGR,eAAe,CAAC,CAAC;EACvC;EACAE,kBAAkB,CAACM,aAAa,EAAED,MAAM,CAAC;EACzC;EACA,IAAI,CAACN,iBAAiB,EAAE;IACtBF,sBAAsB,CAACG,kBAAkB,CAAC,CAACM,aAAa,EAAED,MAAM,CAAC;EACnE;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js index 60655570..8478898b 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js @@ -1,5 +1,6 @@ 'use strict'; +import { logger } from './common'; const mockTargetValues = { targetOriginX: 0, targetOriginY: 0, @@ -18,18 +19,30 @@ const mockTargetValues = { currentGlobalOriginY: 0, currentBorderRadius: 0 }; +function getCommonProperties(layoutStyle, componentStyle) { + let componentStyleFlat = Array.isArray(componentStyle) ? componentStyle.flat() : [componentStyle]; + componentStyleFlat = componentStyleFlat.filter(Boolean); + componentStyleFlat = componentStyleFlat.map(style => 'initial' in style ? style.initial.value // Include properties of animated style + : style); + const componentStylesKeys = componentStyleFlat.flatMap(style => Object.keys(style)); + const commonKeys = Object.keys(layoutStyle).filter(key => componentStylesKeys.includes(key)); + return commonKeys; +} +function maybeReportOverwrittenProperties(layoutAnimationStyle, style, displayName) { + const commonProperties = getCommonProperties(layoutAnimationStyle, style); + if (commonProperties.length > 0) { + logger.warn(`${commonProperties.length === 1 ? 'Property' : 'Properties'} "${commonProperties.join(', ')}" of ${displayName} may be overwritten by a layout animation. Please wrap your component with an animated view and apply the layout animation on the wrapper.`); + } +} export function maybeBuild(layoutAnimationOrBuilder, style, displayName) { const isAnimationBuilder = value => 'build' in layoutAnimationOrBuilder && typeof layoutAnimationOrBuilder.build === 'function'; if (isAnimationBuilder(layoutAnimationOrBuilder)) { const animationFactory = layoutAnimationOrBuilder.build(); - const layoutAnimation = animationFactory(mockTargetValues); - const animatedStyle = layoutAnimation.animations; - const getCommonProperties = (obj1, obj2) => Object.keys(obj1).filter(key => Object.prototype.hasOwnProperty.call(obj2, key)); - const commonProperties = getCommonProperties(animatedStyle, style || {}); - if (commonProperties.length > 0) { - console.warn(`[Reanimated] ${commonProperties.length === 1 ? 'Property' : 'Properties: '} "${commonProperties}" of ${displayName} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.`); + if (__DEV__ && style) { + const layoutAnimation = animationFactory(mockTargetValues); + maybeReportOverwrittenProperties(layoutAnimation.animations, style, displayName); } - return layoutAnimationOrBuilder.build(); + return animationFactory; } else { return layoutAnimationOrBuilder; } diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js.map index 49b93225..117b86c8 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/animationBuilder.js.map @@ -1 +1 @@ -{"version":3,"names":["mockTargetValues","targetOriginX","targetOriginY","targetWidth","targetHeight","targetGlobalOriginX","targetGlobalOriginY","targetBorderRadius","windowWidth","windowHeight","currentOriginX","currentOriginY","currentWidth","currentHeight","currentGlobalOriginX","currentGlobalOriginY","currentBorderRadius","maybeBuild","layoutAnimationOrBuilder","style","displayName","isAnimationBuilder","value","build","animationFactory","layoutAnimation","animatedStyle","animations","getCommonProperties","obj1","obj2","Object","keys","filter","key","prototype","hasOwnProperty","call","commonProperties","length","console","warn"],"sources":["animationBuilder.tsx"],"sourcesContent":["'use strict';\nimport type {\n ILayoutAnimationBuilder,\n LayoutAnimationFunction,\n LayoutAnimationsValues,\n} from './reanimated2/layoutReanimation';\nimport type { StyleProps } from './reanimated2/commonTypes';\n\nconst mockTargetValues: LayoutAnimationsValues = {\n targetOriginX: 0,\n targetOriginY: 0,\n targetWidth: 0,\n targetHeight: 0,\n targetGlobalOriginX: 0,\n targetGlobalOriginY: 0,\n targetBorderRadius: 0,\n windowWidth: 0,\n windowHeight: 0,\n currentOriginX: 0,\n currentOriginY: 0,\n currentWidth: 0,\n currentHeight: 0,\n currentGlobalOriginX: 0,\n currentGlobalOriginY: 0,\n currentBorderRadius: 0,\n};\n\nexport function maybeBuild(\n layoutAnimationOrBuilder:\n | ILayoutAnimationBuilder\n | LayoutAnimationFunction\n | Keyframe,\n style: StyleProps | undefined,\n displayName: string\n): LayoutAnimationFunction | Keyframe {\n const isAnimationBuilder = (\n value: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe\n ): value is ILayoutAnimationBuilder =>\n 'build' in layoutAnimationOrBuilder &&\n typeof layoutAnimationOrBuilder.build === 'function';\n\n if (isAnimationBuilder(layoutAnimationOrBuilder)) {\n const animationFactory = layoutAnimationOrBuilder.build();\n const layoutAnimation = animationFactory(mockTargetValues);\n const animatedStyle = layoutAnimation.animations;\n\n const getCommonProperties = (obj1: object, obj2: object) =>\n Object.keys(obj1).filter((key) =>\n Object.prototype.hasOwnProperty.call(obj2, key)\n );\n\n const commonProperties = getCommonProperties(animatedStyle, style || {});\n if (commonProperties.length > 0) {\n console.warn(\n `[Reanimated] ${\n commonProperties.length === 1 ? 'Property' : 'Properties: '\n } \"${commonProperties}\" of ${displayName} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.`\n );\n }\n\n return layoutAnimationOrBuilder.build();\n } else {\n return layoutAnimationOrBuilder;\n }\n}\n"],"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AAI,CACT,gBACCH,gBAAgB,CAACC,MAAM,KAAK,CAAC,GAAG,UAAU,GAAG,cAC9C,KAAID,gBAAiB,QAAOlB,WAAY,iHAAgH,CAC1J;IACH;IAEA,OAAOF,wBAAwB,CAACK,KAAK,EAAE;EACzC,CAAC,MAAM;IACL,OAAOL,wBAAwB;EACjC;AACF"} \ No newline at end of file +{"version":3,"names":["logger","mockTargetValues","targetOriginX","targetOriginY","targetWidth","targetHeight","targetGlobalOriginX","targetGlobalOriginY","targetBorderRadius","windowWidth","windowHeight","currentOriginX","currentOriginY","currentWidth","currentHeight","currentGlobalOriginX","currentGlobalOriginY","currentBorderRadius","getCommonProperties","layoutStyle","componentStyle","componentStyleFlat","Array","isArray","flat","filter","Boolean","map","style","initial","value","componentStylesKeys","flatMap","Object","keys","commonKeys","key","includes","maybeReportOverwrittenProperties","layoutAnimationStyle","displayName","commonProperties","length","warn","join","maybeBuild","layoutAnimationOrBuilder","isAnimationBuilder","build","animationFactory","__DEV__","layoutAnimation","animations"],"sourceRoot":"../../src","sources":["animationBuilder.tsx"],"mappings":"AAAA,YAAY;;AACZ,SAASA,MAAM,QAAQ,UAAU;AASjC,MAAMC,gBAAuC,GAAG;EAC9CC,aAAa,EAAE,CAAC;EAChBC,aAAa,EAAE,CAAC;EAChBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,mBAAmB,EAAE,CAAC;EACtBC,kBAAkB,EAAE,CAAC;EACrBC,WAAW,EAAE,CAAC;EACdC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE,CAAC;EACjBC,YAAY,EAAE,CAAC;EACfC,aAAa,EAAE,CAAC;EAChBC,oBAAoB,EAAE,CAAC;EACvBC,oBAAoB,EAAE,CAAC;EACvBC,mBAAmB,EAAE;AACvB,CAAC;AAED,SAASC,mBAAmBA,CAC1BC,WAAuB,EACvBC,cAAuC,EACvC;EACA,IAAIC,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BAAgB,GAAGH,wBAAwB,CAACE,KAAK,CAAC,CAAC;IAEzD,IAAIE,OAAO,IAAItB,KAAK,EAAE;MACpB,MAAMuB,eAAe,GAAGF,gBAAgB,CAAChD,gBAAgB,CAAC;MAC1DqC,gCAAgC,CAC9Ba,eAAe,CAACC,UAAU,EAC1BxB,KAAK,EACLY,WACF,CAAC;IACH;IAEA,OAAOS,gBAAgB;EACzB,CAAC,MAAM;IACL,OAAOH,wBAAwB;EACjC;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js index c0a7dd31..5828da9d 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js @@ -1,16 +1,10 @@ 'use strict'; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +import { isSharedValue } from '../isSharedValue'; +import { startMapper, stopMapper } from '../mappers'; +import { updateProps } from '../updateProps'; +import { makeViewDescriptorsSet } from '../ViewDescriptorsSet'; import { flattenArray } from './utils'; -import { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet'; -import { adaptViewConfig } from '../ConfigHelper'; -import updateProps from '../reanimated2/UpdateProps'; -import { stopMapper, startMapper } from '../reanimated2/mappers'; -import { isSharedValue } from '../reanimated2/isSharedValue'; -import { shouldBeUseWeb } from '../reanimated2/PlatformChecker'; -const SHOULD_BE_USE_WEB = shouldBeUseWeb(); function isInlineStyleTransform(transform) { if (!Array.isArray(transform)) { return false; @@ -22,28 +16,29 @@ function inlinePropsHasChanged(styles1, styles2) { return true; } for (const key of Object.keys(styles1)) { - if (styles1[key] !== styles2[key]) return true; + if (styles1[key] !== styles2[key]) { + return true; + } } return false; } -function getInlinePropsUpdate(inlineProps) { +function getInlinePropsUpdate(styleValue) { 'worklet'; - const update = {}; - for (const [key, styleValue] of Object.entries(inlineProps)) { - if (isSharedValue(styleValue)) { - update[key] = styleValue.value; - } else if (Array.isArray(styleValue)) { - update[key] = styleValue.map(item => { - return getInlinePropsUpdate(item); - }); - } else if (typeof styleValue === 'object') { - update[key] = getInlinePropsUpdate(styleValue); - } else { - update[key] = styleValue; - } + if (isSharedValue(styleValue)) { + return styleValue.value; } - return update; + if (Array.isArray(styleValue)) { + return styleValue.map(getInlinePropsUpdate); + } + if (styleValue && typeof styleValue === 'object') { + const update = {}; + for (const [key, value] of Object.entries(styleValue)) { + update[key] = getInlinePropsUpdate(value); + } + return update; + } + return styleValue; } function extractSharedValuesMapFromProps(props) { const inlineProps = {}; @@ -55,11 +50,11 @@ function extractSharedValuesMapFromProps(props) { if (!style) { return; } - for (const [key, styleValue] of Object.entries(style)) { + for (const [styleKey, styleValue] of Object.entries(style)) { if (isSharedValue(styleValue)) { - inlineProps[key] = styleValue; - } else if (key === 'transform' && isInlineStyleTransform(styleValue)) { - inlineProps[key] = styleValue; + inlineProps[styleKey] = styleValue; + } else if (styleKey === 'transform' && isInlineStyleTransform(styleValue)) { + inlineProps[styleKey] = styleValue; } } }); @@ -91,11 +86,9 @@ export function getInlineStyle(style, isFirstRender) { return newStyle; } export class InlinePropManager { - constructor() { - _defineProperty(this, "_inlinePropsViewDescriptors", null); - _defineProperty(this, "_inlinePropsMapperId", null); - _defineProperty(this, "_inlineProps", {}); - } + _inlinePropsViewDescriptors = null; + _inlinePropsMapperId = null; + _inlineProps = {}; attachInlineProps(animatedComponent, viewInfo) { const newInlineProps = extractSharedValuesMapFromProps(animatedComponent.props); const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps); @@ -104,32 +97,19 @@ export class InlinePropManager { this._inlinePropsViewDescriptors = makeViewDescriptorsSet(); const { viewTag, - viewName, - shadowNodeWrapper, - viewConfig + shadowNodeWrapper } = viewInfo; - if (Object.keys(newInlineProps).length && viewConfig) { - adaptViewConfig(viewConfig); - } this._inlinePropsViewDescriptors.add({ - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion tag: viewTag, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - name: viewName, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion shadowNodeWrapper: shadowNodeWrapper }); } const shareableViewDescriptors = this._inlinePropsViewDescriptors.shareableViewDescriptors; - const maybeViewRef = SHOULD_BE_USE_WEB ? { - items: new Set([animatedComponent]) - } // see makeViewsRefSet - : undefined; const updaterFunction = () => { 'worklet'; const update = getInlinePropsUpdate(newInlineProps); - updateProps(shareableViewDescriptors, update, maybeViewRef); + updateProps(shareableViewDescriptors, update); }; this._inlineProps = newInlineProps; if (this._inlinePropsMapperId) { diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js.map index fad0bd58..1d36e2e0 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/InlinePropManager.js.map @@ -1 +1 @@ -{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","flattenArray","makeViewDescriptorsSet","adaptViewConfig","updateProps","stopMapper","startMapper","isSharedValue","shouldBeUseWeb","SHOULD_BE_USE_WEB","isInlineStyleTransform","transform","Array","isArray","some","t","hasInlineStyles","inlinePropsHasChanged","styles1","styles2","keys","length","getInlinePropsUpdate","inlineProps","update","styleValue","entries","map","item","extractSharedValuesMapFromProps","props","styles","style","forEach","getInlineStyle","isFirstRender","newStyle","InlinePropManager","constructor","attachInlineProps","animatedComponent","viewInfo","newInlineProps","hasChanged","_inlineProps","_inlinePropsViewDescriptors","viewTag","viewName","shadowNodeWrapper","viewConfig","add","tag","name","shareableViewDescriptors","maybeViewRef","items","Set","updaterFunction","_inlinePropsMapperId","values","detachInlineProps"],"sources":["InlinePropManager.ts"],"sourcesContent":["'use strict';\nimport type { StyleProps } from '../reanimated2';\nimport type {\n IAnimatedComponentInternal,\n AnimatedComponentProps,\n IInlinePropManager,\n ViewInfo,\n} from './commonTypes';\nimport { flattenArray } from './utils';\nimport { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport updateProps from '../reanimated2/UpdateProps';\nimport { stopMapper, startMapper } from '../reanimated2/mappers';\nimport { isSharedValue } from '../reanimated2/isSharedValue';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nfunction isInlineStyleTransform(transform: unknown): boolean {\n if (!Array.isArray(transform)) {\n return false;\n }\n\n return transform.some((t: Record) => hasInlineStyles(t));\n}\n\nfunction inlinePropsHasChanged(\n styles1: StyleProps,\n styles2: StyleProps\n): boolean {\n if (Object.keys(styles1).length !== Object.keys(styles2).length) {\n return true;\n }\n\n for (const key of Object.keys(styles1)) {\n if (styles1[key] !== styles2[key]) return true;\n }\n\n return false;\n}\n\nfunction getInlinePropsUpdate(inlineProps: Record) {\n 'worklet';\n const update: Record = {};\n for (const [key, styleValue] of Object.entries(inlineProps)) {\n if (isSharedValue(styleValue)) {\n update[key] = styleValue.value;\n } else if (Array.isArray(styleValue)) {\n update[key] = styleValue.map((item) => {\n return getInlinePropsUpdate(item);\n });\n } else if (typeof styleValue === 'object') {\n update[key] = getInlinePropsUpdate(styleValue as Record);\n } else {\n update[key] = styleValue;\n }\n }\n return update;\n}\n\nfunction extractSharedValuesMapFromProps(\n props: AnimatedComponentProps<\n Record /* Initial component props */\n >\n): Record {\n const inlineProps: Record = {};\n\n for (const key in props) {\n const value = props[key];\n if (key === 'style') {\n const styles = flattenArray(props.style ?? []);\n styles.forEach((style) => {\n if (!style) {\n return;\n }\n for (const [key, styleValue] of Object.entries(style)) {\n if (isSharedValue(styleValue)) {\n inlineProps[key] = styleValue;\n } else if (\n key === 'transform' &&\n isInlineStyleTransform(styleValue)\n ) {\n inlineProps[key] = styleValue;\n }\n }\n });\n } else if (isSharedValue(value)) {\n inlineProps[key] = value;\n }\n }\n\n return inlineProps;\n}\n\nexport function hasInlineStyles(style: StyleProps): boolean {\n if (!style) {\n return false;\n }\n return Object.keys(style).some((key) => {\n const styleValue = style[key];\n return (\n isSharedValue(styleValue) ||\n (key === 'transform' && isInlineStyleTransform(styleValue))\n );\n });\n}\n\nexport function getInlineStyle(\n style: Record,\n isFirstRender: boolean\n) {\n if (isFirstRender) {\n return getInlinePropsUpdate(style);\n }\n const newStyle: StyleProps = {};\n for (const [key, styleValue] of Object.entries(style)) {\n if (\n !isSharedValue(styleValue) &&\n !(key === 'transform' && isInlineStyleTransform(styleValue))\n ) {\n newStyle[key] = styleValue;\n }\n }\n return newStyle;\n}\n\nexport class InlinePropManager implements IInlinePropManager {\n _inlinePropsViewDescriptors: ViewDescriptorsSet | null = null;\n _inlinePropsMapperId: number | null = null;\n _inlineProps: StyleProps = {};\n\n public attachInlineProps(\n animatedComponent: React.Component &\n IAnimatedComponentInternal,\n viewInfo: ViewInfo\n ) {\n const newInlineProps: Record =\n extractSharedValuesMapFromProps(animatedComponent.props);\n const hasChanged = inlinePropsHasChanged(newInlineProps, this._inlineProps);\n\n if (hasChanged) {\n if (!this._inlinePropsViewDescriptors) {\n this._inlinePropsViewDescriptors = makeViewDescriptorsSet();\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } = viewInfo;\n\n if (Object.keys(newInlineProps).length && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._inlinePropsViewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag as number,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n const shareableViewDescriptors =\n this._inlinePropsViewDescriptors.shareableViewDescriptors;\n\n const maybeViewRef = SHOULD_BE_USE_WEB\n ? ({ items: new Set([animatedComponent]) } as ViewRefSet) // see makeViewsRefSet\n : undefined;\n const updaterFunction = () => {\n 'worklet';\n const update = getInlinePropsUpdate(newInlineProps);\n updateProps(shareableViewDescriptors, update, maybeViewRef);\n };\n this._inlineProps = newInlineProps;\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n this._inlinePropsMapperId = null;\n if (Object.keys(newInlineProps).length) {\n this._inlinePropsMapperId = startMapper(\n updaterFunction,\n Object.values(newInlineProps)\n );\n }\n }\n }\n\n public detachInlineProps() {\n if (this._inlinePropsMapperId) {\n stopMapper(this._inlinePropsMapperId);\n }\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAA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AMjC,MAAM,GAAGF,oBAAoB,CAACoB,cAAc,CAAC;QACnDtC,WAAW,CAACiD,wBAAwB,EAAE7B,MAAM,EAAE8B,YAAY,CAAC;MAC7D,CAAC;MACD,IAAI,CAACV,YAAY,GAAGF,cAAc;MAClC,IAAI,IAAI,CAACgB,oBAAoB,EAAE;QAC7BrD,UAAU,CAAC,IAAI,CAACqD,oBAAoB,CAAC;MACvC;MACA,IAAI,CAACA,oBAAoB,GAAG,IAAI;MAChC,IAAI3E,MAAM,CAACqC,IAAI,CAACsB,cAAc,CAAC,CAACrB,MAAM,EAAE;QACtC,IAAI,CAACqC,oBAAoB,GAAGpD,WAAW,CACrCmD,eAAe,EACf1E,MAAM,CAAC4E,MAAM,CAACjB,cAAc,CAAC,CAC9B;MACH;IACF;EACF;EAEOkB,iBAAiBA,CAAA,EAAG;IACzB,IAAI,IAAI,CAACF,oBAAoB,EAAE;MAC7BrD,UAAU,CAAC,IAAI,CAACqD,oBAAoB,CAAC;IACvC;EACF;AACF"} \ No newline at end of file +{"version":3,"names":["isSharedValue","startMapper","stopMapper","updateProps","makeViewDescriptorsSet","flattenArray","isInlineStyleTransform","transform","Array","isArray","some","t","hasInlineStyles","inlinePropsHasChanged","styles1","styles2","Object","keys","length","key","getInlinePropsUpdate","styleValue","value","map","update","entries","extractSharedValuesMapFromProps","props","inlineProps","styles","style","forEach","styleKey","getInlineStyle","isFirstRender","newStyle","InlinePropManager","_inlinePropsViewDescriptors","_inlinePropsMapperId","_inlineProps","attachInlineProps","animatedComponent","viewInfo","newInlineProps","hasChanged","viewTag","shadowNodeWrapper","add","tag","shareableViewDescriptors","updaterFunction","values","detachInlineProps"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/InlinePropManager.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,kBAAkB;AAChD,SAASC,WAAW,EAAEC,UAAU,QAAQ,YAAY;AACpD,SAASC,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,sBAAsB,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,MAAM1B,MAAM,GAAGJ,oBAAoB,CAACuB,cAAc,CAAC;QACnDxC,WAAW,CAAC8C,wBAAwB,EAAEzB,MAAM,CAAC;MAC/C,CAAC;MACD,IAAI,CAACe,YAAY,GAAGI,cAAc;MAClC,IAAI,IAAI,CAACL,oBAAoB,EAAE;QAC7BpC,UAAU,CAAC,IAAI,CAACoC,oBAAoB,CAAC;MACvC;MACA,IAAI,CAACA,oBAAoB,GAAG,IAAI;MAChC,IAAItB,MAAM,CAACC,IAAI,CAAC0B,cAAc,CAAC,CAACzB,MAAM,EAAE;QACtC,IAAI,CAACoB,oBAAoB,GAAGrC,WAAW,CACrCiD,eAAe,EACflC,MAAM,CAACmC,MAAM,CAACR,cAAc,CAC9B,CAAC;MACH;IACF;EACF;EAEOS,iBAAiBA,CAAA,EAAG;IACzB,IAAI,IAAI,CAACd,oBAAoB,EAAE;MAC7BpC,UAAU,CAAC,IAAI,CAACoC,oBAAoB,CAAC;IACvC;EACF;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js index c0bd9a77..f4b19fc7 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js @@ -1,86 +1,50 @@ 'use strict'; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -import { NativeEventEmitter, NativeModules, findNodeHandle } from 'react-native'; -import { shouldBeUseWeb } from '../reanimated2/PlatformChecker'; -import { runOnJS, runOnUIImmediately } from '../reanimated2/threads'; -const SHOULD_BE_USE_WEB = shouldBeUseWeb(); -class JSPropsUpdaterPaper { - constructor() { - _defineProperty(this, "_reanimatedEventEmitter", void 0); - this._reanimatedEventEmitter = new NativeEventEmitter(NativeModules.ReanimatedModule); +import { runOnUI } from 'react-native-worklets'; +import { SHOULD_BE_USE_WEB } from '../common'; +class JSPropsUpdaterNative { + static _tagToComponentMapping = new Map(); + registerComponent(animatedComponent, jsProps) { + const viewTag = animatedComponent.getComponentViewTag(); + JSPropsUpdaterNative._tagToComponentMapping.set(viewTag, animatedComponent); + runOnUI(() => { + global._tagToJSPropNamesMapping[viewTag] = Object.fromEntries(jsProps.map(propName => [propName, true])); + })(); } - addOnJSPropsChangeListener(animatedComponent) { - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent); - if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) { - const listener = data => { - const component = JSPropsUpdaterPaper._tagToComponentMapping.get(data.viewTag); - component === null || component === void 0 ? void 0 : component._updateFromNative(data.props); - }; - this._reanimatedEventEmitter.addListener('onReanimatedPropsChange', listener); - } + unregisterComponent(animatedComponent) { + const viewTag = animatedComponent.getComponentViewTag(); + JSPropsUpdaterNative._tagToComponentMapping.delete(viewTag); + runOnUI(() => { + delete global._tagToJSPropNamesMapping[viewTag]; + })(); } - removeOnJSPropsChangeListener(animatedComponent) { - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag); - if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) { - this._reanimatedEventEmitter.removeAllListeners('onReanimatedPropsChange'); - } + updateProps(operations) { + operations.forEach(({ + tag, + updates + }) => { + const component = JSPropsUpdaterNative._tagToComponentMapping.get(tag); + component?.setNativeProps(updates); + }); } } -_defineProperty(JSPropsUpdaterPaper, "_tagToComponentMapping", new Map()); -class JSPropsUpdaterFabric { - constructor() { - if (!JSPropsUpdaterFabric.isInitialized) { - const updater = (viewTag, props) => { - const component = JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag); - component === null || component === void 0 ? void 0 : component._updateFromNative(props); - }; - runOnUIImmediately(() => { - 'worklet'; - - global.updateJSProps = (viewTag, props) => { - runOnJS(updater)(viewTag, props); - }; - })(); - JSPropsUpdaterFabric.isInitialized = true; - } - } - addOnJSPropsChangeListener(animatedComponent) { - if (!JSPropsUpdaterFabric.isInitialized) { - return; - } - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent); - } - removeOnJSPropsChangeListener(animatedComponent) { - if (!JSPropsUpdaterFabric.isInitialized) { - return; - } - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag); - } -} -_defineProperty(JSPropsUpdaterFabric, "_tagToComponentMapping", new Map()); -_defineProperty(JSPropsUpdaterFabric, "isInitialized", false); class JSPropsUpdaterWeb { - addOnJSPropsChangeListener(_animatedComponent) { + registerComponent(_animatedComponent) { // noop } - removeOnJSPropsChangeListener(_animatedComponent) { + unregisterComponent(_animatedComponent) { + // noop + } + updateProps(_operations) { // noop } } let JSPropsUpdater; if (SHOULD_BE_USE_WEB) { JSPropsUpdater = JSPropsUpdaterWeb; -} else if (global._IS_FABRIC) { - JSPropsUpdater = JSPropsUpdaterFabric; } else { - JSPropsUpdater = JSPropsUpdaterPaper; + JSPropsUpdater = JSPropsUpdaterNative; } -export default JSPropsUpdater; +const jsPropsUpdater = new JSPropsUpdater(); +export default jsPropsUpdater; //# sourceMappingURL=JSPropsUpdater.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js.map index 0972e582..fc35d180 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/JSPropsUpdater.js.map @@ -1 +1 @@ -{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","NativeEventEmitter","NativeModules","findNodeHandle","shouldBeUseWeb","runOnJS","runOnUIImmediately","SHOULD_BE_USE_WEB","JSPropsUpdaterPaper","constructor","_reanimatedEventEmitter","ReanimatedModule","addOnJSPropsChangeListener","animatedComponent","viewTag","_tagToComponentMapping","set","size","listener","data","component","get","_updateFromNative","props","addListener","removeOnJSPropsChangeListener","delete","removeAllListeners","Map","JSPropsUpdaterFabric","isInitialized","updater","global","updateJSProps","JSPropsUpdaterWeb","_animatedComponent","JSPropsUpdater","_IS_FABRIC"],"sources":["JSPropsUpdater.ts"],"sourcesContent":["'use strict';\nimport {\n NativeEventEmitter,\n NativeModules,\n findNodeHandle,\n} from 'react-native';\nimport { shouldBeUseWeb } from '../reanimated2/PlatformChecker';\nimport type { StyleProps } from '../reanimated2';\nimport { runOnJS, runOnUIImmediately } from '../reanimated2/threads';\nimport type {\n AnimatedComponentProps,\n IAnimatedComponentInternal,\n IJSPropsUpdater,\n InitialComponentProps,\n} from './commonTypes';\n\ninterface ListenerData {\n viewTag: number;\n props: StyleProps;\n}\n\nconst SHOULD_BE_USE_WEB = shouldBeUseWeb();\n\nclass JSPropsUpdaterPaper implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private _reanimatedEventEmitter: NativeEventEmitter;\n\n constructor() {\n this._reanimatedEventEmitter = new NativeEventEmitter(\n NativeModules.ReanimatedModule\n );\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) {\n const listener = (data: ListenerData) => {\n const component = JSPropsUpdaterPaper._tagToComponentMapping.get(\n data.viewTag\n );\n component?._updateFromNative(data.props);\n };\n this._reanimatedEventEmitter.addListener(\n 'onReanimatedPropsChange',\n listener\n );\n }\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag);\n if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) {\n this._reanimatedEventEmitter.removeAllListeners(\n 'onReanimatedPropsChange'\n );\n }\n }\n}\n\nclass JSPropsUpdaterFabric implements IJSPropsUpdater {\n private static _tagToComponentMapping = new Map();\n private static isInitialized = false;\n\n constructor() {\n if (!JSPropsUpdaterFabric.isInitialized) {\n const updater = (viewTag: number, props: unknown) => {\n const component =\n JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag);\n component?._updateFromNative(props);\n };\n runOnUIImmediately(() => {\n 'worklet';\n global.updateJSProps = (viewTag: number, props: unknown) => {\n runOnJS(updater)(viewTag, props);\n };\n })();\n JSPropsUpdaterFabric.isInitialized = true;\n }\n }\n\n public addOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent);\n }\n\n public removeOnJSPropsChangeListener(\n animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n if (!JSPropsUpdaterFabric.isInitialized) {\n return;\n }\n const viewTag = findNodeHandle(animatedComponent);\n JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag);\n }\n}\n\nclass JSPropsUpdaterWeb implements IJSPropsUpdater {\n public addOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n\n public removeOnJSPropsChangeListener(\n _animatedComponent: React.Component<\n AnimatedComponentProps\n > &\n IAnimatedComponentInternal\n ) {\n // noop\n }\n}\n\ntype JSPropsUpdaterOptions =\n | typeof JSPropsUpdaterWeb\n | typeof JSPropsUpdaterFabric\n | typeof JSPropsUpdaterPaper;\n\nlet JSPropsUpdater: JSPropsUpdaterOptions;\nif (SHOULD_BE_USE_WEB) {\n JSPropsUpdater = JSPropsUpdaterWeb;\n} else if (global._IS_FABRIC) {\n JSPropsUpdater = JSPropsUpdaterFabric;\n} else {\n JSPropsUpdater = JSPropsUpdaterPaper;\n}\n\nexport default JSPropsUpdater;\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KAAA,iBAAAA,KAAA,kBAAAA,KAAA,MAAAE,IAAA,GAAAF,KAAA,CAAAG,MAAA,CAAAC,WAAA,OAAAF,IAAA,KAAAG,SAAA,QAAAC,GAAA,GAAAJ,IAAA,CAAAK,IAAA,CAAAP,K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lD,eAAA,CAD7CmD,oBAAoB,mBAEO,KAAK;AA8CtC,MAAMK,iBAAiB,CAA4B;EAC1CtB,0BAA0BA,CAC/BuB,kBAG4B,EAC5B;IACA;EAAA;EAGKV,6BAA6BA,CAClCU,kBAG4B,EAC5B;IACA;EAAA;AAEJ;AAOA,IAAIC,cAAqC;AACzC,IAAI7B,iBAAiB,EAAE;EACrB6B,cAAc,GAAGF,iBAAiB;AACpC,CAAC,MAAM,IAAIF,MAAM,CAACK,UAAU,EAAE;EAC5BD,cAAc,GAAGP,oBAAoB;AACvC,CAAC,MAAM;EACLO,cAAc,GAAG5B,mBAAmB;AACtC;AAEA,eAAe4B,cAAc"} \ No newline at end of file +{"version":3,"names":["runOnUI","SHOULD_BE_USE_WEB","JSPropsUpdaterNative","_tagToComponentMapping","Map","registerComponent","animatedComponent","jsProps","viewTag","getComponentViewTag","set","global","_tagToJSPropNamesMapping","Object","fromEntries","map","propName","unregisterComponent","delete","updateProps","operations","forEach","tag","updates","component","get","setNativeProps","JSPropsUpdaterWeb","_animatedComponent","_operations","JSPropsUpdater","jsPropsUpdater"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/JSPropsUpdater.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,OAAO,QAAQ,uBAAuB;AAE/C,SAASC,iBAAiB,QAAQ,WAAW;AAU7C,MAAMC,oBAAoB,CAA4B;EACpD,OAAeC,sBAAsB,GAAG,IAAIC,GAAG,CAG7C,CAAC;EAEIC,iBAAiBA,CACtBC,iBAAwC,EACxCC,OAAiB,EACjB;IACA,MAAMC,OAAO,GAAGF,iBAAiB,CAACG,mBAAmB,CAAC,CAAC;IACvDP,oBAAoB,CAACC,sBAAsB,CAACO,GAAG,CAACF,OAAO,EAAEF,iBAAiB,CAAC;IAE3EN,OAAO,CAAC,MAAM;MACZW,MAAM,CAACC,wBAAwB,CAACJ,OAAO,CAAC,GAAGK,MAAM,CAACC,WAAW,CAC3DP,OAAO,CAACQ,GAAG,CAAEC,QAAQ,IAAK,CAACA,QAAQ,EAAE,IAAI,CAAC,CAC5C,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;EACN;EAEOC,mBAAmBA,CAACX,iBAAwC,EAAE;IACnE,MAAME,OAAO,GAAGF,iBAAiB,CAACG,mBAAmB,CAAC,CAAC;IACvDP,oBAAoB,CAACC,sBAAsB,CAACe,MAAM,CAACV,OAAO,CAAC;IAE3DR,OAAO,CAAC,MAAM;MACZ,OAAOW,MAAM,CAACC,wBAAwB,CAACJ,OAAO,CAAC;IACjD,CAAC,CAAC,CAAC,CAAC;EACN;EAEOW,WAAWA,CAACC,UAA8B,EAAE;IACjDA,UAAU,CAACC,OAAO,CAAC,CAAC;MAAEC,GAAG;MAAEC;IAAQ,CAAC,KAAK;MACvC,MAAMC,SAAS,GAAGtB,oBAAoB,CAACC,sBAAsB,CAACsB,GAAG,CAACH,GAAG,CAAC;MACtEE,SAAS,EAAEE,cAAc,CAACH,OAAO,CAAC;IACpC,CAAC,CAAC;EACJ;AACF;AAEA,MAAMI,iBAAiB,CAA4B;EAC1CtB,iBAAiBA,CACtBuB,kBAG4B,EAC5B;IACA;EAAA;EAGKX,mBAAmBA,CACxBW,kBAG4B,EAC5B;IACA;EAAA;EAGKT,WAAWA,CAACU,WAA+B,EAAE;IAClD;EAAA;AAEJ;AAMA,IAAIC,cAAqC;AACzC,IAAI7B,iBAAiB,EAAE;EACrB6B,cAAc,GAAGH,iBAAiB;AACpC,CAAC,MAAM;EACLG,cAAc,GAAG5B,oBAAoB;AACvC;AAEA,MAAM6B,cAAc,GAAG,IAAID,cAAc,CAAC,CAAC;AAE3C,eAAeC,cAAc","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js index da8a3c48..df366419 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js @@ -1,23 +1,16 @@ 'use strict'; -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -import { isSharedValue } from '../reanimated2'; -import { isChromeDebugger } from '../reanimated2/PlatformChecker'; -import WorkletEventHandler from '../reanimated2/WorkletEventHandler'; -import { initialUpdaterRun } from '../reanimated2/animation'; -import { hasInlineStyles, getInlineStyle } from './InlinePropManager'; +import { initialUpdaterRun } from '../animation'; +import { isSharedValue } from '../isSharedValue'; +import { WorkletEventHandler } from '../WorkletEventHandler'; +import { getInlineStyle, hasInlineStyles } from './InlinePropManager'; import { flattenArray, has } from './utils'; -import { StyleSheet } from 'react-native'; function dummyListener() { // empty listener we use to assign to listener properties for which animated // event is used. } export class PropsFilter { - constructor() { - _defineProperty(this, "_initialStyle", {}); - } + _initialPropsMap = new Map(); filterNonAnimatedProps(component) { const inputProps = component.props; const props = {}; @@ -27,37 +20,38 @@ export class PropsFilter { const styleProp = inputProps.style; const styles = flattenArray(styleProp ?? []); const processedStyle = styles.map(style => { - if (style && style.viewDescriptors) { - // this is how we recognize styles returned by useAnimatedStyle - style.viewsRef.add(component); + if (style?.viewDescriptors) { + const handle = style; if (component._isFirstRender) { - this._initialStyle = { - ...style.initial.value, - ...this._initialStyle, - ...initialUpdaterRun(style.initial.updater) - }; + this._initialPropsMap.set(handle, { + ...handle.initial.value, + ...initialUpdaterRun(handle.initial.updater) + }); } - return this._initialStyle; + return this._initialPropsMap.get(handle) ?? {}; } else if (hasInlineStyles(style)) { return getInlineStyle(style, component._isFirstRender); } else { return style; } }); - props[key] = StyleSheet.flatten(processedStyle); + // keep styles as they were passed by the user + // it will help other libs to interpret styles correctly + props[key] = processedStyle; } else if (key === 'animatedProps') { - const animatedProp = inputProps.animatedProps; - if (animatedProp.initial !== undefined) { - Object.keys(animatedProp.initial.value).forEach(key => { - var _animatedProp$initial, _animatedProp$viewsRe; - props[key] = (_animatedProp$initial = animatedProp.initial) === null || _animatedProp$initial === void 0 ? void 0 : _animatedProp$initial.value[key]; - (_animatedProp$viewsRe = animatedProp.viewsRef) === null || _animatedProp$viewsRe === void 0 ? void 0 : _animatedProp$viewsRe.add(component); - }); - } - } else if (has('current', value) && value.current instanceof WorkletEventHandler) { - if (value.current.eventNames.length > 0) { - value.current.eventNames.forEach(eventName => { - props[eventName] = has('listeners', value.current) ? value.current.listeners[eventName] : dummyListener; + const animatedPropsProp = inputProps.animatedProps; + const animatedPropsArray = flattenArray(animatedPropsProp ?? []); + animatedPropsArray.forEach(animatedProps => { + if (animatedProps?.viewDescriptors && animatedProps.initial) { + Object.keys(animatedProps.initial.value).forEach(initialValueKey => { + props[initialValueKey] = animatedProps.initial?.value[initialValueKey]; + }); + } + }); + } else if (has('workletEventHandler', value) && value.workletEventHandler instanceof WorkletEventHandler) { + if (value.workletEventHandler.eventNames.length > 0) { + value.workletEventHandler.eventNames.forEach(eventName => { + props[eventName] = has('listeners', value.workletEventHandler) ? value.workletEventHandler.listeners[eventName] : dummyListener; }); } else { props[key] = dummyListener; @@ -66,7 +60,7 @@ export class PropsFilter { if (component._isFirstRender) { props[key] = value.value; } - } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) { + } else { props[key] = value; } } diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js.map index 1de50866..0ed2856f 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/PropsFilter.js.map @@ -1 +1 @@ -{"version":3,"names":["_defineProperty","obj","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","Number","isSharedValue","isChromeDebugger","WorkletEventHandler","initialUpdaterRun","hasInlineStyles","getInlineStyle","flattenArray","has","StyleSheet","dummyListener","PropsFilter","constructor","filterNonAnimatedProps","component","inputProps","props","styleProp","style","styles","processedStyle","map","viewDescriptors","viewsRef","add","_isFirstRender","_initialStyle","initial","updater","flatten","animatedProp","animatedProps","keys","forEach","_animatedProp$initial","_animatedProp$viewsRe","current","eventNames","length","eventName","listeners"],"sources":["PropsFilter.tsx"],"sourcesContent":["'use strict';\nimport type { StyleProps, SharedValue } from '../reanimated2';\nimport { isSharedValue } from '../reanimated2';\nimport { isChromeDebugger } from '../reanimated2/PlatformChecker';\nimport WorkletEventHandler from '../reanimated2/WorkletEventHandler';\nimport { initialUpdaterRun } from '../reanimated2/animation';\nimport { hasInlineStyles, getInlineStyle } from './InlinePropManager';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n IAnimatedComponentInternal,\n IPropsFilter,\n} from './commonTypes';\nimport { flattenArray, has } from './utils';\nimport { StyleSheet } from 'react-native';\n\nfunction dummyListener() {\n // empty listener we use to assign to listener properties for which animated\n // event is used.\n}\n\nexport class PropsFilter implements IPropsFilter {\n private _initialStyle = {};\n\n public filterNonAnimatedProps(\n component: React.Component & IAnimatedComponentInternal\n ): Record {\n const inputProps =\n component.props as AnimatedComponentProps;\n const props: Record = {};\n for (const key in inputProps) {\n const value = inputProps[key];\n if (key === 'style') {\n const styleProp = inputProps.style;\n const styles = flattenArray(styleProp ?? []);\n const processedStyle: StyleProps = styles.map((style) => {\n if (style && style.viewDescriptors) {\n // this is how we recognize styles returned by useAnimatedStyle\n style.viewsRef.add(component);\n if (component._isFirstRender) {\n this._initialStyle = {\n ...style.initial.value,\n ...this._initialStyle,\n ...initialUpdaterRun(style.initial.updater),\n };\n }\n return this._initialStyle;\n } else if (hasInlineStyles(style)) {\n return getInlineStyle(style, component._isFirstRender);\n } else {\n return style;\n }\n });\n props[key] = StyleSheet.flatten(processedStyle);\n } else if (key === 'animatedProps') {\n const animatedProp = inputProps.animatedProps as Partial<\n AnimatedComponentProps\n >;\n if (animatedProp.initial !== undefined) {\n Object.keys(animatedProp.initial.value).forEach((key) => {\n props[key] = animatedProp.initial?.value[key];\n animatedProp.viewsRef?.add(component);\n });\n }\n } else if (\n has('current', value) &&\n value.current instanceof WorkletEventHandler\n ) {\n if (value.current.eventNames.length > 0) {\n value.current.eventNames.forEach((eventName) => {\n props[eventName] = has('listeners', value.current)\n ? (value.current.listeners as Record)[eventName]\n : dummyListener;\n });\n } else {\n props[key] = dummyListener;\n }\n } else if (isSharedValue(value)) {\n if (component._isFirstRender) {\n props[key] = (value as SharedValue).value;\n }\n } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) {\n props[key] = value;\n }\n }\n return props;\n }\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,IAAAD,GAAA,GAAAE,cAAA,CAAAF,GAAA,OAAAA,GAAA,IAAAD,GAAA,IAAAI,MAAA,CAAAC,cAAA,CAAAL,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAI,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAR,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAAA,SAAAG,eAAAM,GAAA,QAAAR,GAAA,GAAAS,YAAA,CAAAD,GAAA,2BAAAR,GAAA,gBAAAA,GAAA,GAAAU,MAAA,CAAAV,GAAA;AAAA,SAAAS,aAAAE,KAAA,EAAAC,IAAA,eAAAD,KA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,CAACC,MAAM,GAAG,CAAC,EAAE;UACvCzD,KAAK,CAACuD,OAAO,CAACC,UAAU,CAACJ,OAAO,CAAEM,SAAS,IAAK;YAC9CvB,KAAK,CAACuB,SAAS,CAAC,GAAG/B,GAAG,CAAC,WAAW,EAAE3B,KAAK,CAACuD,OAAO,CAAC,GAC7CvD,KAAK,CAACuD,OAAO,CAACI,SAAS,CAA6BD,SAAS,CAAC,GAC/D7B,aAAa;UACnB,CAAC,CAAC;QACJ,CAAC,MAAM;UACLM,KAAK,CAACpC,GAAG,CAAC,GAAG8B,aAAa;QAC5B;MACF,CAAC,MAAM,IAAIT,aAAa,CAACpB,KAAK,CAAC,EAAE;QAC/B,IAAIiC,SAAS,CAACW,cAAc,EAAE;UAC5BT,KAAK,CAACpC,GAAG,CAAC,GAAIC,KAAK,CAA0BA,KAAK;QACpD;MACF,CAAC,MAAM,IAAID,GAAG,KAAK,6BAA6B,IAAI,CAACsB,gBAAgB,EAAE,EAAE;QACvEc,KAAK,CAACpC,GAAG,CAAC,GAAGC,KAAK;MACpB;IACF;IACA,OAAOmC,KAAK;EACd;AACF"} \ No newline at end of file +{"version":3,"names":["initialUpdaterRun","isSharedValue","WorkletEventHandler","getInlineStyle","hasInlineStyles","flattenArray","has","dummyListener","PropsFilter","_initialPropsMap","Map","filterNonAnimatedProps","component","inputProps","props","key","value","styleProp","style","styles","processedStyle","map","viewDescriptors","handle","_isFirstRender","set","initial","updater","get","animatedPropsProp","animatedProps","animatedPropsArray","forEach","Object","keys","initialValueKey","workletEventHandler","eventNames","length","eventName","listeners"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/PropsFilter.tsx"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,iBAAiB,QAAQ,cAAc;AAGhD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,mBAAmB,QAAQ,wBAAwB;AAQ5D,SAASC,cAAc,EAAEC,eAAe,QAAQ,qBAAqB;AACrE,SAASC,YAAY,EAAEC,GAAG,QAAQ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AOF,KAAK;EACd;AACF","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/commonTypes.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/commonTypes.js.map index 5c4b7af0..e9870b32 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/commonTypes.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/commonTypes.js.map @@ -1 +1 @@ -{"version":3,"names":[],"sources":["commonTypes.ts"],"sourcesContent":["'use strict';\nimport type { Ref, Component } from 'react';\nimport type {\n StyleProps,\n BaseAnimationBuilder,\n ILayoutAnimationBuilder,\n EntryExitAnimationFunction,\n SharedTransition,\n SharedValue,\n} from '../reanimated2';\nimport type {\n ViewDescriptorsSet,\n ViewRefSet,\n} from '../reanimated2/ViewDescriptorsSet';\nimport type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport type { ViewConfig } from '../ConfigHelper';\n\nexport interface AnimatedProps extends Record {\n viewDescriptors?: ViewDescriptorsSet;\n viewsRef?: ViewRefSet;\n initial?: SharedValue;\n}\n\nexport interface ViewInfo {\n viewTag: number | HTMLElement | null;\n viewName: string | null;\n shadowNodeWrapper: ShadowNodeWrapper | null;\n viewConfig: ViewConfig;\n}\n\nexport interface IInlinePropManager {\n attachInlineProps(\n animatedComponent: React.Component,\n viewInfo: ViewInfo\n ): void;\n detachInlineProps(): void;\n}\n\nexport interface IPropsFilter {\n filterNonAnimatedProps: (\n component: React.Component & IAnimatedComponentInternal\n ) => Record;\n}\n\nexport interface IJSPropsUpdater {\n addOnJSPropsChangeListener(\n animatedComponent: React.Component &\n IAnimatedComponentInternal\n ): void;\n removeOnJSPropsChangeListener(\n animatedComponent: React.Component &\n IAnimatedComponentInternal\n ): void;\n}\n\nexport type LayoutAnimationStaticContext = {\n presetName: string;\n};\n\nexport type AnimatedComponentProps

> = P & {\n forwardedRef?: Ref;\n style?: NestedArray;\n animatedProps?: Partial>;\n animatedStyle?: StyleProps;\n layout?: (\n | BaseAnimationBuilder\n | ILayoutAnimationBuilder\n | typeof BaseAnimationBuilder\n ) &\n LayoutAnimationStaticContext;\n entering?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n exiting?: (\n | BaseAnimationBuilder\n | typeof BaseAnimationBuilder\n | EntryExitAnimationFunction\n | Keyframe\n ) &\n LayoutAnimationStaticContext;\n sharedTransitionTag?: string;\n sharedTransitionStyle?: SharedTransition;\n};\n\nexport interface AnimatedComponentRef extends Component {\n setNativeProps?: (props: Record) => void;\n getScrollableNode?: () => AnimatedComponentRef;\n getAnimatableRef?: () => AnimatedComponentRef;\n}\n\nexport interface IAnimatedComponentInternal {\n _styles: StyleProps[] | null;\n _animatedProps?: Partial>;\n _viewTag: number;\n _isFirstRender: boolean;\n animatedStyle: { value: StyleProps };\n _component: AnimatedComponentRef | HTMLElement | null;\n _sharedElementTransition: SharedTransition | null;\n _jsPropsUpdater: IJSPropsUpdater;\n _InlinePropManager: IInlinePropManager;\n _PropsFilter: IPropsFilter;\n _viewInfo?: ViewInfo;\n context: React.ContextType;\n}\n\nexport type NestedArray = T | NestedArray[];\n\nexport interface InitialComponentProps extends Record {\n ref?: Ref;\n collapsable?: boolean;\n}\n"],"mappings":"AAAA,YAAY;;AAAC"} \ No newline at end of file +{"version":3,"names":[],"sourceRoot":"../../../src","sources":["createAnimatedComponent/commonTypes.ts"],"mappings":"AAAA,YAAY;;AAAC","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js index c972d50a..9ddd602f 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js @@ -1,41 +1,9 @@ 'use strict'; -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } import React from 'react'; -import { findNodeHandle, Platform } from 'react-native'; -import WorkletEventHandler from '../reanimated2/WorkletEventHandler'; -import '../reanimated2/layoutReanimation/animationsManager'; -import invariant from 'invariant'; -import { adaptViewConfig } from '../ConfigHelper'; -import { RNRenderer } from '../reanimated2/platform-specific/RNRenderer'; -import { configureLayoutAnimations, enableLayoutAnimations } from '../reanimated2/core'; -import { SharedTransition, LayoutAnimationType } from '../reanimated2/layoutReanimation'; -import { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils'; -import { removeFromPropsRegistry } from '../reanimated2/PropsRegistry'; -import { getReduceMotionFromConfig } from '../reanimated2/animation/util'; -import { maybeBuild } from '../animationBuilder'; -import { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig'; -import JSPropsUpdater from './JSPropsUpdater'; -import { has, flattenArray } from './utils'; -import setAndForwardRef from './setAndForwardRef'; -import { isFabric, isJest, isWeb, shouldBeUseWeb } from '../reanimated2/PlatformChecker'; -import { InlinePropManager } from './InlinePropManager'; -import { PropsFilter } from './PropsFilter'; -import { startWebLayoutAnimation, tryActivateLayoutTransition, configureWebLayoutAnimations, getReducedMotionFromConfig } from '../reanimated2/layoutReanimation/web'; -const IS_WEB = isWeb(); -const IS_FABRIC = isFabric(); -function onlyAnimatedStyles(styles) { - return styles.filter(style => style === null || style === void 0 ? void 0 : style.viewDescriptors); -} -function isSameAnimatedStyle(style1, style2) { - // We cannot use equality check to compare useAnimatedStyle outputs directly. - // Instead, we can compare its viewsRefs. - return (style1 === null || style1 === void 0 ? void 0 : style1.viewsRef) === (style2 === null || style2 === void 0 ? void 0 : style2.viewsRef); -} -const isSameAnimatedProps = isSameAnimatedStyle; +import AnimatedComponentImpl from './AnimatedComponent'; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any /** * Lets you create an Animated version of any React Native component. @@ -45,366 +13,39 @@ const isSameAnimatedProps = isSameAnimatedStyle; * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent */ +// Don't change the order of overloads, since such a change breaks current behavior + /** - * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually. - */ // @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList + * @deprecated Please use `Animated.FlatList` component instead of calling + * `Animated.createAnimatedComponent(FlatList)` manually. + */ +// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList +import { jsx as _jsx } from "react/jsx-runtime"; export function createAnimatedComponent(Component, options) { - invariant(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, `Looks like you're passing a function component \`${Component.name}\` to \`createAnimatedComponent\` function which supports only class components. Please wrap your function component with \`React.forwardRef()\` or use a class component instead.`); - class AnimatedComponent extends React.Component { + class AnimatedComponent extends AnimatedComponentImpl { + static displayName = `AnimatedComponent(${Component.displayName || Component.name || 'Component'})`; constructor(props) { - super(props); - _defineProperty(this, "_styles", null); - _defineProperty(this, "_animatedProps", void 0); - _defineProperty(this, "_viewTag", -1); - _defineProperty(this, "_isFirstRender", true); - _defineProperty(this, "animatedStyle", { - value: {} - }); - _defineProperty(this, "_component", null); - _defineProperty(this, "_sharedElementTransition", null); - _defineProperty(this, "_jsPropsUpdater", new JSPropsUpdater()); - _defineProperty(this, "_InlinePropManager", new InlinePropManager()); - _defineProperty(this, "_PropsFilter", new PropsFilter()); - _defineProperty(this, "_viewInfo", void 0); - _defineProperty(this, "context", void 0); - _defineProperty(this, "_setComponentRef", setAndForwardRef({ - getForwardedRef: () => this.props.forwardedRef, - setLocalRef: ref => { - // TODO update config - - const tag = IS_WEB ? ref : findNodeHandle(ref); - const { - layout, - entering, - exiting, - sharedTransitionTag - } = this.props; - if ((layout || entering || exiting || sharedTransitionTag) && tag != null) { - var _this$context; - if (!shouldBeUseWeb()) { - enableLayoutAnimations(true, false); - } - if (layout) { - configureLayoutAnimations(tag, LayoutAnimationType.LAYOUT, maybeBuild(layout, undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */, AnimatedComponent.displayName)); - } - const skipEntering = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.current; - if (entering && !skipEntering) { - var _this$props; - configureLayoutAnimations(tag, LayoutAnimationType.ENTERING, maybeBuild(entering, (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.style, AnimatedComponent.displayName)); - } - if (exiting) { - const reduceMotionInExiting = 'getReduceMotion' in exiting && typeof exiting.getReduceMotion === 'function' ? getReduceMotionFromConfig(exiting.getReduceMotion()) : getReduceMotionFromConfig(); - if (!reduceMotionInExiting) { - var _this$props2; - configureLayoutAnimations(tag, LayoutAnimationType.EXITING, maybeBuild(exiting, (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : _this$props2.style, AnimatedComponent.displayName)); - } - } - if (sharedTransitionTag && !IS_WEB) { - const sharedElementTransition = this.props.sharedTransitionStyle ?? new SharedTransition(); - const reduceMotionInTransition = getReduceMotionFromConfig(sharedElementTransition.getReduceMotion()); - if (!reduceMotionInTransition) { - sharedElementTransition.registerTransition(tag, sharedTransitionTag); - this._sharedElementTransition = sharedElementTransition; - } - } - } - if (ref !== this._component) { - this._component = ref; - } - } - })); - if (isJest()) { - this.animatedStyle = { - value: {} - }; - } - } - componentDidMount() { - this._attachNativeEvents(); - this._jsPropsUpdater.addOnJSPropsChangeListener(this); - this._attachAnimatedStyles(); - this._InlinePropManager.attachInlineProps(this, this._getViewInfo()); - if (IS_WEB) { - configureWebLayoutAnimations(); - if (!this.props.entering) { - this._isFirstRender = false; - return; - } - if (getReducedMotionFromConfig(this.props.entering)) { - this._isFirstRender = false; - return; - } - startWebLayoutAnimation(this.props, this._component, LayoutAnimationType.ENTERING); - } - this._isFirstRender = false; - } - componentWillUnmount() { - var _this$_sharedElementT; - this._detachNativeEvents(); - this._jsPropsUpdater.removeOnJSPropsChangeListener(this); - this._detachStyles(); - this._InlinePropManager.detachInlineProps(); - (_this$_sharedElementT = this._sharedElementTransition) === null || _this$_sharedElementT === void 0 ? void 0 : _this$_sharedElementT.unregisterTransition(this._viewTag); - if (IS_WEB && this.props.exiting && !getReducedMotionFromConfig(this.props.exiting)) { - startWebLayoutAnimation(this.props, this._component, LayoutAnimationType.EXITING); - } - } - _getEventViewRef() { - var _this$_component, _getScrollableNode, _ref; - // Make sure to get the scrollable node for components that implement - // `ScrollResponder.Mixin`. - return (_this$_component = this._component) !== null && _this$_component !== void 0 && _this$_component.getScrollableNode ? (_getScrollableNode = (_ref = this._component).getScrollableNode) === null || _getScrollableNode === void 0 ? void 0 : _getScrollableNode.call(_ref) : this._component; - } - _attachNativeEvents() { - const node = this._getEventViewRef(); - let viewTag = null; // We set it only if needed - - for (const key in this.props) { - const prop = this.props[key]; - if (has('current', prop) && prop.current instanceof WorkletEventHandler) { - if (viewTag === null) { - viewTag = findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node); - } - prop.current.registerForEvents(viewTag, key); - } - } - } - _detachNativeEvents() { - for (const key in this.props) { - const prop = this.props[key]; - if (has('current', prop) && prop.current instanceof WorkletEventHandler) { - prop.current.unregisterFromEvents(); - } - } - } - _detachStyles() { - if (IS_WEB && this._styles !== null) { - for (const style of this._styles) { - if (style !== null && style !== void 0 && style.viewsRef) { - style.viewsRef.remove(this); - } - } - } else if (this._viewTag !== -1 && this._styles !== null) { - var _this$props$animatedP; - for (const style of this._styles) { - style.viewDescriptors.remove(this._viewTag); - } - if ((_this$props$animatedP = this.props.animatedProps) !== null && _this$props$animatedP !== void 0 && _this$props$animatedP.viewDescriptors) { - this.props.animatedProps.viewDescriptors.remove(this._viewTag); - } - if (IS_FABRIC) { - removeFromPropsRegistry(this._viewTag); - } - } - } - _reattachNativeEvents(prevProps) { - for (const key in prevProps) { - const prop = this.props[key]; - if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) { - prop.current.unregisterFromEvents(); - } - } - let viewTag = null; - for (const key in this.props) { - const prop = this.props[key]; - if (has('current', prop) && prop.current instanceof WorkletEventHandler && prop.current.reattachNeeded) { - if (viewTag === null) { - const node = this._getEventViewRef(); - viewTag = findNodeHandle(options !== null && options !== void 0 && options.setNativeProps ? this : node); - } - prop.current.registerForEvents(viewTag, key); - prop.current.reattachNeeded = false; - } - } - } - _updateFromNative(props) { - if (options !== null && options !== void 0 && options.setNativeProps) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - options.setNativeProps(this._component, props); - } else { - var _this$_component2, _this$_component2$set; - // eslint-disable-next-line no-unused-expressions - (_this$_component2 = this._component) === null || _this$_component2 === void 0 ? void 0 : (_this$_component2$set = _this$_component2.setNativeProps) === null || _this$_component2$set === void 0 ? void 0 : _this$_component2$set.call(_this$_component2, props); - } - } - _getViewInfo() { - var _this$_component3, _getAnimatableRef, _ref2; - if (this._viewInfo !== undefined) { - return this._viewInfo; - } - let viewTag; - let viewName; - let shadowNodeWrapper = null; - let viewConfig; - // Component can specify ref which should be animated when animated version of the component is created. - // Otherwise, we animate the component itself. - const component = (_this$_component3 = this._component) !== null && _this$_component3 !== void 0 && _this$_component3.getAnimatableRef ? (_getAnimatableRef = (_ref2 = this._component).getAnimatableRef) === null || _getAnimatableRef === void 0 ? void 0 : _getAnimatableRef.call(_ref2) : this; - if (IS_WEB) { - // At this point I assume that `_setComponentRef` was already called and `_component` is set. - // `this._component` on web represents HTMLElement of our component, that's why we use casting - viewTag = this._component; - viewName = null; - shadowNodeWrapper = null; - viewConfig = null; - } else { - var _hostInstance$viewCon; - // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx - const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component); - if (!hostInstance) { - throw new Error('[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'); - } - // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146 - viewTag = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance._nativeTag; - /** - * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24). - * The name we're looking for is in the field named uiViewClassName. - */ - viewName = hostInstance === null || hostInstance === void 0 ? void 0 : (_hostInstance$viewCon = hostInstance.viewConfig) === null || _hostInstance$viewCon === void 0 ? void 0 : _hostInstance$viewCon.uiViewClassName; - viewConfig = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.viewConfig; - if (IS_FABRIC) { - shadowNodeWrapper = getShadowNodeWrapperFromRef(this); - } - } - this._viewInfo = { - viewTag, - viewName, - shadowNodeWrapper, - viewConfig - }; - return this._viewInfo; - } - _attachAnimatedStyles() { - var _this$props$animatedP2, _this$props$animatedP3; - const styles = this.props.style ? onlyAnimatedStyles(flattenArray(this.props.style)) : []; - const prevStyles = this._styles; - this._styles = styles; - const prevAnimatedProps = this._animatedProps; - this._animatedProps = this.props.animatedProps; - const { - viewTag, - viewName, - shadowNodeWrapper, - viewConfig - } = this._getViewInfo(); - - // update UI props whitelist for this view - const hasReanimated2Props = ((_this$props$animatedP2 = this.props.animatedProps) === null || _this$props$animatedP2 === void 0 ? void 0 : _this$props$animatedP2.viewDescriptors) || styles.length; - if (hasReanimated2Props && viewConfig) { - adaptViewConfig(viewConfig); - } - this._viewTag = viewTag; - - // remove old styles - if (prevStyles) { - // in most of the cases, views have only a single animated style and it remains unchanged - const hasOneSameStyle = styles.length === 1 && prevStyles.length === 1 && isSameAnimatedStyle(styles[0], prevStyles[0]); - if (!hasOneSameStyle) { - // otherwise, remove each style that is not present in new styles - for (const prevStyle of prevStyles) { - const isPresent = styles.some(style => isSameAnimatedStyle(style, prevStyle)); - if (!isPresent) { - prevStyle.viewDescriptors.remove(viewTag); - } - } - } - } - styles.forEach(style => { - style.viewDescriptors.add({ - tag: viewTag, - name: viewName, - shadowNodeWrapper - }); - if (isJest()) { - /** - * We need to connect Jest's TestObject instance whose contains just props object - * with the updateProps() function where we update the properties of the component. - * We can't update props object directly because TestObject contains a copy of props - look at render function: - * const props = this._filterNonAnimatedProps(this.props); - */ - this.animatedStyle.value = { - ...this.animatedStyle.value, - ...style.initial.value - }; - style.animatedStyle.current = this.animatedStyle; - } - }); - - // detach old animatedProps - if (prevAnimatedProps && !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)) { - prevAnimatedProps.viewDescriptors.remove(viewTag); - } - - // attach animatedProps property - if ((_this$props$animatedP3 = this.props.animatedProps) !== null && _this$props$animatedP3 !== void 0 && _this$props$animatedP3.viewDescriptors) { - this.props.animatedProps.viewDescriptors.add({ - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - tag: viewTag, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - name: viewName, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - shadowNodeWrapper: shadowNodeWrapper - }); - } - } - componentDidUpdate(prevProps, _prevState, - // This type comes straight from React - // eslint-disable-next-line @typescript-eslint/no-explicit-any - snapshot) { - this._reattachNativeEvents(prevProps); - this._attachAnimatedStyles(); - this._InlinePropManager.attachInlineProps(this, this._getViewInfo()); - - // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method - if (IS_WEB && snapshot !== null && this.props.layout && !getReducedMotionFromConfig(this.props.layout)) { - tryActivateLayoutTransition(this.props, this._component, snapshot); - } - } - // This is a component lifecycle method from React, therefore we are not calling it directly. - // It is called before the component gets rerendered. This way we can access components' position before it changed - // and later on, in componentDidUpdate, calculate translation for layout transition. - getSnapshotBeforeUpdate() { - if (this._component.getBoundingClientRect !== undefined) { - return this._component.getBoundingClientRect(); - } - return null; - } - render() { - const props = this._PropsFilter.filterNonAnimatedProps(this); - if (isJest()) { - props.animatedStyle = this.animatedStyle; - } - - // Layout animations on web are set inside `componentDidMount` method, which is called after first render. - // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers. - // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else, - // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`. - if (this._isFirstRender && IS_WEB && props.entering && !getReducedMotionFromConfig(props.entering)) { - props.style = { - ...(props.style ?? {}), - visibility: 'hidden' // Hide component until `componentDidMount` triggers - }; - } - - const platformProps = Platform.select({ - web: {}, - default: { - collapsable: false - } - }); - return /*#__PURE__*/React.createElement(Component, _extends({}, props, { - // Casting is used here, because ref can be null - in that case it cannot be assigned to HTMLElement. - // After spending some time trying to figure out what to do with this problem, we decided to leave it this way - ref: this._setComponentRef - }, platformProps)); + // User can override component-defined jsProps via options + const jsProps = options?.jsProps ?? Component.jsProps; + const modifiedOptions = jsProps?.length ? { + ...options, + jsProps + } : options; + super(Component, props, AnimatedComponent.displayName, modifiedOptions); } } - _defineProperty(AnimatedComponent, "displayName", void 0); - _defineProperty(AnimatedComponent, "contextType", SkipEnteringContext); - AnimatedComponent.displayName = `AnimatedComponent(${Component.displayName || Component.name || 'Component'})`; - return /*#__PURE__*/React.forwardRef((props, ref) => { - return /*#__PURE__*/React.createElement(AnimatedComponent, _extends({}, props, ref === null ? null : { - forwardedRef: ref - })); - }); + const animatedComponent = props => { + return /*#__PURE__*/_jsx(AnimatedComponent, { + ...props, + // Needed to prevent react from signing AnimatedComponent to the ref + // (we want to handle the ref assignment in the AnimatedComponent) + ref: null, + ...(props.ref === null ? null : { + forwardedRef: props.ref + }) + }); + }; + animatedComponent.displayName = Component.displayName || Component.name || 'Component'; + return animatedComponent; } //# sourceMappingURL=createAnimatedComponent.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js.map index 7d3d18af..2a87223b 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js.map @@ -1 +1 @@ -{"version":3,"names":["_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_defineProperty","obj","value","_toPropertyKey","defineProperty","enumerable","configurable","writable","arg","_toPrimitive","String","input","hint","prim","Symbol","toPrimitive","undefined","res","TypeError","Number","React","findNodeHandle","Platform","WorkletEventHandler","invariant","adaptViewConfig","RNRenderer","configureLayoutAnimations","enableLayoutAnimations","SharedTransition","LayoutAnimationType","getShadowNodeWrapperFromRef","removeFromPropsRegistry","getReduceMotionFromConfig","maybeBuild","SkipEnteringContext","JSPropsUpdater","has","flattenArray","setAndForwardRef","isFabric","isJest","isWeb","shouldBeUseWeb","InlinePropManager","PropsFilter","startWebLayoutAnimation","tryActivateLayoutTransition","configureWebLayoutAnimations","getReducedMotionFromConfig","IS_WEB","IS_FABRIC","onlyAnimatedStyles","styles","filter","style","viewDescriptors","isSameAnimatedStyle","style1","style2","viewsRef","isSameAnimatedProps","createAnimatedComponent","Component","options","isReactComponent","name","AnimatedComponent","constructor","props","getForwardedRef","forwardedRef","setLocalRef","ref","tag","layout","entering","exiting","sharedTransitionTag","_this$context","LAYOUT","displayName","skipEntering","context","current","_this$props","ENTERING","reduceMotionInExiting","getReduceMotion","_this$props2","EXITING","sharedElementTransition","sharedTransitionStyle","reduceMotionInTransition","registerTransition","_sharedElementTransition","_component","animatedStyle","componentDidMount","_attachNativeEvents","_jsPropsUpdater","addOnJSPropsChangeListener","_attachAnimatedStyles","_InlinePropManager","attachInlineProps","_getViewInfo","_isFirstRender","componentWillUnmount","_this$_sharedElementT","_detachNativeEvents","removeOnJSPropsChangeListener","_detachStyles","detachInlineProps","unregisterTransition","_viewTag","_getEventViewRef","_this$_component","_getScrollableNode","_ref","getScrollableNode","node","viewTag","prop","setNativeProps","registerForEvents","unregisterFromEvents","_styles","remove","_this$props$animatedP","animatedProps","_reattachNativeEvents","prevProps","reattachNeeded","_updateFromNative","_this$_component2","_this$_component2$set","_this$_component3","_getAnimatableRef","_ref2","_viewInfo","viewName","shadowNodeWrapper","viewConfig","component","getAnimatableRef","_hostInstance$viewCon","hostInstance","findHostInstance_DEPRECATED","Error","_nativeTag","uiViewClassName","_this$props$animatedP2","_this$props$animatedP3","prevStyles","prevAnimatedProps","_animatedProps","hasReanimated2Props","hasOneSameStyle","prevStyle","isPresent","some","forEach","add","initial","componentDidUpdate","_prevState","snapshot","getSnapshotBeforeUpdate","getBoundingClientRect","render","_PropsFilter","filterNonAnimatedProps","visibility","platformProps","select","web","default","collapsable","createElement","_setComponentRef","forwardRef"],"sources":["createAnimatedComponent.tsx"],"sourcesContent":["'use strict';\nimport type {\n Component,\n ComponentClass,\n ComponentType,\n FunctionComponent,\n MutableRefObject,\n} from 'react';\nimport React from 'react';\nimport { findNodeHandle, Platform } from 'react-native';\nimport WorkletEventHandler from '../reanimated2/WorkletEventHandler';\nimport '../reanimated2/layoutReanimation/animationsManager';\nimport invariant from 'invariant';\nimport { adaptViewConfig } from '../ConfigHelper';\nimport { RNRenderer } from '../reanimated2/platform-specific/RNRenderer';\nimport {\n configureLayoutAnimations,\n enableLayoutAnimations,\n} from '../reanimated2/core';\nimport {\n SharedTransition,\n LayoutAnimationType,\n} from '../reanimated2/layoutReanimation';\nimport type { StyleProps, ShadowNodeWrapper } from '../reanimated2/commonTypes';\nimport { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils';\nimport { removeFromPropsRegistry } from '../reanimated2/PropsRegistry';\nimport { getReduceMotionFromConfig } from '../reanimated2/animation/util';\nimport { maybeBuild } from '../animationBuilder';\nimport { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig';\nimport type { AnimateProps } from '../reanimated2';\nimport JSPropsUpdater from './JSPropsUpdater';\nimport type {\n AnimatedComponentProps,\n AnimatedProps,\n InitialComponentProps,\n AnimatedComponentRef,\n IAnimatedComponentInternal,\n ViewInfo,\n} from './commonTypes';\nimport { has, flattenArray } from './utils';\nimport setAndForwardRef from './setAndForwardRef';\nimport {\n isFabric,\n isJest,\n isWeb,\n shouldBeUseWeb,\n} from '../reanimated2/PlatformChecker';\nimport { InlinePropManager } from './InlinePropManager';\nimport { PropsFilter } from './PropsFilter';\nimport {\n startWebLayoutAnimation,\n tryActivateLayoutTransition,\n configureWebLayoutAnimations,\n getReducedMotionFromConfig,\n} from '../reanimated2/layoutReanimation/web';\nimport type { CustomConfig } from '../reanimated2/layoutReanimation/web/config';\nimport type { FlatList, FlatListProps } from 'react-native';\n\nconst IS_WEB = isWeb();\nconst IS_FABRIC = isFabric();\n\nfunction onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] {\n return styles.filter((style) => style?.viewDescriptors);\n}\n\nfunction isSameAnimatedStyle(\n style1?: StyleProps,\n style2?: StyleProps\n): boolean {\n // We cannot use equality check to compare useAnimatedStyle outputs directly.\n // Instead, we can compare its viewsRefs.\n return style1?.viewsRef === style2?.viewsRef;\n}\n\nconst isSameAnimatedProps = isSameAnimatedStyle;\n\ntype Options

= {\n setNativeProps: (ref: AnimatedComponentRef, props: P) => void;\n};\n\n/**\n * Lets you create an Animated version of any React Native component.\n *\n * @param component - The component you want to make animatable.\n * @returns A component that Reanimated is capable of animating.\n * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent\n */\n\n/**\n * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually.\n */\n// @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList\nexport function createAnimatedComponent(\n component: typeof FlatList,\n options?: Options\n): ComponentClass>>;\n\nexport function createAnimatedComponent

(\n component: FunctionComponent

,\n options?: Options

\n): FunctionComponent>;\n\nexport function createAnimatedComponent

(\n component: ComponentClass

,\n options?: Options

\n): ComponentClass>;\n\nexport function createAnimatedComponent(\n Component: ComponentType,\n options?: Options\n): any {\n invariant(\n typeof Component !== 'function' ||\n (Component.prototype && Component.prototype.isReactComponent),\n `Looks like you're passing a function component \\`${Component.name}\\` to \\`createAnimatedComponent\\` function which supports only class components. Please wrap your function component with \\`React.forwardRef()\\` or use a class component instead.`\n );\n\n class AnimatedComponent\n extends React.Component>\n implements IAnimatedComponentInternal\n {\n _styles: StyleProps[] | null = null;\n _animatedProps?: Partial>;\n _viewTag = -1;\n _isFirstRender = true;\n animatedStyle: { value: StyleProps } = { value: {} };\n _component: AnimatedComponentRef | HTMLElement | null = null;\n _sharedElementTransition: SharedTransition | null = null;\n _jsPropsUpdater = new JSPropsUpdater();\n _InlinePropManager = new InlinePropManager();\n _PropsFilter = new PropsFilter();\n _viewInfo?: ViewInfo;\n static displayName: string;\n static contextType = SkipEnteringContext;\n context!: React.ContextType;\n\n constructor(props: AnimatedComponentProps) {\n super(props);\n if (isJest()) {\n this.animatedStyle = { value: {} };\n }\n }\n\n componentDidMount() {\n this._attachNativeEvents();\n this._jsPropsUpdater.addOnJSPropsChangeListener(this);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n if (IS_WEB) {\n configureWebLayoutAnimations();\n\n if (!this.props.entering) {\n this._isFirstRender = false;\n return;\n }\n\n if (getReducedMotionFromConfig(this.props.entering as CustomConfig)) {\n this._isFirstRender = false;\n return;\n }\n\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.ENTERING\n );\n }\n\n this._isFirstRender = false;\n }\n\n componentWillUnmount() {\n this._detachNativeEvents();\n this._jsPropsUpdater.removeOnJSPropsChangeListener(this);\n this._detachStyles();\n this._InlinePropManager.detachInlineProps();\n this._sharedElementTransition?.unregisterTransition(this._viewTag);\n\n if (\n IS_WEB &&\n this.props.exiting &&\n !getReducedMotionFromConfig(this.props.exiting as CustomConfig)\n ) {\n startWebLayoutAnimation(\n this.props,\n this._component as HTMLElement,\n LayoutAnimationType.EXITING\n );\n }\n }\n\n _getEventViewRef() {\n // Make sure to get the scrollable node for components that implement\n // `ScrollResponder.Mixin`.\n return (this._component as AnimatedComponentRef)?.getScrollableNode\n ? (this._component as AnimatedComponentRef).getScrollableNode?.()\n : this._component;\n }\n\n _attachNativeEvents() {\n const node = this._getEventViewRef() as AnimatedComponentRef;\n let viewTag = null; // We set it only if needed\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n if (viewTag === null) {\n viewTag = findNodeHandle(options?.setNativeProps ? this : node);\n }\n prop.current.registerForEvents(viewTag as number, key);\n }\n }\n }\n\n _detachNativeEvents() {\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n }\n\n _detachStyles() {\n if (IS_WEB && this._styles !== null) {\n for (const style of this._styles) {\n if (style?.viewsRef) {\n style.viewsRef.remove(this);\n }\n }\n } else if (this._viewTag !== -1 && this._styles !== null) {\n for (const style of this._styles) {\n style.viewDescriptors.remove(this._viewTag);\n }\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.remove(this._viewTag);\n }\n if (IS_FABRIC) {\n removeFromPropsRegistry(this._viewTag);\n }\n }\n }\n\n _reattachNativeEvents(\n prevProps: AnimatedComponentProps\n ) {\n for (const key in prevProps) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n prop.current.unregisterFromEvents();\n }\n }\n\n let viewTag = null;\n\n for (const key in this.props) {\n const prop = this.props[key];\n if (\n has('current', prop) &&\n prop.current instanceof WorkletEventHandler &&\n prop.current.reattachNeeded\n ) {\n if (viewTag === null) {\n const node = this._getEventViewRef() as AnimatedComponentRef;\n viewTag = findNodeHandle(options?.setNativeProps ? this : node);\n }\n prop.current.registerForEvents(viewTag as number, key);\n prop.current.reattachNeeded = false;\n }\n }\n }\n\n _updateFromNative(props: StyleProps) {\n if (options?.setNativeProps) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n options.setNativeProps(this._component as AnimatedComponentRef, props);\n } else {\n // eslint-disable-next-line no-unused-expressions\n (this._component as AnimatedComponentRef)?.setNativeProps?.(props);\n }\n }\n\n _getViewInfo(): ViewInfo {\n if (this._viewInfo !== undefined) {\n return this._viewInfo;\n }\n\n let viewTag: number | HTMLElement | null;\n let viewName: string | null;\n let shadowNodeWrapper: ShadowNodeWrapper | null = null;\n let viewConfig;\n // Component can specify ref which should be animated when animated version of the component is created.\n // Otherwise, we animate the component itself.\n const component = (this._component as AnimatedComponentRef)\n ?.getAnimatableRef\n ? (this._component as AnimatedComponentRef).getAnimatableRef?.()\n : this;\n\n if (IS_WEB) {\n // At this point I assume that `_setComponentRef` was already called and `_component` is set.\n // `this._component` on web represents HTMLElement of our component, that's why we use casting\n viewTag = this._component as HTMLElement;\n viewName = null;\n shadowNodeWrapper = null;\n viewConfig = null;\n } else {\n // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx\n const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component);\n if (!hostInstance) {\n throw new Error(\n '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?'\n );\n }\n // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146\n viewTag = hostInstance?._nativeTag;\n /**\n * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24).\n * The name we're looking for is in the field named uiViewClassName.\n */\n viewName = hostInstance?.viewConfig?.uiViewClassName;\n\n viewConfig = hostInstance?.viewConfig;\n\n if (IS_FABRIC) {\n shadowNodeWrapper = getShadowNodeWrapperFromRef(this);\n }\n }\n this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig };\n return this._viewInfo;\n }\n\n _attachAnimatedStyles() {\n const styles = this.props.style\n ? onlyAnimatedStyles(flattenArray(this.props.style))\n : [];\n const prevStyles = this._styles;\n this._styles = styles;\n\n const prevAnimatedProps = this._animatedProps;\n this._animatedProps = this.props.animatedProps;\n\n const { viewTag, viewName, shadowNodeWrapper, viewConfig } =\n this._getViewInfo();\n\n // update UI props whitelist for this view\n const hasReanimated2Props =\n this.props.animatedProps?.viewDescriptors || styles.length;\n if (hasReanimated2Props && viewConfig) {\n adaptViewConfig(viewConfig);\n }\n\n this._viewTag = viewTag as number;\n\n // remove old styles\n if (prevStyles) {\n // in most of the cases, views have only a single animated style and it remains unchanged\n const hasOneSameStyle =\n styles.length === 1 &&\n prevStyles.length === 1 &&\n isSameAnimatedStyle(styles[0], prevStyles[0]);\n\n if (!hasOneSameStyle) {\n // otherwise, remove each style that is not present in new styles\n for (const prevStyle of prevStyles) {\n const isPresent = styles.some((style) =>\n isSameAnimatedStyle(style, prevStyle)\n );\n if (!isPresent) {\n prevStyle.viewDescriptors.remove(viewTag);\n }\n }\n }\n }\n\n styles.forEach((style) => {\n style.viewDescriptors.add({\n tag: viewTag,\n name: viewName,\n shadowNodeWrapper,\n });\n if (isJest()) {\n /**\n * We need to connect Jest's TestObject instance whose contains just props object\n * with the updateProps() function where we update the properties of the component.\n * We can't update props object directly because TestObject contains a copy of props - look at render function:\n * const props = this._filterNonAnimatedProps(this.props);\n */\n this.animatedStyle.value = {\n ...this.animatedStyle.value,\n ...style.initial.value,\n };\n style.animatedStyle.current = this.animatedStyle;\n }\n });\n\n // detach old animatedProps\n if (\n prevAnimatedProps &&\n !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps)\n ) {\n prevAnimatedProps.viewDescriptors!.remove(viewTag as number);\n }\n\n // attach animatedProps property\n if (this.props.animatedProps?.viewDescriptors) {\n this.props.animatedProps.viewDescriptors.add({\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n tag: viewTag as number,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n name: viewName!,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n shadowNodeWrapper: shadowNodeWrapper!,\n });\n }\n }\n\n componentDidUpdate(\n prevProps: AnimatedComponentProps,\n _prevState: Readonly,\n // This type comes straight from React\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n snapshot: DOMRect | null\n ) {\n this._reattachNativeEvents(prevProps);\n this._attachAnimatedStyles();\n this._InlinePropManager.attachInlineProps(this, this._getViewInfo());\n\n // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method\n if (\n IS_WEB &&\n snapshot !== null &&\n this.props.layout &&\n !getReducedMotionFromConfig(this.props.layout as CustomConfig)\n ) {\n tryActivateLayoutTransition(\n this.props,\n this._component as HTMLElement,\n snapshot\n );\n }\n }\n\n _setComponentRef = setAndForwardRef({\n getForwardedRef: () =>\n this.props.forwardedRef as MutableRefObject<\n Component, Record, unknown>\n >,\n setLocalRef: (ref) => {\n // TODO update config\n\n const tag = IS_WEB\n ? (ref as HTMLElement)\n : findNodeHandle(ref as Component);\n\n const { layout, entering, exiting, sharedTransitionTag } = this.props;\n if (\n (layout || entering || exiting || sharedTransitionTag) &&\n tag != null\n ) {\n if (!shouldBeUseWeb()) {\n enableLayoutAnimations(true, false);\n }\n if (layout) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.LAYOUT,\n maybeBuild(\n layout,\n undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,\n AnimatedComponent.displayName\n )\n );\n }\n const skipEntering = this.context?.current;\n if (entering && !skipEntering) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.ENTERING,\n maybeBuild(\n entering,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n if (exiting) {\n const reduceMotionInExiting =\n 'getReduceMotion' in exiting &&\n typeof exiting.getReduceMotion === 'function'\n ? getReduceMotionFromConfig(exiting.getReduceMotion())\n : getReduceMotionFromConfig();\n if (!reduceMotionInExiting) {\n configureLayoutAnimations(\n tag,\n LayoutAnimationType.EXITING,\n maybeBuild(\n exiting,\n this.props?.style,\n AnimatedComponent.displayName\n )\n );\n }\n }\n if (sharedTransitionTag && !IS_WEB) {\n const sharedElementTransition =\n this.props.sharedTransitionStyle ?? new SharedTransition();\n const reduceMotionInTransition = getReduceMotionFromConfig(\n sharedElementTransition.getReduceMotion()\n );\n if (!reduceMotionInTransition) {\n sharedElementTransition.registerTransition(\n tag as number,\n sharedTransitionTag\n );\n this._sharedElementTransition = sharedElementTransition;\n }\n }\n }\n\n if (ref !== this._component) {\n this._component = ref;\n }\n },\n });\n\n // This is a component lifecycle method from React, therefore we are not calling it directly.\n // It is called before the component gets rerendered. This way we can access components' position before it changed\n // and later on, in componentDidUpdate, calculate translation for layout transition.\n getSnapshotBeforeUpdate() {\n if (\n (this._component as HTMLElement).getBoundingClientRect !== undefined\n ) {\n return (this._component as HTMLElement).getBoundingClientRect();\n }\n\n return null;\n }\n\n render() {\n const props = this._PropsFilter.filterNonAnimatedProps(this);\n\n if (isJest()) {\n props.animatedStyle = this.animatedStyle;\n }\n\n // Layout animations on web are set inside `componentDidMount` method, which is called after first render.\n // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers.\n // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else,\n // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`.\n if (\n this._isFirstRender &&\n IS_WEB &&\n props.entering &&\n !getReducedMotionFromConfig(props.entering as CustomConfig)\n ) {\n props.style = {\n ...(props.style ?? {}),\n visibility: 'hidden', // Hide component until `componentDidMount` triggers\n };\n }\n\n const platformProps = Platform.select({\n web: {},\n default: { collapsable: false },\n });\n\n return (\n void}\n {...platformProps}\n />\n );\n }\n }\n\n AnimatedComponent.displayName = `AnimatedComponent(${\n Component.displayName || Component.name || 'Component'\n })`;\n\n return React.forwardRef((props, ref) => {\n return (\n \n );\n });\n}\n"],"mappings":"AAAA,YAAY;;AAAC,SAAAA,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAAA,SAAAQ,gBAAAC,GAAA,EAAAN,GAAA,EAAAO,KAAA,IAAAP,GAAA,GAAAQ,cAAA,CAAAR,GAAA,OAAAA,GAAA,IAAAM,GAAA,IAAAd,MAAA,CAAAiB,cAAA,CAAAH,GAAA,EAAAN,GAAA,IAAAO,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAN,GAAA,CAAAN,GAAA,IAAAO,KAAA,WAAAD,GAAA;AAAA,SAAAE,eAAAK,GAAA,QAAA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AAA,CAAjBmE,iBAAiB,iBAgBAhC,mBAAmB;EAwc1CgC,iBAAiB,CAACc,WAAW,GAAI,qBAC/BlB,SAAS,CAACkB,WAAW,IAAIlB,SAAS,CAACG,IAAI,IAAI,WAC5C,GAAE;EAEH,oBAAO9C,KAAK,CAACgK,UAAU,CAAY,CAAC/G,KAAK,EAAEI,GAAG,KAAK;IACjD,oBACErD,KAAA,CAAA8J,aAAA,CAAC/G,iBAAiB,EAAAjF,QAAA,KACZmF,KAAK,EACJI,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;MAAEF,YAAY,EAAEE;IAAI,CAAC,EAChD;EAEN,CAAC,CAAC;AACJ"} \ No newline at end of file +{"version":3,"names":["React","AnimatedComponentImpl","jsx","_jsx","createAnimatedComponent","Component","options","AnimatedComponent","displayName","name","constructor","props","jsProps","modifiedOptions","length","animatedComponent","ref","forwardedRef"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/createAnimatedComponent.tsx"],"mappings":"AAAA,YAAY;;AAOZ,OAAOA,KAAK,MAAM,OAAO;AAKzB,OAAOC,qBAAqB,MAAM,qBAAqB;;AAMvD;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAkBA;AACA;AACA;AACA;AACA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAMA,OAAO,SAASC,uBAAuBA,CACrCC,SAAoE,EACpEC,OAAwC,EAEnC;EACL,MAAMC,iBAAiB,SAASN,qBAAqB,CAAC;IACpD,OAAOO,WAAW,GAAG,qBACnBH,SAAS,CAACG,WAAW,IAAIH,SAAS,CAACI,IAAI,IAAI,WAAW,GACrD;IAEHC,WAAWA,CAACC,KAAoD,EAAE;MAChE;MACA,MAAMC,OAAO,GAAGN,OAAO,EAAEM,OAAO,IAAIP,SAAS,CAACO,OAAO;MACrD,MAAMC,eAAe,GAAGD,OAAO,EAAEE,MAAM,GACnC;QAAE,GAAGR,OAAO;QAAEM;MAAQ,CAAC,GACvBN,OAAO;MACX,KAAK,CAACD,SAAS,EAAEM,KAAK,EAAEJ,iBAAiB,CAACC,WAAW,EAAEK,eAAe,CAAC;IACzE;EACF;EAEA,MAAME,iBAAiB,GACrBJ,KAA+D,IAC5D;IACH,oBACER,IAAA,CAACI,iBAAiB;MAAA,GACZI,KAAK;MACT;MACA;MACAK,GAAG,EAAE,IAAK;MAAA,IACLL,KAAK,CAACK,GAAG,KAAK,IAAI,GAAG,IAAI,GAAG;QAAEC,YAAY,EAAEN,KAAK,CAACK;MAAI,CAAC;IAAA,CAC7D,CAAC;EAEN,CAAC;EAEDD,iBAAiB,CAACP,WAAW,GAC3BH,SAAS,CAACG,WAAW,IAAIH,SAAS,CAACI,IAAI,IAAI,WAAW;EAExD,OAAOM,iBAAiB;AAC1B","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/index.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/index.js.map index 115da9b6..d143eb8e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/index.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/index.js.map @@ -1 +1 @@ -{"version":3,"names":["createAnimatedComponent"],"sources":["index.ts"],"sourcesContent":["'use strict';\nexport { createAnimatedComponent } from './createAnimatedComponent';\n"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B"} \ No newline at end of file +{"version":3,"names":["createAnimatedComponent"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/index.ts"],"mappings":"AAAA,YAAY;;AACZ,SAASA,uBAAuB,QAAQ,2BAA2B","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js index fbc0d9f4..c9b67967 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js @@ -27,4 +27,32 @@ export const has = (key, x) => { } return false; }; +export function filterStyles(styles) { + if (!styles) { + return { + animatedStyles: [], + cssStyle: null + }; + } + return styles.reduce(({ + animatedStyles, + cssStyle + }, style) => { + if (style?.viewDescriptors) { + animatedStyles.push(style); + } else { + cssStyle = { + ...cssStyle, + ...style + }; + } + return { + animatedStyles, + cssStyle + }; + }, { + animatedStyles: [], + cssStyle: null + }); +} //# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js.map index ad7feddc..c4713e48 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/utils.js.map @@ -1 +1 @@ -{"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined"],"sources":["utils.ts"],"sourcesContent":["'use strict';\nimport type { NestedArray } from './commonTypes';\n\nexport function flattenArray(array: NestedArray): T[] {\n if (!Array.isArray(array)) {\n return [array];\n }\n const resultArr: T[] = [];\n\n const _flattenArray = (arr: NestedArray[]): void => {\n arr.forEach((item) => {\n if (Array.isArray(item)) {\n _flattenArray(item);\n } else {\n resultArr.push(item);\n }\n });\n };\n _flattenArray(array);\n return resultArr;\n}\n\nexport const has = (\n key: K,\n x: unknown\n): x is typeof x & { [key in K]: unknown } => {\n if (typeof x === 'function' || typeof x === 'object') {\n if (x === null || x === undefined) {\n return false;\n } else {\n return key in x;\n }\n }\n return false;\n};\n"],"mappings":"AAAA,YAAY;;AAGZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACkC;EAC5C,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC"} \ No newline at end of file +{"version":3,"names":["flattenArray","array","Array","isArray","resultArr","_flattenArray","arr","forEach","item","push","has","key","x","undefined","filterStyles","styles","animatedStyles","cssStyle","reduce","style","viewDescriptors"],"sourceRoot":"../../../src","sources":["createAnimatedComponent/utils.ts"],"mappings":"AAAA,YAAY;;AAKZ,OAAO,SAASA,YAAYA,CAAIC,KAAqB,EAAO;EAC1D,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACzB,OAAO,CAACA,KAAK,CAAC;EAChB;EACA,MAAMG,SAAc,GAAG,EAAE;EAEzB,MAAMC,aAAa,GAAIC,GAAqB,IAAW;IACrDA,GAAG,CAACC,OAAO,CAAEC,IAAI,IAAK;MACpB,IAAIN,KAAK,CAACC,OAAO,CAACK,IAAI,CAAC,EAAE;QACvBH,aAAa,CAACG,IAAI,CAAC;MACrB,CAAC,MAAM;QACLJ,SAAS,CAACK,IAAI,CAACD,IAAI,CAAC;MACtB;IACF,CAAC,CAAC;EACJ,CAAC;EACDH,aAAa,CAACJ,KAAK,CAAC;EACpB,OAAOG,SAAS;AAClB;AAEA,OAAO,MAAMM,GAAG,GAAGA,CACjBC,GAAM,EACNC,CAAU,KACuB;EACjC,IAAI,OAAOA,CAAC,KAAK,UAAU,IAAI,OAAOA,CAAC,KAAK,QAAQ,EAAE;IACpD,IAAIA,CAAC,KAAK,IAAI,IAAIA,CAAC,KAAKC,SAAS,EAAE;MACjC,OAAO,KAAK;IACd,CAAC,MAAM;MACL,OAAOF,GAAG,IAAIC,CAAC;IACjB;EACF;EACA,OAAO,KAAK;AACd,CAAC;AAOD,OAAO,SAASE,YAAYA,CAACC,MAAgC,EAAkB;EAC7E,IAAI,CAACA,MAAM,EAAE;IACX,OAAO;MAAEC,cAAc,EAAE,EAAE;MAAEC,QAAQ,EAAE;IAAK,CAAC;EAC/C;EAEA,OAAOF,MAAM,CAACG,MAAM,CAClB,CAAC;IAAEF,cAAc;IAAEC;EAAS,CAAC,EAAEE,KAAK,KAAK;IACvC,IAAIA,KAAK,EAAEC,eAAe,EAAE;MAC1BJ,cAAc,CAACP,IAAI,CAACU,KAAK,CAAC;IAC5B,CAAC,MAAM;MACLF,QAAQ,GAAG;QAAE,GAAGA,QAAQ;QAAE,GAAGE;MAAM,CAAa;IAClD;IACA,OAAO;MAAEH,cAAc;MAAEC;IAAS,CAAC;EACrC,CAAC,EACD;IAAED,cAAc,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAK,CACvC,CAAC;AACH","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js b/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js index 931366da..1088397e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js @@ -1,6 +1,64 @@ 'use strict'; +import './publicGlobals'; +import { initializeReanimatedModule } from './initializers'; +import { ReanimatedModule } from './ReanimatedModule'; + +// TODO: Specify the initialization pipeline since now there's no +// universal source of truth for it. +initializeReanimatedModule(ReanimatedModule); + +// eslint-disable-next-line import/first import * as Animated from './Animated'; -export * from './reanimated2'; export default Animated; +export { createAnimatedComponent } from './Animated'; +export { cancelAnimation, defineAnimation, GentleSpringConfig, GentleSpringConfigWithDuration, Reanimated3DefaultSpringConfig, Reanimated3DefaultSpringConfigWithDuration, SnappySpringConfig, SnappySpringConfigWithDuration, WigglySpringConfig, WigglySpringConfigWithDuration, withClamp, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming } from './animation'; +export { convertToRGBA, isColor } from './Colors'; +export { processColor, ReanimatedLogLevel } from './common'; +export { InterfaceOrientation, IOSReferenceFrame, KeyboardState, ReduceMotion, SensorType } from './commonTypes'; +export { LayoutAnimationConfig } from './component/LayoutAnimationConfig'; +export { PerformanceMonitor } from './component/PerformanceMonitor'; +export { ReducedMotionConfig } from './component/ReducedMotionConfig'; +export { configureReanimatedLogger } from './ConfigHelper'; +export { enableLayoutAnimations, getViewProp, isConfigured, isReanimated3, makeMutable } from './core'; +export * from './css'; +export { Easing } from './Easing'; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags'; +export { useAnimatedKeyboard, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedSensor, useAnimatedStyle, useComposedEventHandler, useDerivedValue, useEvent, useFrameCallback, useHandler, useReducedMotion, useScrollOffset, /** @deprecated Please use {@link useScrollOffset} instead. */ +useScrollOffset as useScrollViewOffset, useSharedValue } from './hook'; +export { ColorSpace, /** @deprecated Please use {@link Extrapolation} instead. */ +Extrapolate, interpolateColor, useInterpolateConfig } from './interpolateColor'; +export { clamp, Extrapolation, interpolate } from './interpolation'; +export { isSharedValue } from './isSharedValue'; +export { advanceAnimationByFrame, advanceAnimationByTime, getAnimatedStyle, setUpTests, withReanimatedTimer } from './jestUtils'; +export { BaseAnimationBuilder, +// Bounce +BounceIn, BounceInDown, BounceInLeft, BounceInRight, BounceInUp, BounceOut, BounceOutDown, BounceOutLeft, BounceOutRight, BounceOutUp, ComplexAnimationBuilder, CurvedTransition, EntryExitTransition, +// Fade +FadeIn, FadeInDown, FadeInLeft, FadeInRight, FadeInUp, FadeOut, FadeOutDown, FadeOutLeft, FadeOutRight, FadeOutUp, FadingTransition, FlipInEasyX, FlipInEasyY, FlipInXDown, +// Flip +FlipInXUp, FlipInYLeft, FlipInYRight, FlipOutEasyX, FlipOutEasyY, FlipOutXDown, FlipOutXUp, FlipOutYLeft, FlipOutYRight, JumpingTransition, Keyframe, +// Transitions +Layout, LightSpeedInLeft, +// Lightspeed +LightSpeedInRight, LightSpeedOutLeft, LightSpeedOutRight, LinearTransition, +// Pinwheel +PinwheelIn, PinwheelOut, +// Roll +RollInLeft, RollInRight, RollOutLeft, RollOutRight, +// Rotate +RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight, RotateOutDownLeft, RotateOutDownRight, RotateOutUpLeft, RotateOutUpRight, SequencedTransition, SlideInDown, SlideInLeft, +// Slide +SlideInRight, SlideInUp, SlideOutDown, SlideOutLeft, SlideOutRight, SlideOutUp, +// Stretch +StretchInX, StretchInY, StretchOutX, StretchOutY, +// Zoom +ZoomIn, ZoomInDown, ZoomInEasyDown, ZoomInEasyUp, ZoomInLeft, ZoomInRight, ZoomInRotate, ZoomInUp, ZoomOut, ZoomOutDown, ZoomOutEasyDown, ZoomOutEasyUp, ZoomOutLeft, ZoomOutRight, ZoomOutRotate, ZoomOutUp } from './layoutReanimation'; +export { startMapper, stopMapper } from './mappers'; +export { jsVersion as reanimatedVersion } from './platform-specific/jsVersion'; +export { dispatchCommand, getRelativeCoords, measure, scrollTo, setGestureState, setNativeProps } from './platformFunctions'; +export { getUseOfValueInStyleWarning } from './pluginUtils'; +export { createAnimatedPropAdapter } from './PropAdapters'; +export { finishScreenTransition, ScreenTransition, startScreenTransition } from './screenTransition'; +export { createWorkletRuntime, executeOnUIRuntimeSync, isWorkletFunction, makeShareableCloneRecursive, runOnJS, runOnRuntime, runOnUI } from './workletFunctions'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js.map b/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js.map index 1e3384f9..5379fcc6 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js.map +++ b/frontend-admin/node_modules/react-native-reanimated/lib/module/index.js.map @@ -1 +1 @@ -{"version":3,"names":["Animated"],"sources":["index.ts"],"sourcesContent":["'use strict';\nimport * as Animated from './Animated';\n\nexport * from './reanimated2';\nexport default Animated;\n"],"mappings":"AAAA,YAAY;;AACZ,OAAO,KAAKA,QAAQ,MAAM,YAAY;AAEtC,cAAc,eAAe;AAC7B,eAAeA,QAAQ"} \ No newline at end of file +{"version":3,"names":["initializeReanimatedModule","ReanimatedModule","Animated","createAnimatedComponent","cancelAnimation","defineAnimation","GentleSpringConfig","GentleSpringConfigWithDuration","Reanimated3DefaultSpringConfig","Reanimated3DefaultSpringConfigWithDuration","SnappySpringConfig","SnappySpringConfigWithDuration","WigglySpringConfig","WigglySpringConfigWithDuration","withClamp","withDecay","withDelay","withRepeat","withSequence","withSpring","withTiming","convertToRGBA","isColor","processColor","ReanimatedLogLevel","InterfaceOrientation","IOSReferenceFrame","KeyboardState","ReduceMotion","SensorType","LayoutAnimationConfig","PerformanceMonitor","ReducedMotionConfig","configureReanimatedLogger","enableLayoutAnimations","getViewProp","isConfigured","isReanimated3","makeMutable","Easing","getStaticFeatureFlag","setDynamicFeatureFlag","useAnimatedKeyboard","useAnimatedProps","useAnimatedReaction","useAnimatedRef","useAnimatedScrollHandler","useAnimatedSensor","useAnimatedStyle","useComposedEventHandler","useDerivedValue","useEvent","useFrameCallback","useHandler","useReducedMotion","useScrollOffset","useScrollViewOffset","useSharedValue","ColorSpace","Extrapolate","interpolateColor","useInterpolateConfig","clamp","Extrapolation","interpolate","isSharedValue","advanceAnimationByFrame","advanceAnimationByTime","getAnimatedStyle","setUpTests","withReanimatedTimer","BaseAnimationBuilder","BounceIn","BounceInDown","BounceInLeft","BounceInRight","BounceInUp","BounceOut","BounceOutDown","BounceOutLeft","BounceOutRight","BounceOutUp","ComplexAnimationBuilder","CurvedTransition","EntryExitTransition","FadeIn","FadeInDown","FadeInLeft","FadeInRight","FadeInUp","FadeOut","FadeOutDown","FadeOutLeft","FadeOutRight","FadeOutUp","FadingTransition","FlipInEasyX","FlipInEasyY","FlipInXDown","FlipInXUp","FlipInYLeft","FlipInYRight","FlipOutEasyX","FlipOutEasyY","FlipOutXDown","FlipOutXUp","FlipOutYLeft","FlipOutYRight","JumpingTransition","Keyframe","Layout","LightSpeedInLeft","LightSpeedInRight","LightSpeedOutLeft","LightSpeedOutRight","LinearTransition","PinwheelIn","PinwheelOut","RollInLeft","RollInRight","RollOutLeft","RollOutRight","RotateInDownLeft","RotateInDownRight","RotateInUpLeft","RotateInUpRight","RotateOutDownLeft","RotateOutDownRight","RotateOutUpLeft","RotateOutUpRight","SequencedTransition","SlideInDown","SlideInLeft","SlideInRight","SlideInUp","SlideOutDown","SlideOutLeft","SlideOutRight","SlideOutUp","StretchInX","StretchInY","StretchOutX","StretchOutY","ZoomIn","ZoomInDown","ZoomInEasyDown","ZoomInEasyUp","ZoomInLeft","ZoomInRight","ZoomInRotate","ZoomInUp","ZoomOut","ZoomOutDown","ZoomOutEasyDown","ZoomOutEasyUp","ZoomOutLeft","ZoomOutRight","ZoomOutRotate","ZoomOutUp","startMapper","stopMapper","jsVersion","reanimatedVersion","dispatchCommand","getRelativeCoords","measure","scrollTo","setGestureState","setNativeProps","getUseOfValueInStyleWarning","createAnimatedPropAdapter","finishScreenTransition","ScreenTransition","startScreenTransition","createWorkletRuntime","executeOnUIRuntimeSync","isWorkletFunction","makeShareableCloneRecursive","runOnJS","runOnRuntime","runOnUI"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,iBA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;AACAC,UAAU,EACVC,UAAU,EACVC,WAAW,EACXC,WAAW;AACX;AACAC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,YAAY,EACZC,QAAQ,EACRC,OAAO,EACPC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,WAAW,EACXC,YAAY,EACZC,aAAa,EACbC,SAAS,QACJ,qBAAqB;AAC5B,SAASC,WAAW,EAAEC,UAAU,QAAQ,WAAW;AACnD,SAASC,SAAS,IAAIC,iBAAiB,QAAQ,+BAA+B;AAE9E,SACEC,eAAe,EACfC,iBAAiB,EACjBC,OAAO,EACPC,QAAQ,EACRC,eAAe,EACfC,cAAc,QACT,qBAAqB;AAC5B,SAASC,2BAA2B,QAAQ,eAAe;AAC3D,SAASC,yBAAyB,QAAQ,gBAAgB;AAM1D,SACEC,sBAAsB,EACtBC,gBAAgB,EAChBC,qBAAqB,QAChB,oBAAoB;AAE3B,SACEC,oBAAoB,EACpBC,sBAAsB,EACtBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,OAAO,EACPC,YAAY,EACZC,OAAO,QACF,oBAAoB","ignoreList":[]} diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/Animated.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/Animated.d.ts index 4efee978..be7c579e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/Animated.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/Animated.d.ts @@ -1,66 +1,8 @@ -import type { Extrapolate as _Extrapolate } from './reanimated2/interpolateColor'; -import type { SharedValue as _SharedValue } from './reanimated2/commonTypes'; -import type { DerivedValue as _DerivedValue } from './reanimated2/hook/useDerivedValue'; -import type { TransformStyleTypes as _TransformStyleTypes, Adaptable as _Adaptable, AdaptTransforms as _AdaptTransforms, AnimatedTransform as _AnimatedTransform, AnimateStyle as _AnimateStyle, StylesOrDefault as _StylesOrDefault, AnimateProps as _AnimateProps } from './reanimated2/helperTypes'; -import type { EasingFunction as _EasingFunction } from './reanimated2/Easing'; -import type { AnimatedScrollViewProps as _AnimatedScrollViewProps } from './reanimated2/component/ScrollView'; -import type { FlatListPropsWithLayout as _FlatListPropsWithLayout } from './reanimated2/component/FlatList'; -export { createAnimatedComponent } from './createAnimatedComponent'; -export { AnimatedText as Text } from './reanimated2/component/Text'; -export { AnimatedView as View } from './reanimated2/component/View'; -export { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView'; -export { AnimatedImage as Image } from './reanimated2/component/Image'; -export { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList'; +export { ReanimatedFlatList as FlatList } from './component/FlatList'; +export { AnimatedImage as Image } from './component/Image'; +export { AnimatedScrollView as ScrollView } from './component/ScrollView'; +export { AnimatedText as Text } from './component/Text'; +export { AnimatedView as View } from './component/View'; export { addWhitelistedNativeProps, addWhitelistedUIProps, } from './ConfigHelper'; -/** - * @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type Extrapolate = typeof _Extrapolate; -/** - * @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type SharedValue = _SharedValue; -/** - * @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type DerivedValue = _DerivedValue; -/** - * @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type Adaptable = _Adaptable; -/** - * @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type TransformStyleTypes = _TransformStyleTypes; -/** - * @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AdaptTransforms = _AdaptTransforms; -/** - * @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type AnimatedTransform = _AnimatedTransform; -/** - * @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimateStyle = _AnimateStyle; -/** - * @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type StylesOrDefault = _StylesOrDefault; -/** - * @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimateProps

= _AnimateProps

; -/** - * @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type EasingFunction = _EasingFunction; -/** - * @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimatedScrollViewProps = _AnimatedScrollViewProps; -/** - * @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type FlatListPropsWithLayout = _FlatListPropsWithLayout; +export { createAnimatedComponent } from './createAnimatedComponent'; +//# sourceMappingURL=Animated.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/ConfigHelper.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/ConfigHelper.d.ts index 2f1b713e..ad411aa8 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/ConfigHelper.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/ConfigHelper.d.ts @@ -1,11 +1,16 @@ -export declare function addWhitelistedNativeProps(props: Record): void; -export declare function addWhitelistedUIProps(props: Record): void; -export interface ViewConfig { - uiViewClassName: string; - validAttributes: Record; -} +import type { LoggerConfig } from './common'; +/** @deprecated This function is a no-op in Reanimated 4. */ +export declare function addWhitelistedNativeProps(_props: Record): void; +/** @deprecated This function is a no-op in Reanimated 4. */ +export declare function addWhitelistedUIProps(_props: Record): void; /** - * updates UI props whitelist for given view host instance - * this will work just once for every view name + * Updates Reanimated logger config with the user-provided configuration. Will + * affect Reanimated code executed after call to this function so it should be + * called before any Reanimated code is executed to take effect. Each call to + * this function will override the previous configuration (it's recommended to + * call it only once). + * + * @param config - The new logger configuration to apply. */ -export declare function adaptViewConfig(viewConfig: ViewConfig): void; +export declare function configureReanimatedLogger(config: LoggerConfig): void; +//# sourceMappingURL=ConfigHelper.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/animationBuilder.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/animationBuilder.d.ts index 5a934ca7..7bc5b3fb 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/animationBuilder.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/animationBuilder.d.ts @@ -1,3 +1,4 @@ -import type { ILayoutAnimationBuilder, LayoutAnimationFunction } from './reanimated2/layoutReanimation'; -import type { StyleProps } from './reanimated2/commonTypes'; -export declare function maybeBuild(layoutAnimationOrBuilder: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe, style: StyleProps | undefined, displayName: string): LayoutAnimationFunction | Keyframe; +import type { ILayoutAnimationBuilder, LayoutAnimationFunction, StyleProps } from './commonTypes'; +import type { NestedArray } from './createAnimatedComponent/commonTypes'; +export declare function maybeBuild(layoutAnimationOrBuilder: ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe, style: NestedArray | undefined, displayName: string): LayoutAnimationFunction | Keyframe; +//# sourceMappingURL=animationBuilder.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts index 0d38260e..14305a6b 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/InlinePropManager.d.ts @@ -1,13 +1,13 @@ -/// -import type { StyleProps } from '../reanimated2'; -import type { IAnimatedComponentInternal, IInlinePropManager, ViewInfo } from './commonTypes'; -import type { ViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet'; +import type { StyleProps } from '../commonTypes'; +import type { ViewDescriptorsSet } from '../ViewDescriptorsSet'; +import type { AnimatedComponentType, IInlinePropManager, ViewInfo } from './commonTypes'; export declare function hasInlineStyles(style: StyleProps): boolean; -export declare function getInlineStyle(style: Record, isFirstRender: boolean): Record; +export declare function getInlineStyle(style: Record, isFirstRender: boolean): StyleProps | Record; export declare class InlinePropManager implements IInlinePropManager { _inlinePropsViewDescriptors: ViewDescriptorsSet | null; _inlinePropsMapperId: number | null; _inlineProps: StyleProps; - attachInlineProps(animatedComponent: React.Component & IAnimatedComponentInternal, viewInfo: ViewInfo): void; + attachInlineProps(animatedComponent: AnimatedComponentType, viewInfo: ViewInfo): void; detachInlineProps(): void; } +//# sourceMappingURL=InlinePropManager.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts index 9a7ef98b..abf7a947 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/JSPropsUpdater.d.ts @@ -1,23 +1,15 @@ -/// -import type { AnimatedComponentProps, IAnimatedComponentInternal, IJSPropsUpdater, InitialComponentProps } from './commonTypes'; -declare class JSPropsUpdaterPaper implements IJSPropsUpdater { +import type { AnimatedComponentProps, AnimatedComponentType, IAnimatedComponentInternal, IJSPropsUpdater, InitialComponentProps, JSPropsOperation } from './commonTypes'; +declare class JSPropsUpdaterNative implements IJSPropsUpdater { private static _tagToComponentMapping; - private _reanimatedEventEmitter; - constructor(); - addOnJSPropsChangeListener(animatedComponent: React.Component> & IAnimatedComponentInternal): void; - removeOnJSPropsChangeListener(animatedComponent: React.Component> & IAnimatedComponentInternal): void; -} -declare class JSPropsUpdaterFabric implements IJSPropsUpdater { - private static _tagToComponentMapping; - private static isInitialized; - constructor(); - addOnJSPropsChangeListener(animatedComponent: React.Component> & IAnimatedComponentInternal): void; - removeOnJSPropsChangeListener(animatedComponent: React.Component> & IAnimatedComponentInternal): void; + registerComponent(animatedComponent: AnimatedComponentType, jsProps: string[]): void; + unregisterComponent(animatedComponent: AnimatedComponentType): void; + updateProps(operations: JSPropsOperation[]): void; } declare class JSPropsUpdaterWeb implements IJSPropsUpdater { - addOnJSPropsChangeListener(_animatedComponent: React.Component> & IAnimatedComponentInternal): void; - removeOnJSPropsChangeListener(_animatedComponent: React.Component> & IAnimatedComponentInternal): void; + registerComponent(_animatedComponent: React.Component> & IAnimatedComponentInternal): void; + unregisterComponent(_animatedComponent: React.Component> & IAnimatedComponentInternal): void; + updateProps(_operations: JSPropsOperation[]): void; } -type JSPropsUpdaterOptions = typeof JSPropsUpdaterWeb | typeof JSPropsUpdaterFabric | typeof JSPropsUpdaterPaper; -declare let JSPropsUpdater: JSPropsUpdaterOptions; -export default JSPropsUpdater; +declare const jsPropsUpdater: JSPropsUpdaterNative | JSPropsUpdaterWeb; +export default jsPropsUpdater; +//# sourceMappingURL=JSPropsUpdater.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/PropsFilter.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/PropsFilter.d.ts index 71259d2e..8db26d57 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/PropsFilter.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/PropsFilter.d.ts @@ -1,6 +1,6 @@ -/// -import type { IAnimatedComponentInternal, IPropsFilter } from './commonTypes'; +import type { AnimatedComponentType, IPropsFilter } from './commonTypes'; export declare class PropsFilter implements IPropsFilter { - private _initialStyle; - filterNonAnimatedProps(component: React.Component & IAnimatedComponentInternal): Record; + private _initialPropsMap; + filterNonAnimatedProps(component: AnimatedComponentType): Record; } +//# sourceMappingURL=PropsFilter.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/commonTypes.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/commonTypes.d.ts index 1fa0e079..f93b8668 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/commonTypes.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/commonTypes.d.ts @@ -1,68 +1,98 @@ -import type { Ref, Component } from 'react'; -import type { StyleProps, BaseAnimationBuilder, ILayoutAnimationBuilder, EntryExitAnimationFunction, SharedTransition, SharedValue } from '../reanimated2'; -import type { ViewDescriptorsSet, ViewRefSet } from '../reanimated2/ViewDescriptorsSet'; -import type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig'; -import type { ShadowNodeWrapper } from '../reanimated2/commonTypes'; -import type { ViewConfig } from '../ConfigHelper'; +import type { Component, Ref, RefObject } from 'react'; +import type { AnimatedStyle, EntryExitAnimationFunction, ILayoutAnimationBuilder, ShadowNodeWrapper, SharedValue, StyleProps, StyleUpdaterContainer } from '../commonTypes'; +import type { SkipEnteringContext } from '../component/LayoutAnimationConfig'; +import type { BaseAnimationBuilder } from '../layoutReanimation'; +import type { ViewDescriptorsSet } from '../ViewDescriptorsSet'; export interface AnimatedProps extends Record { viewDescriptors?: ViewDescriptorsSet; - viewsRef?: ViewRefSet; initial?: SharedValue; + styleUpdaterContainer?: StyleUpdaterContainer; } export interface ViewInfo { - viewTag: number | HTMLElement | null; - viewName: string | null; + viewTag: number | AnimatedComponentRef | HTMLElement | null; shadowNodeWrapper: ShadowNodeWrapper | null; - viewConfig: ViewConfig; + viewName?: string; + DOMElement?: HTMLElement | null; } export interface IInlinePropManager { attachInlineProps(animatedComponent: React.Component, viewInfo: ViewInfo): void; detachInlineProps(): void; } +export type AnimatedComponentType = React.Component & IAnimatedComponentInternal; +export type PropUpdates = StyleProps | AnimatedStyle; export interface IPropsFilter { - filterNonAnimatedProps: (component: React.Component & IAnimatedComponentInternal) => Record; + filterNonAnimatedProps: (component: AnimatedComponentType) => Record; } +export type JSPropsOperation = { + tag: number; + updates: StyleProps; +}; export interface IJSPropsUpdater { - addOnJSPropsChangeListener(animatedComponent: React.Component & IAnimatedComponentInternal): void; - removeOnJSPropsChangeListener(animatedComponent: React.Component & IAnimatedComponentInternal): void; + registerComponent(animatedComponent: AnimatedComponentType, jsProps: string[]): void; + unregisterComponent(animatedComponent: AnimatedComponentType): void; + updateProps(operations: JSPropsOperation[]): void; +} +export interface INativeEventsManager { + attachEvents(): void; + detachEvents(): void; + updateEvents(prevProps: AnimatedComponentProps): void; } export type LayoutAnimationStaticContext = { presetName: string; }; -export type AnimatedComponentProps

> = P & { - forwardedRef?: Ref; +export type AnimatedComponentProps

= Record> = P & { + ref?: Ref; style?: NestedArray; animatedProps?: Partial>; + jestAnimatedValues?: RefObject; animatedStyle?: StyleProps; layout?: (BaseAnimationBuilder | ILayoutAnimationBuilder | typeof BaseAnimationBuilder) & LayoutAnimationStaticContext; entering?: (BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe) & LayoutAnimationStaticContext; exiting?: (BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe) & LayoutAnimationStaticContext; - sharedTransitionTag?: string; - sharedTransitionStyle?: SharedTransition; }; +export type LayoutAnimationOrBuilder = (BaseAnimationBuilder | typeof BaseAnimationBuilder | EntryExitAnimationFunction | Keyframe | ILayoutAnimationBuilder) & LayoutAnimationStaticContext; export interface AnimatedComponentRef extends Component { setNativeProps?: (props: Record) => void; getScrollableNode?: () => AnimatedComponentRef; getAnimatableRef?: () => AnimatedComponentRef; + elementRef?: React.RefObject; } -export interface IAnimatedComponentInternal { - _styles: StyleProps[] | null; - _animatedProps?: Partial>; - _viewTag: number; +export interface IAnimatedComponentInternalBase { + ChildComponent: AnyComponent; + _componentRef: AnimatedComponentRef | HTMLElement | null; + _hasAnimatedRef: boolean; + _viewInfo?: ViewInfo; + /** + * Used for Layout Animations and Animated Styles. It is not related to event + * handling. + */ + getComponentViewTag: () => number; +} +export interface IAnimatedComponentInternal extends IAnimatedComponentInternalBase { + _animatedStyles: StyleProps[]; + _prevAnimatedStyles: StyleProps[]; + _animatedProps: Partial>[]; + _prevAnimatedProps: Partial>[]; _isFirstRender: boolean; - animatedStyle: { + jestInlineStyle: NestedArray | undefined; + jestAnimatedStyle: { value: StyleProps; }; - _component: AnimatedComponentRef | HTMLElement | null; - _sharedElementTransition: SharedTransition | null; - _jsPropsUpdater: IJSPropsUpdater; + jestAnimatedProps: { + value: AnimatedProps; + }; _InlinePropManager: IInlinePropManager; _PropsFilter: IPropsFilter; - _viewInfo?: ViewInfo; + /** Doesn't exist on web. */ + _NativeEventsManager?: INativeEventsManager; context: React.ContextType; + setNativeProps: (props: StyleProps) => void; } export type NestedArray = T | NestedArray[]; +export type AnyComponent = React.ComponentType; export interface InitialComponentProps extends Record { ref?: Ref; collapsable?: boolean; } +export type ManagedAnimatedComponent = React.Component> & IAnimatedComponentInternal; +//# sourceMappingURL=commonTypes.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts index c48ca105..c602d7af 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/createAnimatedComponent.d.ts @@ -1,10 +1,9 @@ -import type { ComponentClass, FunctionComponent } from 'react'; -import '../reanimated2/layoutReanimation/animationsManager'; -import type { AnimateProps } from '../reanimated2'; -import type { AnimatedComponentRef } from './commonTypes'; +import type { ComponentClass, ComponentType, FunctionComponent } from 'react'; import type { FlatList, FlatListProps } from 'react-native'; -type Options

= { - setNativeProps: (ref: AnimatedComponentRef, props: P) => void; +import type { AnimatedProps } from '../helperTypes'; +import type { Options } from './AnimatedComponent'; +type AnimatableComponent> = C & { + jsProps?: string[]; }; /** * Lets you create an Animated version of any React Native component. @@ -13,10 +12,13 @@ type Options

= { * @returns A component that Reanimated is capable of animating. * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent */ +export declare function createAnimatedComponent

(component: AnimatableComponent>, options?: Options

): FunctionComponent>; +export declare function createAnimatedComponent

(component: AnimatableComponent>, options?: Options

): ComponentClass>; +export declare function createAnimatedComponent

(component: AnimatableComponent>, options?: Options

): FunctionComponent> | ComponentClass>; /** - * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually. + * @deprecated Please use `Animated.FlatList` component instead of calling + * `Animated.createAnimatedComponent(FlatList)` manually. */ -export declare function createAnimatedComponent(component: typeof FlatList, options?: Options): ComponentClass>>; -export declare function createAnimatedComponent

(component: FunctionComponent

, options?: Options

): FunctionComponent>; -export declare function createAnimatedComponent

(component: ComponentClass

, options?: Options

): ComponentClass>; +export declare function createAnimatedComponent(component: AnimatableComponent>, options?: Options>): ComponentClass>>; export {}; +//# sourceMappingURL=createAnimatedComponent.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/index.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/index.d.ts index 5975b715..791699ae 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/index.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/index.d.ts @@ -1 +1,2 @@ export { createAnimatedComponent } from './createAnimatedComponent'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/utils.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/utils.d.ts index 68baf035..39d415da 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/utils.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/createAnimatedComponent/utils.d.ts @@ -1,3 +1,12 @@ +import type { StyleProps } from '../commonTypes'; +import type { CSSStyle } from '../css'; import type { NestedArray } from './commonTypes'; export declare function flattenArray(array: NestedArray): T[]; export declare const has: (key: K, x: unknown) => x is { [key in K]: unknown; }; +type FilteredStyles = { + cssStyle: CSSStyle | null; + animatedStyles: StyleProps[]; +}; +export declare function filterStyles(styles: StyleProps[] | undefined): FilteredStyles; +export {}; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/index.d.ts b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/index.d.ts index 33bbf1b5..1124c42a 100644 --- a/frontend-admin/node_modules/react-native-reanimated/lib/typescript/index.d.ts +++ b/frontend-admin/node_modules/react-native-reanimated/lib/typescript/index.d.ts @@ -1,3 +1,50 @@ +import './publicGlobals'; import * as Animated from './Animated'; -export * from './reanimated2'; export default Animated; +export { createAnimatedComponent } from './Animated'; +export type { DecayAnimation, DelayAnimation, RepeatAnimation, SequenceAnimation, SpringAnimation, StyleLayoutAnimation, TimingAnimation, WithDecayConfig, WithSpringConfig, WithTimingConfig, } from './animation'; +export { cancelAnimation, defineAnimation, GentleSpringConfig, GentleSpringConfigWithDuration, Reanimated3DefaultSpringConfig, Reanimated3DefaultSpringConfigWithDuration, SnappySpringConfig, SnappySpringConfigWithDuration, WigglySpringConfig, WigglySpringConfigWithDuration, withClamp, withDecay, withDelay, withRepeat, withSequence, withSpring, withTiming, } from './animation'; +export type { ParsedColorArray } from './Colors'; +export { convertToRGBA, isColor } from './Colors'; +export { processColor, ReanimatedLogLevel } from './common'; +export type { AnimatableValue, AnimatableValueObject, AnimatedKeyboardInfo, AnimatedKeyboardOptions, AnimatedSensor, AnimatedStyle, AnimatedTransform, Animation, AnimationCallback, AnimationObject, BaseLayoutAnimationConfig, EasingFunction, EntryAnimationsValues, EntryExitAnimationFunction, ExitAnimationsValues, IEntryExitAnimationBuilder, ILayoutAnimationBuilder, KeyframeProps, LayoutAnimation, LayoutAnimationFunction, LayoutAnimationStartFunction, LayoutAnimationValues as LayoutAnimationsValues, LayoutAnimationType, MeasuredDimensions, SensorConfig, SharedValue, StyleProps, TransformArrayItem, Value3D, ValueRotation, } from './commonTypes'; +export { InterfaceOrientation, IOSReferenceFrame, KeyboardState, ReduceMotion, SensorType, } from './commonTypes'; +export type { FlatListPropsWithLayout } from './component/FlatList'; +export { LayoutAnimationConfig } from './component/LayoutAnimationConfig'; +export type { PerformanceMonitorProps } from './component/PerformanceMonitor'; +export { PerformanceMonitor } from './component/PerformanceMonitor'; +export { ReducedMotionConfig } from './component/ReducedMotionConfig'; +export type { AnimatedScrollViewProps } from './component/ScrollView'; +export { configureReanimatedLogger } from './ConfigHelper'; +export { enableLayoutAnimations, getViewProp, isConfigured, isReanimated3, makeMutable, } from './core'; +export * from './css'; +export type { EasingFunctionFactory } from './Easing'; +export { Easing } from './Easing'; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags'; +export type { FrameInfo } from './frameCallback'; +export type { AnimatedProps, EntryOrExitLayoutType } from './helperTypes'; +export type { AnimatedRef, DerivedValue, EventHandler, EventHandlerProcessed, FrameCallback, ReanimatedEvent, ScrollEvent, ScrollHandler, ScrollHandlerProcessed, ScrollHandlers, UseHandlerContext, } from './hook'; +export { useAnimatedKeyboard, useAnimatedProps, useAnimatedReaction, useAnimatedRef, useAnimatedScrollHandler, useAnimatedSensor, useAnimatedStyle, useComposedEventHandler, useDerivedValue, useEvent, useFrameCallback, useHandler, useReducedMotion, useScrollOffset, +/** @deprecated Please use {@link useScrollOffset} instead. */ +useScrollOffset as useScrollViewOffset, useSharedValue, } from './hook'; +export type { InterpolateConfig, InterpolateHSV, InterpolateRGB, InterpolationOptions, } from './interpolateColor'; +export { ColorSpace, +/** @deprecated Please use {@link Extrapolation} instead. */ +Extrapolate, interpolateColor, useInterpolateConfig, } from './interpolateColor'; +export type { ExtrapolationConfig, ExtrapolationType } from './interpolation'; +export { clamp, Extrapolation, interpolate } from './interpolation'; +export { isSharedValue } from './isSharedValue'; +export { advanceAnimationByFrame, advanceAnimationByTime, getAnimatedStyle, setUpTests, withReanimatedTimer, } from './jestUtils'; +export type { ReanimatedKeyframe } from './layoutReanimation'; +export { BaseAnimationBuilder, BounceIn, BounceInDown, BounceInLeft, BounceInRight, BounceInUp, BounceOut, BounceOutDown, BounceOutLeft, BounceOutRight, BounceOutUp, ComplexAnimationBuilder, CurvedTransition, EntryExitTransition, FadeIn, FadeInDown, FadeInLeft, FadeInRight, FadeInUp, FadeOut, FadeOutDown, FadeOutLeft, FadeOutRight, FadeOutUp, FadingTransition, FlipInEasyX, FlipInEasyY, FlipInXDown, FlipInXUp, FlipInYLeft, FlipInYRight, FlipOutEasyX, FlipOutEasyY, FlipOutXDown, FlipOutXUp, FlipOutYLeft, FlipOutYRight, JumpingTransition, Keyframe, Layout, LightSpeedInLeft, LightSpeedInRight, LightSpeedOutLeft, LightSpeedOutRight, LinearTransition, PinwheelIn, PinwheelOut, RollInLeft, RollInRight, RollOutLeft, RollOutRight, RotateInDownLeft, RotateInDownRight, RotateInUpLeft, RotateInUpRight, RotateOutDownLeft, RotateOutDownRight, RotateOutUpLeft, RotateOutUpRight, SequencedTransition, SlideInDown, SlideInLeft, SlideInRight, SlideInUp, SlideOutDown, SlideOutLeft, SlideOutRight, SlideOutUp, StretchInX, StretchInY, StretchOutX, StretchOutY, ZoomIn, ZoomInDown, ZoomInEasyDown, ZoomInEasyUp, ZoomInLeft, ZoomInRight, ZoomInRotate, ZoomInUp, ZoomOut, ZoomOutDown, ZoomOutEasyDown, ZoomOutEasyUp, ZoomOutLeft, ZoomOutRight, ZoomOutRotate, ZoomOutUp, } from './layoutReanimation'; +export { startMapper, stopMapper } from './mappers'; +export { jsVersion as reanimatedVersion } from './platform-specific/jsVersion'; +export type { ComponentCoords } from './platformFunctions'; +export { dispatchCommand, getRelativeCoords, measure, scrollTo, setGestureState, setNativeProps, } from './platformFunctions'; +export { getUseOfValueInStyleWarning } from './pluginUtils'; +export { createAnimatedPropAdapter } from './PropAdapters'; +export type { AnimatedScreenTransition, GoBackGesture, ScreenTransitionConfig, } from './screenTransition'; +export { finishScreenTransition, ScreenTransition, startScreenTransition, } from './screenTransition'; +export type { WorkletRuntime } from './workletFunctions'; +export { createWorkletRuntime, executeOnUIRuntimeSync, isWorkletFunction, makeShareableCloneRecursive, runOnJS, runOnRuntime, runOnUI, } from './workletFunctions'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/frontend-admin/node_modules/react-native-reanimated/mock.js b/frontend-admin/node_modules/react-native-reanimated/mock.js index e4bb4b64..179dc916 100644 --- a/frontend-admin/node_modules/react-native-reanimated/mock.js +++ b/frontend-admin/node_modules/react-native-reanimated/mock.js @@ -1,56 +1,11 @@ -/** - * Mock implementation for test runners. - * - * Example: - * - * ```js - * jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock')); - * ``` - */ - -const { View, Text, Image, Animated, processColor } = require('react-native'); -const ReanimatedV2 = require('./src/reanimated2/mock'); - -function NOOP() { - // noop -} - -const Reanimated = { - SpringUtils: { - makeDefaultConfig: NOOP, - makeConfigFromBouncinessAndSpeed: NOOP, - makeConfigFromOrigamiTensionAndFriction: NOOP, - }, - - View, - Text, - Image, - ScrollView: Animated.ScrollView, - FlatList: Animated.FlatList, - - Extrapolate: { - EXTEND: 'extend', - CLAMP: 'clamp', - IDENTITY: 'identity', - }, - - processColor, - - interpolate: NOOP, - interpolateColor: NOOP, - clamp: NOOP, - createAnimatedComponent: (Component) => Component, - addWhitelistedUIProps: NOOP, - addWhitelistedNativeProps: NOOP, -}; +const Reanimated = require('./src/mock'); +// @ts-expect-error +const Animated = Reanimated.default; module.exports = { - __esModule: true, - ...Reanimated, - ...ReanimatedV2, default: { - ...Reanimated, + ...Animated, }, }; diff --git a/frontend-admin/node_modules/react-native-reanimated/package.json b/frontend-admin/node_modules/react-native-reanimated/package.json index b262238a..6378459e 100644 --- a/frontend-admin/node_modules/react-native-reanimated/package.json +++ b/frontend-admin/node_modules/react-native-reanimated/package.json @@ -1,54 +1,46 @@ { "name": "react-native-reanimated", - "version": "3.6.3", + "version": "4.1.6", "description": "More powerful alternative to Animated library for React Native.", + "keywords": [ + "react-native", + "react", + "native", + "reanimated" + ], "scripts": { - "test": "yarn run format:js && yarn run lint:js && yarn run test:unit", - "test:unit": "jest", - "test:update-snapshot": "jest --updateSnapshot", - "lint": "yarn lint:js && yarn lint:plugin && yarn lint:cpp && yarn lint:java && yarn lint:ios", - "lint:js": "eslint --ext '.js,.ts,.tsx' src __tests__ __typetests__ && yarn prettier --check src __tests__ __typetests__", - "lint:plugin": "cd plugin && yarn lint && cd ..", - "lint:docs": "cd docs && yarn lint && cd ..", - "lint:java": "./android/gradlew -p android spotlessCheck -q", - "lint:cpp": "./scripts/cpplint.sh", - "lint:ios": "./scripts/validate-ios.sh && yarn format:ios --dry-run", - "format": "yarn format:js && yarn format:plugin && yarn format:java && yarn format:ios && yarn format:android && yarn format:common", + "test": "jest", + "lint": "yarn lint:js && yarn lint:common && yarn lint:android && yarn lint:apple", + "lint:js": "eslint src __tests__ __typetests__ && yarn prettier --check src __tests__ __typetests__", + "lint:android": "../../scripts/validate-android.sh && ./android/gradlew -p android spotlessCheck -q && ../../scripts/cpplint.sh android/src && yarn format:android:cpp --dry-run -Werror && yarn lint:cmake", + "lint:common": "../../scripts/validate-common.sh && ../../scripts/cpplint.sh Common && yarn format:common --dry-run -Werror", + "lint:clang-tidy": "find Common -iname \"*.h\" -o -iname \"*.cpp\" | xargs ../../scripts/clang-tidy-lint.sh", + "lint:apple": "../../scripts/validate-apple.sh && yarn format:apple --dry-run -Werror", + "lint:cmake": "find ./android -type d \\( -name build -o -name .cxx \\) -prune -o -type f -name 'CMakeLists.txt' -print | xargs ../../scripts/lint-cmake.sh", + "format": "yarn format:js && yarn format:apple && yarn format:android && yarn format:common", "format:js": "prettier --write --list-different src __tests__ __typetests__", - "format:plugin": "cd plugin && yarn format && cd ..", - "format:java": "node ./scripts/format-java.js", - "format:ios": "find apple/ -iname *.h -o -iname *.m -o -iname *.mm -o -iname *.cpp | xargs clang-format -i --Werror", - "format:android": "find android/src/ -iname *.h -o -iname *.cpp | xargs clang-format -i", - "format:common": "find Common/ -iname *.h -o -iname *.cpp | xargs clang-format -i", - "format:docs": "cd docs && yarn format && cd ..", - "find-unused-code:js": "yarn ts-prune --ignore \"index|.web.\" --error ", + "format:apple": "find apple -iname \"*.h\" -o -iname \"*.m\" -o -iname \"*.mm\" -o -iname \"*.cpp\" | xargs clang-format -i", + "format:android": "yarn format:android:java && yarn format:android:cpp && yarn format:android:cmake", + "format:android:java": "node ../../scripts/format-java.js", + "format:android:cpp": "find android/src -iname \"*.h\" -o -iname \"*.cpp\" | xargs clang-format -i", + "format:android:cmake": "find ./android -type d \\( -name build -o -name .cxx \\) -prune -o -type f -name 'CMakeLists.txt' -print | xargs ../../scripts/format-cmake.sh", + "format:common": "find Common -iname \"*.h\" -o -iname \"*.cpp\" | xargs clang-format -i", + "find-unused-code:js": "knip", + "type:check": "yarn type:check:src && yarn type:check:app && yarn type:check:tests:common", "type:check:src": "yarn tsc --noEmit", - "type:check:plugin": "cd plugin && yarn type:check:src && cd ..", - "type:check:app": "./scripts/test-ts.sh app/src/App.tsx", - "type:check:tests:common": "./scripts/test-ts.sh __typetests__/common.tsx", - "type:check:tests:0.72+": "./scripts/test-ts.sh __typetests__/0.72+.tsx", - "type:check:tests:legacy": "./scripts/test-ts.sh __typetests__/legacy.tsx", - "type:check:all": "yarn type:check:src && yarn type:check:plugin && ./scripts/test-ts.sh app/src/App.tsx __typetests__/common.tsx __typetests__/0.72+.tsx __typetests__/legacy.tsx", - "prepare": "yarn plugin && bob build && husky install && yarn app", - "circular_dependency_check": "yarn madge --extensions js,ts,tsx --circular src lib", - "use_strict_check": "node ./scripts/validate-use-strict.js", - "setup": "yarn && cd Example && yarn && cd ios && pod install --verbose && cd ../..", - "clean": "rm -rf node_modules && cd Example && rm -rf node_modules && cd ios && pod deintegrate && cd ../..", - "reset": "yarn clean && yarn setup", - "clean:deep": "cd android && rm -rf .cxx .gradle build && cd ../Example/android && rm -rf .gradle build app/build && cd ../.. && yarn clean", - "reset:deep": "yarn clean:deep && yarn setup", - "plugin": "cd plugin && yarn && cd ..", - "app": "cd app && yarn && cd ..", - "run-example:ios": "cd Example && yarn && cd ios && pod install && open ReanimatedExample.xcworkspace && cd .. && yarn start --reset-cache", - "run-example:ios:cold-start": "cd Example && yarn && cd ios && git clean -xdf && pod install && open ReanimatedExample.xcworkspace && cd .. && yarn start --reset-cache", - "run-fabric-example:ios": "cd FabricExample && yarn && cd ios && pod install && open FabricExample.xcworkspace && cd .. && yarn start --reset-cache", - "run-fabric-example:ios:cold-start": "cd FabricExample && yarn && cd ios && git clean -xdf && pod install && open FabricExample.xcworkspace && cd .. && yarn start --reset-cache" + "type:check:app": "yarn workspace common-app type:check", + "type:check:tests:common": "../../scripts/test-ts.sh __typetests__/common", + "build": "yarn workspace react-native-worklets build && bob build", + "circular-dependency-check": "yarn madge --extensions js,jsx --circular lib", + "use-strict-check": "node ../../scripts/validate-use-strict.js", + "prepack": "cp ../../README.md ./README.md", + "postpack": "rm ./README.md" }, "main": "lib/module/index", "module": "lib/module/index", "react-native": "src/index", "source": "src/index", - "types": "lib/typescript/index", + "types": "lib/typescript/index.d.ts", "files": [ "Common/", "src/", @@ -60,9 +52,14 @@ "apple/", "RNReanimated.podspec", "scripts/reanimated_utils.rb", + "scripts/validate-worklets-build.js", + "scripts/validate-worklets-version.js", + "scripts/worklets-version.json", + "scripts/validate-react-native-version.js", + "compatibility.json", "mock.js", "plugin/index.js", - "plugin/build/plugin.js", + "metro-config", "!**/__tests__", "!**/__fixtures__", "!**/__mocks__", @@ -77,7 +74,8 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/software-mansion/react-native-reanimated.git" + "url": "git+https://github.com/software-mansion/react-native-reanimated.git", + "directory": "packages/react-native-reanimated" }, "author": { "email": "krzys.magiera@gmail.com", @@ -88,106 +86,103 @@ "bugs": { "url": "https://github.com/software-mansion/react-native-reanimated/issues" }, - "homepage": "https://github.com/software-mansion/react-native-reanimated#readme", + "homepage": "https://docs.swmansion.com/react-native-reanimated", "dependencies": { - "@babel/plugin-transform-object-assign": "^7.16.7", - "@babel/preset-typescript": "^7.16.7", - "convert-source-map": "^2.0.0", - "invariant": "^2.2.4" + "react-native-is-edge-to-edge": "^1.2.1", + "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0", - "@babel/plugin-proposal-optional-chaining": "^7.0.0-0", - "@babel/plugin-transform-arrow-functions": "^7.0.0-0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", - "@babel/plugin-transform-template-literals": "^7.0.0-0", "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-worklets": ">=0.5.0" }, "devDependencies": { "@babel/cli": "^7.20.0", - "@babel/core": "^7.20.0", - "@babel/plugin-proposal-class-properties": "^7.16.7", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", - "@babel/plugin-proposal-optional-chaining": "^7.0.0", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.0.0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0", - "@babel/plugin-transform-template-literals": "^7.0.0", - "@babel/preset-env": "^7.20.0", + "@babel/core": "^7.25.2", + "@babel/preset-env": "^7.25.3", "@babel/types": "^7.20.0", - "@react-native/eslint-config": "^0.72.2", + "@react-native/babel-preset": "0.81.0", + "@react-native/eslint-config": "0.81.0", + "@react-native/metro-config": "0.81.0", + "@react-native/typescript-config": "0.81.0", + "@shopify/flash-list": "2.0.2", "@testing-library/jest-native": "^4.0.4", - "@testing-library/react-hooks": "^8.0.0", - "@testing-library/react-native": "^7.1.0", + "@testing-library/react-hooks": "^8.0.1", + "@testing-library/react-native": "^13.0.1", "@types/babel__core": "^7.20.0", "@types/babel__generator": "^7.6.4", "@types/babel__traverse": "^7.14.2", "@types/convert-source-map": "^2.0.0", - "@types/invariant": "^2.2.35", - "@types/jest": "^29.0.0", + "@types/jest": "^29.5.13", "@types/node": "^18.0.0", - "@types/react": "^18.0.26", - "@types/react-test-renderer": "17.0.2", - "@typescript-eslint/eslint-plugin": "^5.11.0", - "@typescript-eslint/parser": "^5.11.0", - "axios": "^1.4.0", + "@types/react": "^19.1.0", + "@types/react-test-renderer": "^19.1.0", + "@types/semver": "^7", + "@typescript-eslint/parser": "^6.19.0", + "@typescript-eslint/rule-tester": "^6.21.0", + "axios": "^1.8.2", "babel-eslint": "^10.1.0", - "babel-jest": "^27.5.1", "babel-plugin-module-resolver": "^5.0.0", - "clang-format": "^1.6.0", + "clang-format-node": "^1.3.1", "code-tag": "^1.1.0", - "eslint": "^8.44.0", - "eslint-config-prettier": "^8.3.0", - "eslint-config-standard": "^16.0.3", - "eslint-import-resolver-babel-module": "^5.3.1", - "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jest": "^27.2.1", + "cspell": "^8.8.0", + "eslint": "^9.29.0", + "eslint-config-standard": "^17.1.0", + "eslint-import-resolver-babel-module": "^5.3.2", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.13.0", + "eslint-plugin-n": "^17.19.0", "eslint-plugin-no-inline-styles": "^1.0.5", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", - "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-promise": "^7.2.1", + "eslint-plugin-react-hooks": "^5.2.0", + "eslint-plugin-reanimated": "workspace:*", "eslint-plugin-standard": "^5.0.0", - "eslint-plugin-tsdoc": "^0.2.17", - "husky": "^7.0.4", + "eslint-plugin-tsdoc": "^0.4.0", "jest": "^29.0.0", - "lint-staged": "^11.2.0", + "knip": "^5.61.3", "madge": "^5.0.1", - "prettier": "^2.5.1", - "react": "17.0.2", - "react-native": "0.72.6", - "react-native-builder-bob": "^0.18.3", - "react-native-gesture-handler": "^2.13.2", - "react-native-web": "~0.18.12", - "react-test-renderer": "17.0.2", + "prettier": "^3.3.3", + "react": "19.1.0", + "react-native": "patch:react-native@npm%3A0.81.0#~/.yarn/patches/react-native-npm-0.81.0-96e336150b.patch", + "react-native-builder-bob": "0.40.13", + "react-native-gesture-handler": "2.28.0", + "react-native-svg": "15.12.1", + "react-native-worklets": "workspace:*", + "react-test-renderer": "19.1.0", "shelljs": "^0.8.5", - "ts-prune": "^0.10.3", - "typescript": "^4.1.3" - }, - "lint-staged": { - "*.(js|ts|tsx)": [ - "eslint", - "eslint --quiet --ext '.js,.ts,.tsx' src/", - "prettier --write" - ], - "plugin/**/*.ts": "yarn lint:plugin", - "**/*.{h,cpp}": "yarn lint:cpp", - "android/src/**/*.java": "yarn format:java", - "android/src/**/*.{h,cpp}": "yarn format:android", - "apple/**/*.{h,m,mm,cpp}": "yarn format:ios", - "Common/**/*.{h,cpp}": "yarn format:common" + "typescript": "5.8.3" }, "react-native-builder-bob": { "source": "src", "output": "lib", "targets": [ - "module", + [ + "module", + { + "esm": false, + "jsxRuntime": "automatic" + } + ], "typescript" ] }, + "codegenConfig": { + "name": "rnreanimated", + "type": "modules", + "jsSrcsDir": "./src/specs", + "android": { + "javaPackageName": "com.swmansion.reanimated" + } + }, "sideEffects": [ - "./lib/reanimated2/core", - "./lib/index" + "./src/layoutReanimation/animationsManager.ts", + "./lib/module/layoutReanimation/animationsManager.js", + "./src/core.ts", + "./lib/module/core.js", + "./src/initializers.ts", + "./lib/module/initializers.js", + "./src/index.ts", + "./lib/module/index.js" ] } diff --git a/frontend-admin/node_modules/react-native-reanimated/plugin/index.js b/frontend-admin/node_modules/react-native-reanimated/plugin/index.js index 90d803a9..0f5fd058 100644 --- a/frontend-admin/node_modules/react-native-reanimated/plugin/index.js +++ b/frontend-admin/node_modules/react-native-reanimated/plugin/index.js @@ -1 +1,4 @@ -module.exports = require('./build/plugin.js'); +// @ts-ignore plugin type isn't exposed +const plugin = require('react-native-worklets/plugin'); + +module.exports = plugin; diff --git a/frontend-admin/node_modules/react-native-reanimated/scripts/reanimated_utils.rb b/frontend-admin/node_modules/react-native-reanimated/scripts/reanimated_utils.rb index ae4da556..72bdfce6 100644 --- a/frontend-admin/node_modules/react-native-reanimated/scripts/reanimated_utils.rb +++ b/frontend-admin/node_modules/react-native-reanimated/scripts/reanimated_utils.rb @@ -13,8 +13,9 @@ def find_config() :react_native_minor_version => nil, :is_tvos_target => nil, :react_native_node_modules_dir => nil, - :reanimated_node_modules_dir => nil, :react_native_common_dir => nil, + :dynamic_frameworks_reanimated_dir => nil, + :dynamic_frameworks_worklets_dir => nil, } react_native_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native/package.json')"`), '..') @@ -30,7 +31,13 @@ def find_config() raise '[Reanimated] Unable to recognize your `react-native` version. Please set environmental variable with `react-native` location: `export REACT_NATIVE_NODE_MODULES_DIR="" && pod install`.' end - result[:is_reanimated_example_app] = ENV["REANIMATED_EXAMPLE_APP_NAME"] != nil + validate_worklets_script = File.expand_path(File.join(__dir__, 'validate-worklets-build.js')) + unless system("node \"#{validate_worklets_script}\"") + abort("[Reanimated] Failed to validate worklets version") + end + + + result[:is_reanimated_example_app] = ENV["IS_REANIMATED_EXAMPLE_APP"] != nil result[:is_tvos_target] = react_native_json['name'] == 'react-native-tvos' result[:react_native_version] = react_native_json['version'] result[:react_native_minor_version] = react_native_json['version'].split('.')[1].to_i @@ -38,30 +45,59 @@ def find_config() result[:react_native_minor_version] = 1000 end result[:react_native_node_modules_dir] = File.expand_path(react_native_node_modules_dir) - result[:reanimated_node_modules_dir] = File.expand_path(File.join(__dir__, '..', '..')) pods_root = Pod::Config.instance.project_pods_root react_native_common_dir_absolute = File.join(react_native_node_modules_dir, 'react-native', 'ReactCommon') react_native_common_dir_relative = Pathname.new(react_native_common_dir_absolute).relative_path_from(pods_root).to_s result[:react_native_common_dir] = react_native_common_dir_relative + react_native_reanimated_dir_absolute = File.join(__dir__, '..') + react_native_reanimated_dir_relative = Pathname.new(react_native_reanimated_dir_absolute).relative_path_from(pods_root).to_s + result[:dynamic_frameworks_reanimated_dir] = react_native_reanimated_dir_relative + + react_native_worklets_node_modules_dir = File.join(File.dirname(`cd "#{Pod::Config.instance.installation_root.to_s}" && node --print "require.resolve('react-native-worklets/package.json')"`), '..') + react_native_worklets_dir_absolute = File.join(react_native_worklets_node_modules_dir, 'react-native-worklets') + react_native_worklets_dir_relative = Pathname.new(react_native_worklets_dir_absolute).relative_path_from(pods_root).to_s + result[:dynamic_frameworks_worklets_dir] = react_native_worklets_dir_relative + return result end -def assert_latest_react_native_with_new_architecture(config, reanimated_package_json) - reanimated_version = reanimated_package_json['version'] - reanimated_major_version = reanimated_version.split('.')[0].to_i - react_native_minor_version = config[:react_native_minor_version] - fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1' - if fabric_enabled && reanimated_major_version == 3 && react_native_minor_version < 72 - # If you change the minimal React Native version remember to update Compatibility Table in docs - raise "[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + reanimated_version + " supports the New Architecture on React Native 0.72.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information." +def assert_minimal_react_native_version(config) + validate_react_native_version_script = File.expand_path(File.join(__dir__, 'validate-react-native-version.js')) + unless system("node \"#{validate_react_native_version_script}\" #{config[:react_native_version]}") + raise "[Reanimated] React Native version is not compatible with Reanimated" end end -def assert_minimal_react_native_version(config) - if config[:react_native_minor_version] < 66 - # If you change the minimal React Native version remember to update Compatibility Table in docs - raise "[Reanimated] Unsupported React Native version. Please use 0.66 or newer." +def assert_new_architecture_enabled(new_arch_enabled) + if !new_arch_enabled + raise "[Reanimated] Reanimated requires the New Architecture to be enabled. If you have `RCT_NEW_ARCH_ENABLED=0` set in your environment you should remove it." end end + +def get_static_feature_flags() + feature_flags = {} + + static_feature_flags_path = File.path('./src/featureFlags/staticFlags.json') + if !File.exist?(static_feature_flags_path) + raise "[Reanimated] Feature flags file not found at #{static_feature_flags_path}." + end + static_feature_flags_json = JSON.parse(File.read(static_feature_flags_path)) + static_feature_flags_json.each do |key, value| + feature_flags[key] = value.to_s + end + + package_json_path = File.join(Pod::Config.instance.installation_root.to_s, '..', 'package.json') + if File.exist?(package_json_path) + package_json = JSON.parse(File.read(package_json_path)) + if package_json['reanimated'] && package_json['reanimated']['staticFeatureFlags'] + feature_flags_json = package_json['reanimated']['staticFeatureFlags'] + feature_flags_json.each do |key, value| + feature_flags[key] = value.to_s + end + end + end + + return feature_flags.map { |key, value| "[#{key}:#{value}]" }.join('') +end diff --git a/frontend-admin/node_modules/react-native-reanimated/src/Animated.ts b/frontend-admin/node_modules/react-native-reanimated/src/Animated.ts index de00efd6..1ffc8bc2 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/Animated.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/Animated.ts @@ -1,81 +1,11 @@ 'use strict'; -import type { Extrapolate as _Extrapolate } from './reanimated2/interpolateColor'; -import type { SharedValue as _SharedValue } from './reanimated2/commonTypes'; -import type { DerivedValue as _DerivedValue } from './reanimated2/hook/useDerivedValue'; -import type { - TransformStyleTypes as _TransformStyleTypes, - Adaptable as _Adaptable, - AdaptTransforms as _AdaptTransforms, - AnimatedTransform as _AnimatedTransform, - AnimateStyle as _AnimateStyle, - StylesOrDefault as _StylesOrDefault, - AnimateProps as _AnimateProps, -} from './reanimated2/helperTypes'; -import type { EasingFunction as _EasingFunction } from './reanimated2/Easing'; - -import type { AnimatedScrollViewProps as _AnimatedScrollViewProps } from './reanimated2/component/ScrollView'; -import type { FlatListPropsWithLayout as _FlatListPropsWithLayout } from './reanimated2/component/FlatList'; - -export { createAnimatedComponent } from './createAnimatedComponent'; -export { AnimatedText as Text } from './reanimated2/component/Text'; -export { AnimatedView as View } from './reanimated2/component/View'; -export { AnimatedScrollView as ScrollView } from './reanimated2/component/ScrollView'; -export { AnimatedImage as Image } from './reanimated2/component/Image'; -export { ReanimatedFlatList as FlatList } from './reanimated2/component/FlatList'; +export { ReanimatedFlatList as FlatList } from './component/FlatList'; +export { AnimatedImage as Image } from './component/Image'; +export { AnimatedScrollView as ScrollView } from './component/ScrollView'; +export { AnimatedText as Text } from './component/Text'; +export { AnimatedView as View } from './component/View'; export { addWhitelistedNativeProps, addWhitelistedUIProps, } from './ConfigHelper'; -/** - * @deprecated Please import `Extrapolate` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type Extrapolate = typeof _Extrapolate; -/** - * @deprecated Please import `SharedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ - -export type SharedValue = _SharedValue; -/** - * @deprecated Please import `DerivedValue` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type DerivedValue = _DerivedValue; -/** - * @deprecated Please import `Adaptable` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type Adaptable = _Adaptable; -/** - * @deprecated Please import `TransformStyleTypes` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type TransformStyleTypes = _TransformStyleTypes; -/** - * @deprecated Please import `AdaptTransforms` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AdaptTransforms = _AdaptTransforms; -/** - * @deprecated Please import `AnimatedTransform` directly from `react-native-reanimated` instead of `Animated` namespace. - */ -export type AnimatedTransform = _AnimatedTransform; -/** - * @deprecated Please import `AnimateStyle` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimateStyle = _AnimateStyle; -/** - * @deprecated Please import `StylesOrDefault` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type StylesOrDefault = _StylesOrDefault; -/** - * @deprecated Please import `AnimateProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimateProps

= _AnimateProps

; -/** - * @deprecated Please import `EasingFunction` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type EasingFunction = _EasingFunction; -/** - * @deprecated Please import `AnimatedScrollViewProps` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type AnimatedScrollViewProps = _AnimatedScrollViewProps; -/** - * @deprecated Please import `FlatListPropsWithLayout` directly from `react-native-reanimated` instead of `Animated` namespace. - * */ -export type FlatListPropsWithLayout = _FlatListPropsWithLayout; +export { createAnimatedComponent } from './createAnimatedComponent'; diff --git a/frontend-admin/node_modules/react-native-reanimated/src/ConfigHelper.ts b/frontend-admin/node_modules/react-native-reanimated/src/ConfigHelper.ts index c0f9691b..d0cc2f22 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/ConfigHelper.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/ConfigHelper.ts @@ -1,87 +1,41 @@ 'use strict'; -import { PropsAllowlists } from './propsAllowlists'; -import { jsiConfigureProps } from './reanimated2/core'; -function assertNoOverlapInLists() { - for (const key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) { - if (key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) { - throw new Error( - `[Reanimated] Property \`${key}\` was whitelisted both as UI and native prop. Please remove it from one of the lists.` - ); - } - } -} +import { executeOnUIRuntimeSync } from 'react-native-worklets'; -function configureProps(): void { - assertNoOverlapInLists(); - jsiConfigureProps( - Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST), - Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) - ); -} +import type { LoggerConfig } from './common'; +import { + getLoggerConfig, + SHOULD_BE_USE_WEB, + updateLoggerConfig, +} from './common'; +/** @deprecated This function is a no-op in Reanimated 4. */ export function addWhitelistedNativeProps( - props: Record + _props: Record ): void { - const oldSize = Object.keys( - PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST - ).length; - PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST = { - ...PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST, - ...props, - }; - if ( - oldSize !== - Object.keys(PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST).length - ) { - configureProps(); - } + // Do nothing. This is just for backward compatibility. } -export function addWhitelistedUIProps(props: Record): void { - const oldSize = Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length; - PropsAllowlists.UI_THREAD_PROPS_WHITELIST = { - ...PropsAllowlists.UI_THREAD_PROPS_WHITELIST, - ...props, - }; - if ( - oldSize !== Object.keys(PropsAllowlists.UI_THREAD_PROPS_WHITELIST).length - ) { - configureProps(); - } +/** @deprecated This function is a no-op in Reanimated 4. */ +export function addWhitelistedUIProps(_props: Record): void { + // Do nothing. This is just for backward compatibility. } -const PROCESSED_VIEW_NAMES = new Set(); - -export interface ViewConfig { - uiViewClassName: string; - validAttributes: Record; -} /** - * updates UI props whitelist for given view host instance - * this will work just once for every view name + * Updates Reanimated logger config with the user-provided configuration. Will + * affect Reanimated code executed after call to this function so it should be + * called before any Reanimated code is executed to take effect. Each call to + * this function will override the previous configuration (it's recommended to + * call it only once). + * + * @param config - The new logger configuration to apply. */ - -export function adaptViewConfig(viewConfig: ViewConfig): void { - const viewName = viewConfig.uiViewClassName; - const props = viewConfig.validAttributes; - - // update whitelist of UI props for this view name only once - if (!PROCESSED_VIEW_NAMES.has(viewName)) { - const propsToAdd: Record = {}; - Object.keys(props).forEach((key) => { - // we don't want to add native props as they affect layout - // we also skip props which repeat here - if ( - !(key in PropsAllowlists.NATIVE_THREAD_PROPS_WHITELIST) && - !(key in PropsAllowlists.UI_THREAD_PROPS_WHITELIST) - ) { - propsToAdd[key] = true; - } - }); - addWhitelistedUIProps(propsToAdd); - - PROCESSED_VIEW_NAMES.add(viewName); +export function configureReanimatedLogger(config: LoggerConfig) { + // Get the current config from the React runtime (to have a single source of truth) + const currentConfig = getLoggerConfig(); + // Update the configuration object in the React runtime + updateLoggerConfig(currentConfig, config); + // Register the updated configuration in the UI runtime + if (!SHOULD_BE_USE_WEB) { + executeOnUIRuntimeSync(updateLoggerConfig)(currentConfig, config); } } - -configureProps(); diff --git a/frontend-admin/node_modules/react-native-reanimated/src/animationBuilder.tsx b/frontend-admin/node_modules/react-native-reanimated/src/animationBuilder.tsx index 0f1c5ba8..bef6fc44 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/animationBuilder.tsx +++ b/frontend-admin/node_modules/react-native-reanimated/src/animationBuilder.tsx @@ -1,12 +1,14 @@ 'use strict'; +import { logger } from './common'; import type { ILayoutAnimationBuilder, LayoutAnimationFunction, - LayoutAnimationsValues, -} from './reanimated2/layoutReanimation'; -import type { StyleProps } from './reanimated2/commonTypes'; + LayoutAnimationValues, + StyleProps, +} from './commonTypes'; +import type { NestedArray } from './createAnimatedComponent/commonTypes'; -const mockTargetValues: LayoutAnimationsValues = { +const mockTargetValues: LayoutAnimationValues = { targetOriginX: 0, targetOriginY: 0, targetWidth: 0, @@ -25,12 +27,57 @@ const mockTargetValues: LayoutAnimationsValues = { currentBorderRadius: 0, }; +function getCommonProperties( + layoutStyle: StyleProps, + componentStyle: NestedArray +) { + let componentStyleFlat = Array.isArray(componentStyle) + ? componentStyle.flat() + : [componentStyle]; + + componentStyleFlat = componentStyleFlat.filter(Boolean); + + componentStyleFlat = componentStyleFlat.map((style) => + 'initial' in style + ? style.initial.value // Include properties of animated style + : style + ); + + const componentStylesKeys = componentStyleFlat.flatMap((style) => + Object.keys(style) + ); + + const commonKeys = Object.keys(layoutStyle).filter((key) => + componentStylesKeys.includes(key) + ); + + return commonKeys; +} + +function maybeReportOverwrittenProperties( + layoutAnimationStyle: StyleProps, + style: NestedArray, + displayName: string +) { + const commonProperties = getCommonProperties(layoutAnimationStyle, style); + + if (commonProperties.length > 0) { + logger.warn( + `${ + commonProperties.length === 1 ? 'Property' : 'Properties' + } "${commonProperties.join( + ', ' + )}" of ${displayName} may be overwritten by a layout animation. Please wrap your component with an animated view and apply the layout animation on the wrapper.` + ); + } +} + export function maybeBuild( layoutAnimationOrBuilder: | ILayoutAnimationBuilder | LayoutAnimationFunction | Keyframe, - style: StyleProps | undefined, + style: NestedArray | undefined, displayName: string ): LayoutAnimationFunction | Keyframe { const isAnimationBuilder = ( @@ -41,24 +88,17 @@ export function maybeBuild( if (isAnimationBuilder(layoutAnimationOrBuilder)) { const animationFactory = layoutAnimationOrBuilder.build(); - const layoutAnimation = animationFactory(mockTargetValues); - const animatedStyle = layoutAnimation.animations; - const getCommonProperties = (obj1: object, obj2: object) => - Object.keys(obj1).filter((key) => - Object.prototype.hasOwnProperty.call(obj2, key) - ); - - const commonProperties = getCommonProperties(animatedStyle, style || {}); - if (commonProperties.length > 0) { - console.warn( - `[Reanimated] ${ - commonProperties.length === 1 ? 'Property' : 'Properties: ' - } "${commonProperties}" of ${displayName} may be overwritten with layout animation. Please create a wrapper with the layout animation you want to apply.` + if (__DEV__ && style) { + const layoutAnimation = animationFactory(mockTargetValues); + maybeReportOverwrittenProperties( + layoutAnimation.animations, + style, + displayName ); } - return layoutAnimationOrBuilder.build(); + return animationFactory; } else { return layoutAnimationOrBuilder; } diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/InlinePropManager.ts b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/InlinePropManager.ts index 993c9d17..3f37da94 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/InlinePropManager.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/InlinePropManager.ts @@ -1,24 +1,17 @@ 'use strict'; -import type { StyleProps } from '../reanimated2'; +import type { StyleProps } from '../commonTypes'; +import { isSharedValue } from '../isSharedValue'; +import { startMapper, stopMapper } from '../mappers'; +import { updateProps } from '../updateProps'; +import type { ViewDescriptorsSet } from '../ViewDescriptorsSet'; +import { makeViewDescriptorsSet } from '../ViewDescriptorsSet'; import type { - IAnimatedComponentInternal, AnimatedComponentProps, + AnimatedComponentType, IInlinePropManager, ViewInfo, } from './commonTypes'; import { flattenArray } from './utils'; -import { makeViewDescriptorsSet } from '../reanimated2/ViewDescriptorsSet'; -import type { - ViewDescriptorsSet, - ViewRefSet, -} from '../reanimated2/ViewDescriptorsSet'; -import { adaptViewConfig } from '../ConfigHelper'; -import updateProps from '../reanimated2/UpdateProps'; -import { stopMapper, startMapper } from '../reanimated2/mappers'; -import { isSharedValue } from '../reanimated2/isSharedValue'; -import { shouldBeUseWeb } from '../reanimated2/PlatformChecker'; - -const SHOULD_BE_USE_WEB = shouldBeUseWeb(); function isInlineStyleTransform(transform: unknown): boolean { if (!Array.isArray(transform)) { @@ -37,29 +30,30 @@ function inlinePropsHasChanged( } for (const key of Object.keys(styles1)) { - if (styles1[key] !== styles2[key]) return true; + if (styles1[key] !== styles2[key]) { + return true; + } } return false; } -function getInlinePropsUpdate(inlineProps: Record) { +function getInlinePropsUpdate(styleValue: StyleProps): unknown { 'worklet'; - const update: Record = {}; - for (const [key, styleValue] of Object.entries(inlineProps)) { - if (isSharedValue(styleValue)) { - update[key] = styleValue.value; - } else if (Array.isArray(styleValue)) { - update[key] = styleValue.map((item) => { - return getInlinePropsUpdate(item); - }); - } else if (typeof styleValue === 'object') { - update[key] = getInlinePropsUpdate(styleValue as Record); - } else { - update[key] = styleValue; - } + if (isSharedValue(styleValue)) { + return styleValue.value; } - return update; + if (Array.isArray(styleValue)) { + return styleValue.map(getInlinePropsUpdate); + } + if (styleValue && typeof styleValue === 'object') { + const update: Record = {}; + for (const [key, value] of Object.entries(styleValue)) { + update[key] = getInlinePropsUpdate(value); + } + return update; + } + return styleValue; } function extractSharedValuesMapFromProps( @@ -77,14 +71,14 @@ function extractSharedValuesMapFromProps( if (!style) { return; } - for (const [key, styleValue] of Object.entries(style)) { + for (const [styleKey, styleValue] of Object.entries(style)) { if (isSharedValue(styleValue)) { - inlineProps[key] = styleValue; + inlineProps[styleKey] = styleValue; } else if ( - key === 'transform' && + styleKey === 'transform' && isInlineStyleTransform(styleValue) ) { - inlineProps[key] = styleValue; + inlineProps[styleKey] = styleValue; } } }); @@ -114,7 +108,7 @@ export function getInlineStyle( isFirstRender: boolean ) { if (isFirstRender) { - return getInlinePropsUpdate(style); + return getInlinePropsUpdate(style) as Record; } const newStyle: StyleProps = {}; for (const [key, styleValue] of Object.entries(style)) { @@ -134,8 +128,7 @@ export class InlinePropManager implements IInlinePropManager { _inlineProps: StyleProps = {}; public attachInlineProps( - animatedComponent: React.Component & - IAnimatedComponentInternal, + animatedComponent: AnimatedComponentType, viewInfo: ViewInfo ) { const newInlineProps: Record = @@ -146,31 +139,20 @@ export class InlinePropManager implements IInlinePropManager { if (!this._inlinePropsViewDescriptors) { this._inlinePropsViewDescriptors = makeViewDescriptorsSet(); - const { viewTag, viewName, shadowNodeWrapper, viewConfig } = viewInfo; - - if (Object.keys(newInlineProps).length && viewConfig) { - adaptViewConfig(viewConfig); - } + const { viewTag, shadowNodeWrapper } = viewInfo; this._inlinePropsViewDescriptors.add({ - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion tag: viewTag as number, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - name: viewName!, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion shadowNodeWrapper: shadowNodeWrapper!, }); } const shareableViewDescriptors = this._inlinePropsViewDescriptors.shareableViewDescriptors; - const maybeViewRef = SHOULD_BE_USE_WEB - ? ({ items: new Set([animatedComponent]) } as ViewRefSet) // see makeViewsRefSet - : undefined; const updaterFunction = () => { 'worklet'; const update = getInlinePropsUpdate(newInlineProps); - updateProps(shareableViewDescriptors, update, maybeViewRef); + updateProps(shareableViewDescriptors, update); }; this._inlineProps = newInlineProps; if (this._inlinePropsMapperId) { diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/JSPropsUpdater.ts b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/JSPropsUpdater.ts index 84015b00..d53f3790 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/JSPropsUpdater.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/JSPropsUpdater.ts @@ -1,124 +1,55 @@ 'use strict'; -import { - NativeEventEmitter, - NativeModules, - findNodeHandle, -} from 'react-native'; -import { shouldBeUseWeb } from '../reanimated2/PlatformChecker'; -import type { StyleProps } from '../reanimated2'; -import { runOnJS, runOnUIImmediately } from '../reanimated2/threads'; +import { runOnUI } from 'react-native-worklets'; + +import { SHOULD_BE_USE_WEB } from '../common'; import type { AnimatedComponentProps, + AnimatedComponentType, IAnimatedComponentInternal, IJSPropsUpdater, InitialComponentProps, + JSPropsOperation, } from './commonTypes'; -interface ListenerData { - viewTag: number; - props: StyleProps; -} +class JSPropsUpdaterNative implements IJSPropsUpdater { + private static _tagToComponentMapping = new Map< + number, + AnimatedComponentType + >(); -const SHOULD_BE_USE_WEB = shouldBeUseWeb(); - -class JSPropsUpdaterPaper implements IJSPropsUpdater { - private static _tagToComponentMapping = new Map(); - private _reanimatedEventEmitter: NativeEventEmitter; - - constructor() { - this._reanimatedEventEmitter = new NativeEventEmitter( - NativeModules.ReanimatedModule - ); - } - - public addOnJSPropsChangeListener( - animatedComponent: React.Component< - AnimatedComponentProps - > & - IAnimatedComponentInternal + public registerComponent( + animatedComponent: AnimatedComponentType, + jsProps: string[] ) { - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterPaper._tagToComponentMapping.set(viewTag, animatedComponent); - if (JSPropsUpdaterPaper._tagToComponentMapping.size === 1) { - const listener = (data: ListenerData) => { - const component = JSPropsUpdaterPaper._tagToComponentMapping.get( - data.viewTag - ); - component?._updateFromNative(data.props); - }; - this._reanimatedEventEmitter.addListener( - 'onReanimatedPropsChange', - listener + const viewTag = animatedComponent.getComponentViewTag(); + JSPropsUpdaterNative._tagToComponentMapping.set(viewTag, animatedComponent); + + runOnUI(() => { + global._tagToJSPropNamesMapping[viewTag] = Object.fromEntries( + jsProps.map((propName) => [propName, true]) ); - } + })(); } - public removeOnJSPropsChangeListener( - animatedComponent: React.Component< - AnimatedComponentProps - > & - IAnimatedComponentInternal - ) { - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterPaper._tagToComponentMapping.delete(viewTag); - if (JSPropsUpdaterPaper._tagToComponentMapping.size === 0) { - this._reanimatedEventEmitter.removeAllListeners( - 'onReanimatedPropsChange' - ); - } - } -} + public unregisterComponent(animatedComponent: AnimatedComponentType) { + const viewTag = animatedComponent.getComponentViewTag(); + JSPropsUpdaterNative._tagToComponentMapping.delete(viewTag); -class JSPropsUpdaterFabric implements IJSPropsUpdater { - private static _tagToComponentMapping = new Map(); - private static isInitialized = false; - - constructor() { - if (!JSPropsUpdaterFabric.isInitialized) { - const updater = (viewTag: number, props: unknown) => { - const component = - JSPropsUpdaterFabric._tagToComponentMapping.get(viewTag); - component?._updateFromNative(props); - }; - runOnUIImmediately(() => { - 'worklet'; - global.updateJSProps = (viewTag: number, props: unknown) => { - runOnJS(updater)(viewTag, props); - }; - })(); - JSPropsUpdaterFabric.isInitialized = true; - } + runOnUI(() => { + delete global._tagToJSPropNamesMapping[viewTag]; + })(); } - public addOnJSPropsChangeListener( - animatedComponent: React.Component< - AnimatedComponentProps - > & - IAnimatedComponentInternal - ) { - if (!JSPropsUpdaterFabric.isInitialized) { - return; - } - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterFabric._tagToComponentMapping.set(viewTag, animatedComponent); - } - - public removeOnJSPropsChangeListener( - animatedComponent: React.Component< - AnimatedComponentProps - > & - IAnimatedComponentInternal - ) { - if (!JSPropsUpdaterFabric.isInitialized) { - return; - } - const viewTag = findNodeHandle(animatedComponent); - JSPropsUpdaterFabric._tagToComponentMapping.delete(viewTag); + public updateProps(operations: JSPropsOperation[]) { + operations.forEach(({ tag, updates }) => { + const component = JSPropsUpdaterNative._tagToComponentMapping.get(tag); + component?.setNativeProps(updates); + }); } } class JSPropsUpdaterWeb implements IJSPropsUpdater { - public addOnJSPropsChangeListener( + public registerComponent( _animatedComponent: React.Component< AnimatedComponentProps > & @@ -127,7 +58,7 @@ class JSPropsUpdaterWeb implements IJSPropsUpdater { // noop } - public removeOnJSPropsChangeListener( + public unregisterComponent( _animatedComponent: React.Component< AnimatedComponentProps > & @@ -135,20 +66,23 @@ class JSPropsUpdaterWeb implements IJSPropsUpdater { ) { // noop } + + public updateProps(_operations: JSPropsOperation[]) { + // noop + } } type JSPropsUpdaterOptions = | typeof JSPropsUpdaterWeb - | typeof JSPropsUpdaterFabric - | typeof JSPropsUpdaterPaper; + | typeof JSPropsUpdaterNative; let JSPropsUpdater: JSPropsUpdaterOptions; if (SHOULD_BE_USE_WEB) { JSPropsUpdater = JSPropsUpdaterWeb; -} else if (global._IS_FABRIC) { - JSPropsUpdater = JSPropsUpdaterFabric; } else { - JSPropsUpdater = JSPropsUpdaterPaper; + JSPropsUpdater = JSPropsUpdaterNative; } -export default JSPropsUpdater; +const jsPropsUpdater = new JSPropsUpdater(); + +export default jsPropsUpdater; diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/PropsFilter.tsx b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/PropsFilter.tsx index 2ac80492..2002e4f0 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/PropsFilter.tsx +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/PropsFilter.tsx @@ -1,19 +1,19 @@ 'use strict'; -import type { StyleProps, SharedValue } from '../reanimated2'; -import { isSharedValue } from '../reanimated2'; -import { isChromeDebugger } from '../reanimated2/PlatformChecker'; -import WorkletEventHandler from '../reanimated2/WorkletEventHandler'; -import { initialUpdaterRun } from '../reanimated2/animation'; -import { hasInlineStyles, getInlineStyle } from './InlinePropManager'; + +import { initialUpdaterRun } from '../animation'; +import type { StyleProps } from '../commonTypes'; +import type { AnimatedStyleHandle } from '../hook/commonTypes'; +import { isSharedValue } from '../isSharedValue'; +import { WorkletEventHandler } from '../WorkletEventHandler'; import type { AnimatedComponentProps, + AnimatedComponentType, AnimatedProps, InitialComponentProps, - IAnimatedComponentInternal, IPropsFilter, } from './commonTypes'; +import { getInlineStyle, hasInlineStyles } from './InlinePropManager'; import { flattenArray, has } from './utils'; -import { StyleSheet } from 'react-native'; function dummyListener() { // empty listener we use to assign to listener properties for which animated @@ -21,56 +21,68 @@ function dummyListener() { } export class PropsFilter implements IPropsFilter { - private _initialStyle = {}; + private _initialPropsMap = new Map(); public filterNonAnimatedProps( - component: React.Component & IAnimatedComponentInternal + component: AnimatedComponentType ): Record { const inputProps = component.props as AnimatedComponentProps; const props: Record = {}; + for (const key in inputProps) { const value = inputProps[key]; if (key === 'style') { const styleProp = inputProps.style; const styles = flattenArray(styleProp ?? []); - const processedStyle: StyleProps = styles.map((style) => { - if (style && style.viewDescriptors) { - // this is how we recognize styles returned by useAnimatedStyle - style.viewsRef.add(component); + + const processedStyle: StyleProps[] = styles.map((style) => { + if (style?.viewDescriptors) { + const handle = style as AnimatedStyleHandle; + if (component._isFirstRender) { - this._initialStyle = { - ...style.initial.value, - ...this._initialStyle, - ...initialUpdaterRun(style.initial.updater), - }; + this._initialPropsMap.set(handle, { + ...handle.initial.value, + ...initialUpdaterRun(handle.initial.updater), + } as StyleProps); } - return this._initialStyle; + + return this._initialPropsMap.get(handle) ?? {}; } else if (hasInlineStyles(style)) { return getInlineStyle(style, component._isFirstRender); } else { return style; } }); - props[key] = StyleSheet.flatten(processedStyle); + // keep styles as they were passed by the user + // it will help other libs to interpret styles correctly + props[key] = processedStyle; } else if (key === 'animatedProps') { - const animatedProp = inputProps.animatedProps as Partial< - AnimatedComponentProps - >; - if (animatedProp.initial !== undefined) { - Object.keys(animatedProp.initial.value).forEach((key) => { - props[key] = animatedProp.initial?.value[key]; - animatedProp.viewsRef?.add(component); - }); - } + const animatedPropsProp = inputProps.animatedProps; + const animatedPropsArray = flattenArray< + Partial> + >(animatedPropsProp ?? []); + + animatedPropsArray.forEach((animatedProps) => { + if (animatedProps?.viewDescriptors && animatedProps.initial) { + Object.keys(animatedProps.initial.value).forEach( + (initialValueKey) => { + props[initialValueKey] = + animatedProps.initial?.value[initialValueKey]; + } + ); + } + }); } else if ( - has('current', value) && - value.current instanceof WorkletEventHandler + has('workletEventHandler', value) && + value.workletEventHandler instanceof WorkletEventHandler ) { - if (value.current.eventNames.length > 0) { - value.current.eventNames.forEach((eventName) => { - props[eventName] = has('listeners', value.current) - ? (value.current.listeners as Record)[eventName] + if (value.workletEventHandler.eventNames.length > 0) { + value.workletEventHandler.eventNames.forEach((eventName) => { + props[eventName] = has('listeners', value.workletEventHandler) + ? ( + value.workletEventHandler.listeners as Record + )[eventName] : dummyListener; }); } else { @@ -78,9 +90,9 @@ export class PropsFilter implements IPropsFilter { } } else if (isSharedValue(value)) { if (component._isFirstRender) { - props[key] = (value as SharedValue).value; + props[key] = value.value; } - } else if (key !== 'onGestureHandlerStateChange' || !isChromeDebugger()) { + } else { props[key] = value; } } diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts index 01a9736f..d9d4bb11 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts @@ -1,32 +1,35 @@ 'use strict'; -import type { Ref, Component } from 'react'; +import type { Component, Ref, RefObject } from 'react'; + import type { - StyleProps, - BaseAnimationBuilder, - ILayoutAnimationBuilder, + AnimatedStyle, EntryExitAnimationFunction, - SharedTransition, + ILayoutAnimationBuilder, + ShadowNodeWrapper, SharedValue, -} from '../reanimated2'; -import type { - ViewDescriptorsSet, - ViewRefSet, -} from '../reanimated2/ViewDescriptorsSet'; -import type { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig'; -import type { ShadowNodeWrapper } from '../reanimated2/commonTypes'; -import type { ViewConfig } from '../ConfigHelper'; + StyleProps, + StyleUpdaterContainer, +} from '../commonTypes'; +import type { SkipEnteringContext } from '../component/LayoutAnimationConfig'; +import type { BaseAnimationBuilder } from '../layoutReanimation'; +import type { ViewDescriptorsSet } from '../ViewDescriptorsSet'; export interface AnimatedProps extends Record { viewDescriptors?: ViewDescriptorsSet; - viewsRef?: ViewRefSet; initial?: SharedValue; + styleUpdaterContainer?: StyleUpdaterContainer; } export interface ViewInfo { - viewTag: number | HTMLElement | null; - viewName: string | null; + viewTag: number | AnimatedComponentRef | HTMLElement | null; shadowNodeWrapper: ShadowNodeWrapper | null; - viewConfig: ViewConfig; + // This is a React host instance view name which might differ from the + // Fabric component name. For clarity, we use the viewName property + // here and componentName in C++ after converting react viewName to + // Fabric component name. + // (see react/renderer/componentregistry/componentNameByReactViewName.cpp) + viewName?: string; + DOMElement?: HTMLElement | null; } export interface IInlinePropManager { @@ -37,31 +40,49 @@ export interface IInlinePropManager { detachInlineProps(): void; } +export type AnimatedComponentType = React.Component & + IAnimatedComponentInternal; + +// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents +export type PropUpdates = StyleProps | AnimatedStyle; + export interface IPropsFilter { filterNonAnimatedProps: ( - component: React.Component & IAnimatedComponentInternal + component: AnimatedComponentType ) => Record; } +export type JSPropsOperation = { + tag: number; + updates: StyleProps; +}; + export interface IJSPropsUpdater { - addOnJSPropsChangeListener( - animatedComponent: React.Component & - IAnimatedComponentInternal - ): void; - removeOnJSPropsChangeListener( - animatedComponent: React.Component & - IAnimatedComponentInternal + registerComponent( + animatedComponent: AnimatedComponentType, + jsProps: string[] ): void; + unregisterComponent(animatedComponent: AnimatedComponentType): void; + updateProps(operations: JSPropsOperation[]): void; +} + +export interface INativeEventsManager { + attachEvents(): void; + detachEvents(): void; + updateEvents(prevProps: AnimatedComponentProps): void; } export type LayoutAnimationStaticContext = { presetName: string; }; -export type AnimatedComponentProps

> = P & { - forwardedRef?: Ref; +export type AnimatedComponentProps< + P extends Record = Record, +> = P & { + ref?: Ref; style?: NestedArray; animatedProps?: Partial>; + jestAnimatedValues?: RefObject; animatedStyle?: StyleProps; layout?: ( | BaseAnimationBuilder @@ -83,34 +104,67 @@ export type AnimatedComponentProps

> = P & { | Keyframe ) & LayoutAnimationStaticContext; - sharedTransitionTag?: string; - sharedTransitionStyle?: SharedTransition; }; +export type LayoutAnimationOrBuilder = ( + | BaseAnimationBuilder + | typeof BaseAnimationBuilder + | EntryExitAnimationFunction + | Keyframe + | ILayoutAnimationBuilder +) & + LayoutAnimationStaticContext; + export interface AnimatedComponentRef extends Component { setNativeProps?: (props: Record) => void; getScrollableNode?: () => AnimatedComponentRef; getAnimatableRef?: () => AnimatedComponentRef; + // Case for SVG components on Web + elementRef?: React.RefObject; } -export interface IAnimatedComponentInternal { - _styles: StyleProps[] | null; - _animatedProps?: Partial>; - _viewTag: number; +export interface IAnimatedComponentInternalBase { + ChildComponent: AnyComponent; + _componentRef: AnimatedComponentRef | HTMLElement | null; + _hasAnimatedRef: boolean; + _viewInfo?: ViewInfo; + + /** + * Used for Layout Animations and Animated Styles. It is not related to event + * handling. + */ + getComponentViewTag: () => number; +} + +export interface IAnimatedComponentInternal + extends IAnimatedComponentInternalBase { + _animatedStyles: StyleProps[]; + _prevAnimatedStyles: StyleProps[]; + _animatedProps: Partial>[]; + _prevAnimatedProps: Partial>[]; _isFirstRender: boolean; - animatedStyle: { value: StyleProps }; - _component: AnimatedComponentRef | HTMLElement | null; - _sharedElementTransition: SharedTransition | null; - _jsPropsUpdater: IJSPropsUpdater; + jestInlineStyle: NestedArray | undefined; + jestAnimatedStyle: { value: StyleProps }; + jestAnimatedProps: { value: AnimatedProps }; _InlinePropManager: IInlinePropManager; _PropsFilter: IPropsFilter; - _viewInfo?: ViewInfo; + /** Doesn't exist on web. */ + _NativeEventsManager?: INativeEventsManager; context: React.ContextType; + setNativeProps: (props: StyleProps) => void; } export type NestedArray = T | NestedArray[]; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export type AnyComponent = React.ComponentType; + export interface InitialComponentProps extends Record { ref?: Ref; collapsable?: boolean; } + +export type ManagedAnimatedComponent = React.Component< + AnimatedComponentProps +> & + IAnimatedComponentInternal; diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx index 71523274..90980394 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx @@ -1,81 +1,24 @@ 'use strict'; import type { - Component, ComponentClass, ComponentType, FunctionComponent, - MutableRefObject, + Ref, } from 'react'; import React from 'react'; -import { findNodeHandle, Platform } from 'react-native'; -import WorkletEventHandler from '../reanimated2/WorkletEventHandler'; -import '../reanimated2/layoutReanimation/animationsManager'; -import invariant from 'invariant'; -import { adaptViewConfig } from '../ConfigHelper'; -import { RNRenderer } from '../reanimated2/platform-specific/RNRenderer'; -import { - configureLayoutAnimations, - enableLayoutAnimations, -} from '../reanimated2/core'; -import { - SharedTransition, - LayoutAnimationType, -} from '../reanimated2/layoutReanimation'; -import type { StyleProps, ShadowNodeWrapper } from '../reanimated2/commonTypes'; -import { getShadowNodeWrapperFromRef } from '../reanimated2/fabricUtils'; -import { removeFromPropsRegistry } from '../reanimated2/PropsRegistry'; -import { getReduceMotionFromConfig } from '../reanimated2/animation/util'; -import { maybeBuild } from '../animationBuilder'; -import { SkipEnteringContext } from '../reanimated2/component/LayoutAnimationConfig'; -import type { AnimateProps } from '../reanimated2'; -import JSPropsUpdater from './JSPropsUpdater'; -import type { - AnimatedComponentProps, - AnimatedProps, - InitialComponentProps, - AnimatedComponentRef, - IAnimatedComponentInternal, - ViewInfo, -} from './commonTypes'; -import { has, flattenArray } from './utils'; -import setAndForwardRef from './setAndForwardRef'; -import { - isFabric, - isJest, - isWeb, - shouldBeUseWeb, -} from '../reanimated2/PlatformChecker'; -import { InlinePropManager } from './InlinePropManager'; -import { PropsFilter } from './PropsFilter'; -import { - startWebLayoutAnimation, - tryActivateLayoutTransition, - configureWebLayoutAnimations, - getReducedMotionFromConfig, -} from '../reanimated2/layoutReanimation/web'; -import type { CustomConfig } from '../reanimated2/layoutReanimation/web/config'; import type { FlatList, FlatListProps } from 'react-native'; -const IS_WEB = isWeb(); -const IS_FABRIC = isFabric(); +import type { AnimatedProps } from '../helperTypes'; +import type { Options } from './AnimatedComponent'; +import AnimatedComponentImpl from './AnimatedComponent'; +import type { + AnimatedComponentProps, + InitialComponentProps, +} from './commonTypes'; -function onlyAnimatedStyles(styles: StyleProps[]): StyleProps[] { - return styles.filter((style) => style?.viewDescriptors); -} - -function isSameAnimatedStyle( - style1?: StyleProps, - style2?: StyleProps -): boolean { - // We cannot use equality check to compare useAnimatedStyle outputs directly. - // Instead, we can compare its viewsRefs. - return style1?.viewsRef === style2?.viewsRef; -} - -const isSameAnimatedProps = isSameAnimatedStyle; - -type Options

= { - setNativeProps: (ref: AnimatedComponentRef, props: P) => void; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +type AnimatableComponent> = C & { + jsProps?: string[]; }; /** @@ -86,517 +29,70 @@ type Options

= { * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent */ +// Don't change the order of overloads, since such a change breaks current behavior +export function createAnimatedComponent

( + component: AnimatableComponent>, + options?: Options

+): FunctionComponent>; + +export function createAnimatedComponent

( + component: AnimatableComponent>, + options?: Options

+): ComponentClass>; + +export function createAnimatedComponent

( + // Actually ComponentType

= ComponentClass

| FunctionComponent

but we need this overload too + // since some external components (like FastImage) are typed just as ComponentType + component: AnimatableComponent>, + options?: Options

+): FunctionComponent> | ComponentClass>; + /** - * @deprecated Please use `Animated.FlatList` component instead of calling `Animated.createAnimatedComponent(FlatList)` manually. + * @deprecated Please use `Animated.FlatList` component instead of calling + * `Animated.createAnimatedComponent(FlatList)` manually. */ // @ts-ignore This is required to create this overload, since type of createAnimatedComponent is incorrect and doesn't include typeof FlatList export function createAnimatedComponent( - component: typeof FlatList, - options?: Options -): ComponentClass>>; - -export function createAnimatedComponent

( - component: FunctionComponent

, - options?: Options

-): FunctionComponent>; - -export function createAnimatedComponent

( - component: ComponentClass

, - options?: Options

-): ComponentClass>; + component: AnimatableComponent>, + options?: Options> +): ComponentClass>>; export function createAnimatedComponent( - Component: ComponentType, + Component: AnimatableComponent>, options?: Options + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): any { - invariant( - typeof Component !== 'function' || - (Component.prototype && Component.prototype.isReactComponent), - `Looks like you're passing a function component \`${Component.name}\` to \`createAnimatedComponent\` function which supports only class components. Please wrap your function component with \`React.forwardRef()\` or use a class component instead.` - ); - - class AnimatedComponent - extends React.Component> - implements IAnimatedComponentInternal - { - _styles: StyleProps[] | null = null; - _animatedProps?: Partial>; - _viewTag = -1; - _isFirstRender = true; - animatedStyle: { value: StyleProps } = { value: {} }; - _component: AnimatedComponentRef | HTMLElement | null = null; - _sharedElementTransition: SharedTransition | null = null; - _jsPropsUpdater = new JSPropsUpdater(); - _InlinePropManager = new InlinePropManager(); - _PropsFilter = new PropsFilter(); - _viewInfo?: ViewInfo; - static displayName: string; - static contextType = SkipEnteringContext; - context!: React.ContextType; + class AnimatedComponent extends AnimatedComponentImpl { + static displayName = `AnimatedComponent(${ + Component.displayName || Component.name || 'Component' + })`; constructor(props: AnimatedComponentProps) { - super(props); - if (isJest()) { - this.animatedStyle = { value: {} }; - } - } - - componentDidMount() { - this._attachNativeEvents(); - this._jsPropsUpdater.addOnJSPropsChangeListener(this); - this._attachAnimatedStyles(); - this._InlinePropManager.attachInlineProps(this, this._getViewInfo()); - - if (IS_WEB) { - configureWebLayoutAnimations(); - - if (!this.props.entering) { - this._isFirstRender = false; - return; - } - - if (getReducedMotionFromConfig(this.props.entering as CustomConfig)) { - this._isFirstRender = false; - return; - } - - startWebLayoutAnimation( - this.props, - this._component as HTMLElement, - LayoutAnimationType.ENTERING - ); - } - - this._isFirstRender = false; - } - - componentWillUnmount() { - this._detachNativeEvents(); - this._jsPropsUpdater.removeOnJSPropsChangeListener(this); - this._detachStyles(); - this._InlinePropManager.detachInlineProps(); - this._sharedElementTransition?.unregisterTransition(this._viewTag); - - if ( - IS_WEB && - this.props.exiting && - !getReducedMotionFromConfig(this.props.exiting as CustomConfig) - ) { - startWebLayoutAnimation( - this.props, - this._component as HTMLElement, - LayoutAnimationType.EXITING - ); - } - } - - _getEventViewRef() { - // Make sure to get the scrollable node for components that implement - // `ScrollResponder.Mixin`. - return (this._component as AnimatedComponentRef)?.getScrollableNode - ? (this._component as AnimatedComponentRef).getScrollableNode?.() - : this._component; - } - - _attachNativeEvents() { - const node = this._getEventViewRef() as AnimatedComponentRef; - let viewTag = null; // We set it only if needed - - for (const key in this.props) { - const prop = this.props[key]; - if ( - has('current', prop) && - prop.current instanceof WorkletEventHandler - ) { - if (viewTag === null) { - viewTag = findNodeHandle(options?.setNativeProps ? this : node); - } - prop.current.registerForEvents(viewTag as number, key); - } - } - } - - _detachNativeEvents() { - for (const key in this.props) { - const prop = this.props[key]; - if ( - has('current', prop) && - prop.current instanceof WorkletEventHandler - ) { - prop.current.unregisterFromEvents(); - } - } - } - - _detachStyles() { - if (IS_WEB && this._styles !== null) { - for (const style of this._styles) { - if (style?.viewsRef) { - style.viewsRef.remove(this); - } - } - } else if (this._viewTag !== -1 && this._styles !== null) { - for (const style of this._styles) { - style.viewDescriptors.remove(this._viewTag); - } - if (this.props.animatedProps?.viewDescriptors) { - this.props.animatedProps.viewDescriptors.remove(this._viewTag); - } - if (IS_FABRIC) { - removeFromPropsRegistry(this._viewTag); - } - } - } - - _reattachNativeEvents( - prevProps: AnimatedComponentProps - ) { - for (const key in prevProps) { - const prop = this.props[key]; - if ( - has('current', prop) && - prop.current instanceof WorkletEventHandler && - prop.current.reattachNeeded - ) { - prop.current.unregisterFromEvents(); - } - } - - let viewTag = null; - - for (const key in this.props) { - const prop = this.props[key]; - if ( - has('current', prop) && - prop.current instanceof WorkletEventHandler && - prop.current.reattachNeeded - ) { - if (viewTag === null) { - const node = this._getEventViewRef() as AnimatedComponentRef; - viewTag = findNodeHandle(options?.setNativeProps ? this : node); - } - prop.current.registerForEvents(viewTag as number, key); - prop.current.reattachNeeded = false; - } - } - } - - _updateFromNative(props: StyleProps) { - if (options?.setNativeProps) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - options.setNativeProps(this._component as AnimatedComponentRef, props); - } else { - // eslint-disable-next-line no-unused-expressions - (this._component as AnimatedComponentRef)?.setNativeProps?.(props); - } - } - - _getViewInfo(): ViewInfo { - if (this._viewInfo !== undefined) { - return this._viewInfo; - } - - let viewTag: number | HTMLElement | null; - let viewName: string | null; - let shadowNodeWrapper: ShadowNodeWrapper | null = null; - let viewConfig; - // Component can specify ref which should be animated when animated version of the component is created. - // Otherwise, we animate the component itself. - const component = (this._component as AnimatedComponentRef) - ?.getAnimatableRef - ? (this._component as AnimatedComponentRef).getAnimatableRef?.() - : this; - - if (IS_WEB) { - // At this point I assume that `_setComponentRef` was already called and `_component` is set. - // `this._component` on web represents HTMLElement of our component, that's why we use casting - viewTag = this._component as HTMLElement; - viewName = null; - shadowNodeWrapper = null; - viewConfig = null; - } else { - // hostInstance can be null for a component that doesn't render anything (render function returns null). Example: svg Stop: https://github.com/react-native-svg/react-native-svg/blob/develop/src/elements/Stop.tsx - const hostInstance = RNRenderer.findHostInstance_DEPRECATED(component); - if (!hostInstance) { - throw new Error( - '[Reanimated] Cannot find host instance for this component. Maybe it renders nothing?' - ); - } - // we can access view tag in the same way it's accessed here https://github.com/facebook/react/blob/e3f4eb7272d4ca0ee49f27577156b57eeb07cf73/packages/react-native-renderer/src/ReactFabric.js#L146 - viewTag = hostInstance?._nativeTag; - /** - * RN uses viewConfig for components for storing different properties of the component(example: https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Components/ScrollView/ScrollViewNativeComponent.js#L24). - * The name we're looking for is in the field named uiViewClassName. - */ - viewName = hostInstance?.viewConfig?.uiViewClassName; - - viewConfig = hostInstance?.viewConfig; - - if (IS_FABRIC) { - shadowNodeWrapper = getShadowNodeWrapperFromRef(this); - } - } - this._viewInfo = { viewTag, viewName, shadowNodeWrapper, viewConfig }; - return this._viewInfo; - } - - _attachAnimatedStyles() { - const styles = this.props.style - ? onlyAnimatedStyles(flattenArray(this.props.style)) - : []; - const prevStyles = this._styles; - this._styles = styles; - - const prevAnimatedProps = this._animatedProps; - this._animatedProps = this.props.animatedProps; - - const { viewTag, viewName, shadowNodeWrapper, viewConfig } = - this._getViewInfo(); - - // update UI props whitelist for this view - const hasReanimated2Props = - this.props.animatedProps?.viewDescriptors || styles.length; - if (hasReanimated2Props && viewConfig) { - adaptViewConfig(viewConfig); - } - - this._viewTag = viewTag as number; - - // remove old styles - if (prevStyles) { - // in most of the cases, views have only a single animated style and it remains unchanged - const hasOneSameStyle = - styles.length === 1 && - prevStyles.length === 1 && - isSameAnimatedStyle(styles[0], prevStyles[0]); - - if (!hasOneSameStyle) { - // otherwise, remove each style that is not present in new styles - for (const prevStyle of prevStyles) { - const isPresent = styles.some((style) => - isSameAnimatedStyle(style, prevStyle) - ); - if (!isPresent) { - prevStyle.viewDescriptors.remove(viewTag); - } - } - } - } - - styles.forEach((style) => { - style.viewDescriptors.add({ - tag: viewTag, - name: viewName, - shadowNodeWrapper, - }); - if (isJest()) { - /** - * We need to connect Jest's TestObject instance whose contains just props object - * with the updateProps() function where we update the properties of the component. - * We can't update props object directly because TestObject contains a copy of props - look at render function: - * const props = this._filterNonAnimatedProps(this.props); - */ - this.animatedStyle.value = { - ...this.animatedStyle.value, - ...style.initial.value, - }; - style.animatedStyle.current = this.animatedStyle; - } - }); - - // detach old animatedProps - if ( - prevAnimatedProps && - !isSameAnimatedProps(prevAnimatedProps, this.props.animatedProps) - ) { - prevAnimatedProps.viewDescriptors!.remove(viewTag as number); - } - - // attach animatedProps property - if (this.props.animatedProps?.viewDescriptors) { - this.props.animatedProps.viewDescriptors.add({ - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - tag: viewTag as number, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - name: viewName!, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - shadowNodeWrapper: shadowNodeWrapper!, - }); - } - } - - componentDidUpdate( - prevProps: AnimatedComponentProps, - _prevState: Readonly, - // This type comes straight from React - // eslint-disable-next-line @typescript-eslint/no-explicit-any - snapshot: DOMRect | null - ) { - this._reattachNativeEvents(prevProps); - this._attachAnimatedStyles(); - this._InlinePropManager.attachInlineProps(this, this._getViewInfo()); - - // Snapshot won't be undefined because it comes from getSnapshotBeforeUpdate method - if ( - IS_WEB && - snapshot !== null && - this.props.layout && - !getReducedMotionFromConfig(this.props.layout as CustomConfig) - ) { - tryActivateLayoutTransition( - this.props, - this._component as HTMLElement, - snapshot - ); - } - } - - _setComponentRef = setAndForwardRef({ - getForwardedRef: () => - this.props.forwardedRef as MutableRefObject< - Component, Record, unknown> - >, - setLocalRef: (ref) => { - // TODO update config - - const tag = IS_WEB - ? (ref as HTMLElement) - : findNodeHandle(ref as Component); - - const { layout, entering, exiting, sharedTransitionTag } = this.props; - if ( - (layout || entering || exiting || sharedTransitionTag) && - tag != null - ) { - if (!shouldBeUseWeb()) { - enableLayoutAnimations(true, false); - } - if (layout) { - configureLayoutAnimations( - tag, - LayoutAnimationType.LAYOUT, - maybeBuild( - layout, - undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */, - AnimatedComponent.displayName - ) - ); - } - const skipEntering = this.context?.current; - if (entering && !skipEntering) { - configureLayoutAnimations( - tag, - LayoutAnimationType.ENTERING, - maybeBuild( - entering, - this.props?.style, - AnimatedComponent.displayName - ) - ); - } - if (exiting) { - const reduceMotionInExiting = - 'getReduceMotion' in exiting && - typeof exiting.getReduceMotion === 'function' - ? getReduceMotionFromConfig(exiting.getReduceMotion()) - : getReduceMotionFromConfig(); - if (!reduceMotionInExiting) { - configureLayoutAnimations( - tag, - LayoutAnimationType.EXITING, - maybeBuild( - exiting, - this.props?.style, - AnimatedComponent.displayName - ) - ); - } - } - if (sharedTransitionTag && !IS_WEB) { - const sharedElementTransition = - this.props.sharedTransitionStyle ?? new SharedTransition(); - const reduceMotionInTransition = getReduceMotionFromConfig( - sharedElementTransition.getReduceMotion() - ); - if (!reduceMotionInTransition) { - sharedElementTransition.registerTransition( - tag as number, - sharedTransitionTag - ); - this._sharedElementTransition = sharedElementTransition; - } - } - } - - if (ref !== this._component) { - this._component = ref; - } - }, - }); - - // This is a component lifecycle method from React, therefore we are not calling it directly. - // It is called before the component gets rerendered. This way we can access components' position before it changed - // and later on, in componentDidUpdate, calculate translation for layout transition. - getSnapshotBeforeUpdate() { - if ( - (this._component as HTMLElement).getBoundingClientRect !== undefined - ) { - return (this._component as HTMLElement).getBoundingClientRect(); - } - - return null; - } - - render() { - const props = this._PropsFilter.filterNonAnimatedProps(this); - - if (isJest()) { - props.animatedStyle = this.animatedStyle; - } - - // Layout animations on web are set inside `componentDidMount` method, which is called after first render. - // Because of that we can encounter a situation in which component is visible for a short amount of time, and later on animation triggers. - // I've tested that on various browsers and devices and it did not happen to me. To be sure that it won't happen to someone else, - // I've decided to hide component at first render. Its visibility is reset in `componentDidMount`. - if ( - this._isFirstRender && - IS_WEB && - props.entering && - !getReducedMotionFromConfig(props.entering as CustomConfig) - ) { - props.style = { - ...(props.style ?? {}), - visibility: 'hidden', // Hide component until `componentDidMount` triggers - }; - } - - const platformProps = Platform.select({ - web: {}, - default: { collapsable: false }, - }); - - return ( - void} - {...platformProps} - /> - ); + // User can override component-defined jsProps via options + const jsProps = options?.jsProps ?? Component.jsProps; + const modifiedOptions = jsProps?.length + ? { ...options, jsProps } + : options; + super(Component, props, AnimatedComponent.displayName, modifiedOptions); } } - AnimatedComponent.displayName = `AnimatedComponent(${ - Component.displayName || Component.name || 'Component' - })`; - - return React.forwardRef((props, ref) => { + const animatedComponent = ( + props: AnimatedComponentProps & { ref: Ref } + ) => { return ( ); - }); + }; + + animatedComponent.displayName = + Component.displayName || Component.name || 'Component'; + + return animatedComponent; } diff --git a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/utils.ts b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/utils.ts index 9b66e32c..feb44ab5 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/utils.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/createAnimatedComponent/utils.ts @@ -1,4 +1,6 @@ 'use strict'; +import type { StyleProps } from '../commonTypes'; +import type { CSSStyle } from '../css'; import type { NestedArray } from './commonTypes'; export function flattenArray(array: NestedArray): T[] { @@ -23,7 +25,7 @@ export function flattenArray(array: NestedArray): T[] { export const has = ( key: K, x: unknown -): x is typeof x & { [key in K]: unknown } => { +): x is { [key in K]: unknown } => { if (typeof x === 'function' || typeof x === 'object') { if (x === null || x === undefined) { return false; @@ -33,3 +35,26 @@ export const has = ( } return false; }; + +type FilteredStyles = { + cssStyle: CSSStyle | null; + animatedStyles: StyleProps[]; +}; + +export function filterStyles(styles: StyleProps[] | undefined): FilteredStyles { + if (!styles) { + return { animatedStyles: [], cssStyle: null }; + } + + return styles.reduce( + ({ animatedStyles, cssStyle }, style) => { + if (style?.viewDescriptors) { + animatedStyles.push(style); + } else { + cssStyle = { ...cssStyle, ...style } as CSSStyle; + } + return { animatedStyles, cssStyle }; + }, + { animatedStyles: [], cssStyle: null } + ); +} diff --git a/frontend-admin/node_modules/react-native-reanimated/src/index.ts b/frontend-admin/node_modules/react-native-reanimated/src/index.ts index c4778d0c..33ea9265 100644 --- a/frontend-admin/node_modules/react-native-reanimated/src/index.ts +++ b/frontend-admin/node_modules/react-native-reanimated/src/index.ts @@ -1,5 +1,300 @@ 'use strict'; + +import './publicGlobals'; + +import { initializeReanimatedModule } from './initializers'; +import { ReanimatedModule } from './ReanimatedModule'; + +// TODO: Specify the initialization pipeline since now there's no +// universal source of truth for it. +initializeReanimatedModule(ReanimatedModule); + +// eslint-disable-next-line import/first import * as Animated from './Animated'; -export * from './reanimated2'; export default Animated; + +export { createAnimatedComponent } from './Animated'; +export type { + DecayAnimation, + DelayAnimation, + RepeatAnimation, + SequenceAnimation, + SpringAnimation, + StyleLayoutAnimation, + TimingAnimation, + WithDecayConfig, + WithSpringConfig, + WithTimingConfig, +} from './animation'; +export { + cancelAnimation, + defineAnimation, + GentleSpringConfig, + GentleSpringConfigWithDuration, + Reanimated3DefaultSpringConfig, + Reanimated3DefaultSpringConfigWithDuration, + SnappySpringConfig, + SnappySpringConfigWithDuration, + WigglySpringConfig, + WigglySpringConfigWithDuration, + withClamp, + withDecay, + withDelay, + withRepeat, + withSequence, + withSpring, + withTiming, +} from './animation'; +export type { ParsedColorArray } from './Colors'; +export { convertToRGBA, isColor } from './Colors'; +export { processColor, ReanimatedLogLevel } from './common'; +export type { + AnimatableValue, + AnimatableValueObject, + AnimatedKeyboardInfo, + AnimatedKeyboardOptions, + AnimatedSensor, + AnimatedStyle, + AnimatedTransform, + Animation, + AnimationCallback, + AnimationObject, + BaseLayoutAnimationConfig, + EasingFunction, + EntryAnimationsValues, + EntryExitAnimationFunction, + ExitAnimationsValues, + IEntryExitAnimationBuilder, + ILayoutAnimationBuilder, + KeyframeProps, + LayoutAnimation, + LayoutAnimationFunction, + LayoutAnimationStartFunction, + LayoutAnimationValues as LayoutAnimationsValues, + LayoutAnimationType, + MeasuredDimensions, + SensorConfig, + SharedValue, + StyleProps, + TransformArrayItem, + Value3D, + ValueRotation, +} from './commonTypes'; +export { + InterfaceOrientation, + IOSReferenceFrame, + KeyboardState, + ReduceMotion, + SensorType, +} from './commonTypes'; +export type { FlatListPropsWithLayout } from './component/FlatList'; +export { LayoutAnimationConfig } from './component/LayoutAnimationConfig'; +export type { PerformanceMonitorProps } from './component/PerformanceMonitor'; +export { PerformanceMonitor } from './component/PerformanceMonitor'; +export { ReducedMotionConfig } from './component/ReducedMotionConfig'; +export type { AnimatedScrollViewProps } from './component/ScrollView'; +export { configureReanimatedLogger } from './ConfigHelper'; +export { + enableLayoutAnimations, + getViewProp, + isConfigured, + isReanimated3, + makeMutable, +} from './core'; +export * from './css'; +export type { EasingFunctionFactory } from './Easing'; +export { Easing } from './Easing'; +export { getStaticFeatureFlag, setDynamicFeatureFlag } from './featureFlags'; +export type { FrameInfo } from './frameCallback'; +export type { AnimatedProps, EntryOrExitLayoutType } from './helperTypes'; +export type { + AnimatedRef, + DerivedValue, + EventHandler, + EventHandlerProcessed, + FrameCallback, + ReanimatedEvent, + ScrollEvent, + ScrollHandler, + ScrollHandlerProcessed, + ScrollHandlers, + UseHandlerContext, +} from './hook'; +export { + useAnimatedKeyboard, + useAnimatedProps, + useAnimatedReaction, + useAnimatedRef, + useAnimatedScrollHandler, + useAnimatedSensor, + useAnimatedStyle, + useComposedEventHandler, + useDerivedValue, + useEvent, + useFrameCallback, + useHandler, + useReducedMotion, + useScrollOffset, + /** @deprecated Please use {@link useScrollOffset} instead. */ + useScrollOffset as useScrollViewOffset, + useSharedValue, +} from './hook'; +export type { + InterpolateConfig, + InterpolateHSV, + InterpolateRGB, + InterpolationOptions, +} from './interpolateColor'; +export { + ColorSpace, + /** @deprecated Please use {@link Extrapolation} instead. */ + Extrapolate, + interpolateColor, + useInterpolateConfig, +} from './interpolateColor'; +export type { ExtrapolationConfig, ExtrapolationType } from './interpolation'; +export { clamp, Extrapolation, interpolate } from './interpolation'; +export { isSharedValue } from './isSharedValue'; +export { + advanceAnimationByFrame, + advanceAnimationByTime, + getAnimatedStyle, + setUpTests, + withReanimatedTimer, +} from './jestUtils'; +export type { ReanimatedKeyframe } from './layoutReanimation'; +export { + BaseAnimationBuilder, + // Bounce + BounceIn, + BounceInDown, + BounceInLeft, + BounceInRight, + BounceInUp, + BounceOut, + BounceOutDown, + BounceOutLeft, + BounceOutRight, + BounceOutUp, + ComplexAnimationBuilder, + CurvedTransition, + EntryExitTransition, + // Fade + FadeIn, + FadeInDown, + FadeInLeft, + FadeInRight, + FadeInUp, + FadeOut, + FadeOutDown, + FadeOutLeft, + FadeOutRight, + FadeOutUp, + FadingTransition, + FlipInEasyX, + FlipInEasyY, + FlipInXDown, + // Flip + FlipInXUp, + FlipInYLeft, + FlipInYRight, + FlipOutEasyX, + FlipOutEasyY, + FlipOutXDown, + FlipOutXUp, + FlipOutYLeft, + FlipOutYRight, + JumpingTransition, + Keyframe, + // Transitions + Layout, + LightSpeedInLeft, + // Lightspeed + LightSpeedInRight, + LightSpeedOutLeft, + LightSpeedOutRight, + LinearTransition, + // Pinwheel + PinwheelIn, + PinwheelOut, + // Roll + RollInLeft, + RollInRight, + RollOutLeft, + RollOutRight, + // Rotate + RotateInDownLeft, + RotateInDownRight, + RotateInUpLeft, + RotateInUpRight, + RotateOutDownLeft, + RotateOutDownRight, + RotateOutUpLeft, + RotateOutUpRight, + SequencedTransition, + SlideInDown, + SlideInLeft, + // Slide + SlideInRight, + SlideInUp, + SlideOutDown, + SlideOutLeft, + SlideOutRight, + SlideOutUp, + // Stretch + StretchInX, + StretchInY, + StretchOutX, + StretchOutY, + // Zoom + ZoomIn, + ZoomInDown, + ZoomInEasyDown, + ZoomInEasyUp, + ZoomInLeft, + ZoomInRight, + ZoomInRotate, + ZoomInUp, + ZoomOut, + ZoomOutDown, + ZoomOutEasyDown, + ZoomOutEasyUp, + ZoomOutLeft, + ZoomOutRight, + ZoomOutRotate, + ZoomOutUp, +} from './layoutReanimation'; +export { startMapper, stopMapper } from './mappers'; +export { jsVersion as reanimatedVersion } from './platform-specific/jsVersion'; +export type { ComponentCoords } from './platformFunctions'; +export { + dispatchCommand, + getRelativeCoords, + measure, + scrollTo, + setGestureState, + setNativeProps, +} from './platformFunctions'; +export { getUseOfValueInStyleWarning } from './pluginUtils'; +export { createAnimatedPropAdapter } from './PropAdapters'; +export type { + AnimatedScreenTransition, + GoBackGesture, + ScreenTransitionConfig, +} from './screenTransition'; +export { + finishScreenTransition, + ScreenTransition, + startScreenTransition, +} from './screenTransition'; +export type { WorkletRuntime } from './workletFunctions'; +export { + createWorkletRuntime, + executeOnUIRuntimeSync, + isWorkletFunction, + makeShareableCloneRecursive, + runOnJS, + runOnRuntime, + runOnUI, +} from './workletFunctions'; diff --git a/frontend-admin/package-lock.json b/frontend-admin/package-lock.json index a7e0da4b..50586946 100644 --- a/frontend-admin/package-lock.json +++ b/frontend-admin/package-lock.json @@ -25,7 +25,7 @@ "react-native": "0.81.5", "react-native-gesture-handler": "~2.28.0", "react-native-maps": "1.20.1", - "react-native-reanimated": "~3.6.0", + "react-native-reanimated": "~4.1.1", "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-web": "^0.21.0", @@ -475,41 +475,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", - "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", - "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", - "peer": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -1053,20 +1018,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-object-assign": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.27.1.tgz", - "integrity": "sha512-LP6tsnirA6iy13uBKiYgjJsfQrodmlSrpZModtlo1Vk8sOO68gfo7dfA9TGJyEgxTiO7czK4EGZm8FJEZtk4kQ==", - "dependencies": { - "@babel/helper-plugin-utils": "^7.27.1" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-transform-object-rest-spread": { "version": "7.28.6", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.28.6.tgz", @@ -6998,24 +6949,29 @@ } }, "node_modules/react-native-reanimated": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-3.6.3.tgz", - "integrity": "sha512-2KkkPozoIvDbJcHuf8qeyoLROXQxizSi+2CTCkuNVkVZOxxY4B0Omvgq61aOQhSZUh/649x1YHoAaTyGMGDJUw==", + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.1.6.tgz", + "integrity": "sha512-F+ZJBYiok/6Jzp1re75F/9aLzkgoQCOh4yxrnwATa8392RvM3kx+fiXXFvwcgE59v48lMwd9q0nzF1oJLXpfxQ==", "dependencies": { - "@babel/plugin-transform-object-assign": "^7.16.7", - "@babel/preset-typescript": "^7.16.7", - "convert-source-map": "^2.0.0", - "invariant": "^2.2.4" + "react-native-is-edge-to-edge": "^1.2.1", + "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0-0", - "@babel/plugin-proposal-optional-chaining": "^7.0.0-0", - "@babel/plugin-transform-arrow-functions": "^7.0.0-0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", - "@babel/plugin-transform-template-literals": "^7.0.0-0", "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-worklets": ">=0.5.0" + } + }, + "node_modules/react-native-reanimated/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/react-native-safe-area-context": { diff --git a/frontend-admin/package.json b/frontend-admin/package.json index fce4cef4..f833be62 100644 --- a/frontend-admin/package.json +++ b/frontend-admin/package.json @@ -26,7 +26,7 @@ "react-native": "0.81.5", "react-native-gesture-handler": "~2.28.0", "react-native-maps": "1.20.1", - "react-native-reanimated": "~3.6.0", + "react-native-reanimated": "~4.1.1", "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-web": "^0.21.0",