Compare commits

...

5 Commits

Author SHA1 Message Date
xmflsct a2721d21c0 Fixed #359 2022-08-10 00:46:43 +02:00
xmflsct dba43e248b Fixed #358 2022-08-09 00:49:50 +02:00
xmflsct 9f17f95a98 Fixed #354 2022-08-09 00:44:56 +02:00
xmflsct a68ed6ea1b Fix menu translations 2022-08-08 23:00:46 +02:00
xmflsct 6b6481f9ac Android builds 2022-08-08 22:32:51 +02:00
22 changed files with 455 additions and 355 deletions

View File

@ -1,7 +1,6 @@
apply plugin: "com.android.application"
import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@ -157,16 +156,12 @@ android {
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
"NODE_MODULES_DIR=$rootDir/../node_modules"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "tooot_appmodules"
// Fix for windows limit on number of character in file paths and in command lines
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
"NDK_APP_SHORT_COMMANDS=true"
}
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
@ -311,8 +306,10 @@ dependencies {
}
if (enableHermes) {
debugImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute().text.trim(), "../android/hermes-debug.aar"))
releaseImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute().text.trim(), "../android/hermes-release.aar"))
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
@ -325,7 +322,11 @@ if (isNewArchitectureEnabled()) {
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}

View File

@ -24,7 +24,8 @@ public class MainActivity extends ReactActivity {
/**
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
* you can specify the rendered you wish to use (Fabric or the older renderer).
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
* (Paper).
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
@ -41,5 +42,12 @@ public class MainActivity extends ReactActivity {
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}
@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}
}

View File

@ -28,9 +28,9 @@ buildscript {
}
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -12,4 +12,6 @@ includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}

View File

@ -71,14 +71,14 @@ PODS:
- EXUpdatesInterface (0.7.0)
- EXVideoThumbnails (6.4.0):
- ExpoModulesCore
- FBLazyVector (0.69.3)
- FBReactNativeSpec (0.69.3):
- FBLazyVector (0.69.4)
- FBReactNativeSpec (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.69.3)
- RCTTypeSafety (= 0.69.3)
- React-Core (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- RCTRequired (= 0.69.4)
- RCTTypeSafety (= 0.69.4)
- React-Core (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- Firebase/Core (8.14.0):
- Firebase/CoreOnly
- FirebaseAnalytics (~> 8.14.0)
@ -257,214 +257,214 @@ PODS:
- fmt (~> 6.2.1)
- glog
- libevent
- RCTRequired (0.69.3)
- RCTTypeSafety (0.69.3):
- FBLazyVector (= 0.69.3)
- RCTRequired (= 0.69.3)
- React-Core (= 0.69.3)
- React (0.69.3):
- React-Core (= 0.69.3)
- React-Core/DevSupport (= 0.69.3)
- React-Core/RCTWebSocket (= 0.69.3)
- React-RCTActionSheet (= 0.69.3)
- React-RCTAnimation (= 0.69.3)
- React-RCTBlob (= 0.69.3)
- React-RCTImage (= 0.69.3)
- React-RCTLinking (= 0.69.3)
- React-RCTNetwork (= 0.69.3)
- React-RCTSettings (= 0.69.3)
- React-RCTText (= 0.69.3)
- React-RCTVibration (= 0.69.3)
- React-bridging (0.69.3):
- RCTRequired (0.69.4)
- RCTTypeSafety (0.69.4):
- FBLazyVector (= 0.69.4)
- RCTRequired (= 0.69.4)
- React-Core (= 0.69.4)
- React (0.69.4):
- React-Core (= 0.69.4)
- React-Core/DevSupport (= 0.69.4)
- React-Core/RCTWebSocket (= 0.69.4)
- React-RCTActionSheet (= 0.69.4)
- React-RCTAnimation (= 0.69.4)
- React-RCTBlob (= 0.69.4)
- React-RCTImage (= 0.69.4)
- React-RCTLinking (= 0.69.4)
- React-RCTNetwork (= 0.69.4)
- React-RCTSettings (= 0.69.4)
- React-RCTText (= 0.69.4)
- React-RCTVibration (= 0.69.4)
- React-bridging (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsi (= 0.69.3)
- React-callinvoker (0.69.3)
- React-Codegen (0.69.3):
- FBReactNativeSpec (= 0.69.3)
- React-jsi (= 0.69.4)
- React-callinvoker (0.69.4)
- React-Codegen (0.69.4):
- FBReactNativeSpec (= 0.69.4)
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired (= 0.69.3)
- RCTTypeSafety (= 0.69.3)
- React-Core (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-Core (0.69.3):
- RCTRequired (= 0.69.4)
- RCTTypeSafety (= 0.69.4)
- React-Core (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-Core (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-Core/Default (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/CoreModulesHeaders (0.69.3):
- React-Core/CoreModulesHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/Default (0.69.3):
- React-Core/Default (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/DevSupport (0.69.3):
- React-Core/DevSupport (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.69.3)
- React-Core/RCTWebSocket (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-jsinspector (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-Core/Default (= 0.69.4)
- React-Core/RCTWebSocket (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-jsinspector (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTActionSheetHeaders (0.69.3):
- React-Core/RCTActionSheetHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTAnimationHeaders (0.69.3):
- React-Core/RCTAnimationHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTBlobHeaders (0.69.3):
- React-Core/RCTBlobHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTImageHeaders (0.69.3):
- React-Core/RCTImageHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTLinkingHeaders (0.69.3):
- React-Core/RCTLinkingHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTNetworkHeaders (0.69.3):
- React-Core/RCTNetworkHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTSettingsHeaders (0.69.3):
- React-Core/RCTSettingsHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTTextHeaders (0.69.3):
- React-Core/RCTTextHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTVibrationHeaders (0.69.3):
- React-Core/RCTVibrationHeaders (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-Core/RCTWebSocket (0.69.3):
- React-Core/RCTWebSocket (0.69.4):
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-Core/Default (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-Core/Default (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-perflogger (= 0.69.4)
- Yoga
- React-CoreModules (0.69.3):
- React-CoreModules (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.69.3)
- React-Codegen (= 0.69.3)
- React-Core/CoreModulesHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- React-RCTImage (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-cxxreact (0.69.3):
- RCTTypeSafety (= 0.69.4)
- React-Codegen (= 0.69.4)
- React-Core/CoreModulesHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- React-RCTImage (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-cxxreact (0.69.4):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-callinvoker (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsinspector (= 0.69.3)
- React-logger (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-runtimeexecutor (= 0.69.3)
- React-hermes (0.69.3):
- React-callinvoker (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsinspector (= 0.69.4)
- React-logger (= 0.69.4)
- React-perflogger (= 0.69.4)
- React-runtimeexecutor (= 0.69.4)
- React-hermes (0.69.4):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2021.06.28.00-v2)
- RCT-Folly/Futures (= 2021.06.28.00-v2)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-jsiexecutor (= 0.69.3)
- React-jsinspector (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-jsi (0.69.3):
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-jsiexecutor (= 0.69.4)
- React-jsinspector (= 0.69.4)
- React-perflogger (= 0.69.4)
- React-jsi (0.69.4):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsi/Default (= 0.69.3)
- React-jsi/Default (0.69.3):
- React-jsi/Default (= 0.69.4)
- React-jsi/Default (0.69.4):
- boost (= 1.76.0)
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-jsiexecutor (0.69.3):
- React-jsiexecutor (0.69.4):
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-perflogger (= 0.69.3)
- React-jsinspector (0.69.3)
- React-logger (0.69.3):
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-perflogger (= 0.69.4)
- React-jsinspector (0.69.4)
- React-logger (0.69.4):
- glog
- react-native-blur (4.2.0):
- React-Core
@ -474,7 +474,7 @@ PODS:
- React-Core
- react-native-context-menu-view (1.5.4):
- React
- react-native-image-picker (4.8.4):
- react-native-image-picker (4.8.5):
- React-Core
- react-native-language-detection (0.1.0):
- React
@ -493,104 +493,106 @@ PODS:
- ReactCommon/turbomodule/core
- react-native-segmented-control (2.2.2):
- React-Core
- React-perflogger (0.69.3)
- React-RCTActionSheet (0.69.3):
- React-Core/RCTActionSheetHeaders (= 0.69.3)
- React-RCTAnimation (0.69.3):
- React-perflogger (0.69.4)
- React-RCTActionSheet (0.69.4):
- React-Core/RCTActionSheetHeaders (= 0.69.4)
- React-RCTAnimation (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.69.3)
- React-Codegen (= 0.69.3)
- React-Core/RCTAnimationHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTBlob (0.69.3):
- RCTTypeSafety (= 0.69.4)
- React-Codegen (= 0.69.4)
- React-Core/RCTAnimationHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTBlob (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- React-Codegen (= 0.69.3)
- React-Core/RCTBlobHeaders (= 0.69.3)
- React-Core/RCTWebSocket (= 0.69.3)
- React-jsi (= 0.69.3)
- React-RCTNetwork (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTImage (0.69.3):
- React-Codegen (= 0.69.4)
- React-Core/RCTBlobHeaders (= 0.69.4)
- React-Core/RCTWebSocket (= 0.69.4)
- React-jsi (= 0.69.4)
- React-RCTNetwork (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTImage (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.69.3)
- React-Codegen (= 0.69.3)
- React-Core/RCTImageHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- React-RCTNetwork (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTLinking (0.69.3):
- React-Codegen (= 0.69.3)
- React-Core/RCTLinkingHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTNetwork (0.69.3):
- RCTTypeSafety (= 0.69.4)
- React-Codegen (= 0.69.4)
- React-Core/RCTImageHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- React-RCTNetwork (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTLinking (0.69.4):
- React-Codegen (= 0.69.4)
- React-Core/RCTLinkingHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTNetwork (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.69.3)
- React-Codegen (= 0.69.3)
- React-Core/RCTNetworkHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTSettings (0.69.3):
- RCTTypeSafety (= 0.69.4)
- React-Codegen (= 0.69.4)
- React-Core/RCTNetworkHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTSettings (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTTypeSafety (= 0.69.3)
- React-Codegen (= 0.69.3)
- React-Core/RCTSettingsHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-RCTText (0.69.3):
- React-Core/RCTTextHeaders (= 0.69.3)
- React-RCTVibration (0.69.3):
- RCTTypeSafety (= 0.69.4)
- React-Codegen (= 0.69.4)
- React-Core/RCTSettingsHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-RCTText (0.69.4):
- React-Core/RCTTextHeaders (= 0.69.4)
- React-RCTVibration (0.69.4):
- RCT-Folly (= 2021.06.28.00-v2)
- React-Codegen (= 0.69.3)
- React-Core/RCTVibrationHeaders (= 0.69.3)
- React-jsi (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- React-runtimeexecutor (0.69.3):
- React-jsi (= 0.69.3)
- ReactCommon (0.69.3):
- React-logger (= 0.69.3)
- ReactCommon/react_debug_core (= 0.69.3)
- ReactCommon/turbomodule (= 0.69.3)
- ReactCommon/react_debug_core (0.69.3):
- React-logger (= 0.69.3)
- ReactCommon/turbomodule (0.69.3):
- React-Codegen (= 0.69.4)
- React-Core/RCTVibrationHeaders (= 0.69.4)
- React-jsi (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- React-runtimeexecutor (0.69.4):
- React-jsi (= 0.69.4)
- ReactCommon (0.69.4):
- React-logger (= 0.69.4)
- ReactCommon/react_debug_core (= 0.69.4)
- ReactCommon/turbomodule (= 0.69.4)
- ReactCommon/react_debug_core (0.69.4):
- React-logger (= 0.69.4)
- ReactCommon/turbomodule (0.69.4):
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-bridging (= 0.69.3)
- React-callinvoker (= 0.69.3)
- React-Core (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-logger (= 0.69.3)
- React-perflogger (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- ReactCommon/turbomodule/samples (= 0.69.3)
- ReactCommon/turbomodule/core (0.69.3):
- React-bridging (= 0.69.4)
- React-callinvoker (= 0.69.4)
- React-Core (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-logger (= 0.69.4)
- React-perflogger (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- ReactCommon/turbomodule/samples (= 0.69.4)
- ReactCommon/turbomodule/core (0.69.4):
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-bridging (= 0.69.3)
- React-callinvoker (= 0.69.3)
- React-Core (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-logger (= 0.69.3)
- React-perflogger (= 0.69.3)
- ReactCommon/turbomodule/samples (0.69.3):
- React-bridging (= 0.69.4)
- React-callinvoker (= 0.69.4)
- React-Core (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-logger (= 0.69.4)
- React-perflogger (= 0.69.4)
- ReactCommon/turbomodule/samples (0.69.4):
- DoubleConversion
- glog
- RCT-Folly (= 2021.06.28.00-v2)
- React-bridging (= 0.69.3)
- React-callinvoker (= 0.69.3)
- React-Core (= 0.69.3)
- React-cxxreact (= 0.69.3)
- React-jsi (= 0.69.3)
- React-logger (= 0.69.3)
- React-perflogger (= 0.69.3)
- ReactCommon/turbomodule/core (= 0.69.3)
- RNCAsyncStorage (1.17.7):
- React-bridging (= 0.69.4)
- React-callinvoker (= 0.69.4)
- React-Core (= 0.69.4)
- React-cxxreact (= 0.69.4)
- React-jsi (= 0.69.4)
- React-logger (= 0.69.4)
- React-perflogger (= 0.69.4)
- ReactCommon/turbomodule/core (= 0.69.4)
- RNCAsyncStorage (1.17.8):
- React-Core
- RNCClipboard (1.10.0):
- React-Core
- RNFastImage (8.5.11):
- React-Core
@ -750,6 +752,7 @@ DEPENDENCIES:
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
- "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)"
- RNFastImage (from `../node_modules/react-native-fast-image`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
@ -942,6 +945,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon"
RNCAsyncStorage:
:path: "../node_modules/@react-native-async-storage/async-storage"
RNCClipboard:
:path: "../node_modules/@react-native-clipboard/clipboard"
RNFastImage:
:path: "../node_modules/react-native-fast-image"
RNGestureHandler:
@ -993,8 +998,8 @@ SPEC CHECKSUMS:
EXUpdates: 0d639074a69862e121706c0d4203a700ecfcc22d
EXUpdatesInterface: 2bbc11815dfa2ec3fc02e5534c7592c6b42b5327
EXVideoThumbnails: 486533e1a66c9859f9b9e3b2e1f9f0b275515b48
FBLazyVector: 1d83d91816fa605d16227a83f1b2e71c8df09d22
FBReactNativeSpec: 626e35e73f83c637ff166f906d584f4c6750c251
FBLazyVector: c71b8c429a8af2aff1013934a7152e9d9d0c937d
FBReactNativeSpec: cb0df4f0084281b394f76bb9b4d1d9540f35963f
Firebase: 7e8fe528c161b9271d365217a74c16aaf834578e
FirebaseAnalytics: 2fc3876e2eb347673ad2f35e249ae7b15d6c88f5
FirebaseCore: b84a44ee7ba999e0f9f76d198a9c7f60a797b848
@ -1021,44 +1026,45 @@ SPEC CHECKSUMS:
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
RCTRequired: 66822c147facf02f7774af99825e0a31e39df42e
RCTTypeSafety: 309306c4e711b14a83c55c2816a6cc490ec19827
React: a779632422a918b26db4f1b57225a41c14d20525
React-bridging: 96055aa45f0417898d7833e251f4ae79d28acef7
React-callinvoker: 02df4d620df286381ff3f99180fb24feceaf01cc
React-Codegen: 06613a5e753c3af2dca0d6e7dd02944a3d77c3f6
React-Core: 638d54d64048aa635e7c583fb0d8425206f446b4
React-CoreModules: f706ec2a1939387517cadc6ce0d2ef0f20fccb53
React-cxxreact: ec183b7f6fec01e7167f38c1c64a03f68dca7fb2
React-hermes: a97962948f74aaefffd4fe00bdafafbc245b08af
React-jsi: ed7dc77f5193dca9c73cec90bfec409e7ddfe401
React-jsiexecutor: 1842ca163b160aeb224d2c65b2a60c393b273c67
React-jsinspector: bb2605f98aada5d81f3494690da3ef3b4ff3b716
React-logger: 23a50ef4c18bf9adbb51e2c979318e6b3a2e44a1
RCTRequired: bd9d2ab0fda10171fcbcf9ba61a7df4dc15a28f4
RCTTypeSafety: e44e139bf6ec8042db396201834fc2372f6a21cd
React: 482cd1ba23c471be1aed3800180be2427418d7be
React-bridging: c2ea4fed6fe4ed27c12fd71e88b5d5d3da107fde
React-callinvoker: d4d1f98163fb5e35545e910415ef6c04796bb188
React-Codegen: ff35fb9c7f6ec2ed34fb6de2e1099d88dfb25f2f
React-Core: 4d3443a45b67c71d74d7243ddde9569d1e4f4fad
React-CoreModules: 70be25399366b5632ab18ecf6fe444a8165a7bea
React-cxxreact: 822d3794fc0bf206f4691592f90e086dd4f92228
React-hermes: 7f67b8363288258c3b0cd4aef5975cb7f0b9549a
React-jsi: ffa51cbc9a78cc156cf61f79ed52ecb76dc6013b
React-jsiexecutor: a27badbbdbc0ff781813370736a2d1c7261181d4
React-jsinspector: 8a3d3f5dcd23a91e8c80b1bf0e96902cd1dca999
React-logger: 1088859f145b8f6dd0d3ed051a647ef0e3e80fad
react-native-blur: 3e9c8e8e9f7d17fa1b94e1a0ae9fd816675f5382
react-native-blurhash: add4df9a937b4e021a24bc67a0714f13e0bd40b7
react-native-cameraroll: 2957f2bce63ae896a848fbe0d5352c1bd4d20866
react-native-context-menu-view: b0beca02aad4bd9f9d7d932bf437e0a03baa69ef
react-native-image-picker: cffb727cf2f59bd5c0408e30b3dbe0b935f88835
react-native-image-picker: cd420f97f6ed6ff74fc4686d27dbcfdbd051db91
react-native-language-detection: 0e43195ad014974f1b7a31b64820eff34a243f2d
react-native-netinfo: 129bd99f607a2dc5bb096168f3e5c150fd1f1c95
react-native-pager-view: da490aa1f902c9a5aeecf0909cc975ad0e92e53e
react-native-paste-input: 3037f113267c367e863790bcfd57cdb3ace3cad6
react-native-safe-area-context: 6c12e3859b6f27b25de4fee8201cfb858432d8de
react-native-segmented-control: 65df6cd0619b780b3843d574a72d4c7cec396097
React-perflogger: 39d2ba8cbcac54d1bb1d9a980dab348e96aef467
React-RCTActionSheet: b1ad907a2c8f8e4d037148ca507b7f2d6ab1c66d
React-RCTAnimation: 914a9ba46fb6e7376f7709c7ce825d53b47ca2ee
React-RCTBlob: de62fd5edc5c36951f0b113bf252eb43b7131f79
React-RCTImage: aa0749a8d748b34942c7e71ac5d9f42be8b70cf3
React-RCTLinking: 595a9f8fbf4d6634bff28d1175b3523b61466612
React-RCTNetwork: 0559fd0fccb01f89c638baa43c8d185dc8008626
React-RCTSettings: 8e492a25a62f1ef6323f82ce652ae87fa59c82ca
React-RCTText: 17457cde6ef8832ba43c886baebb6627c5d7ed18
React-RCTVibration: dd8099eb46e9cee4692934bc8cbe5e9a4f5e8d31
React-runtimeexecutor: 607eb048e22a16388c908ee1f6644200e8d1e19b
ReactCommon: af7636436b382db7cde4583bbd642f0978e6e3ed
RNCAsyncStorage: d81ee5c3db1060afd49ea7045ad460eff82d2b7d
React-perflogger: cb386fd44c97ec7f8199c04c12b22066b0f2e1e0
React-RCTActionSheet: f803a85e46cf5b4066c2ac5e122447f918e9c6e5
React-RCTAnimation: 19c80fa950ccce7f4db76a2a7f2cf79baae07fc7
React-RCTBlob: f36ab97e2d515c36df14a1571e50056be80413d5
React-RCTImage: 2c8f0a329a116248e82f8972ffe806e47c6d1cfa
React-RCTLinking: 670f0223075aff33be3b89714f1da4f5343fc4af
React-RCTNetwork: 09385b73f4ff1f46bd5d749540fb33f69a7e5908
React-RCTSettings: 33b12d3ac7a1f2eba069ec7bd1b84345263b3bbe
React-RCTText: a1a3ea902403bd9ae4cf6f7960551dc1d25711b5
React-RCTVibration: 9adb4a3cbb598d1bbd46a05256f445e4b8c70603
React-runtimeexecutor: 61ee22a8cdf8b6bb2a7fb7b4ba2cc763e5285196
ReactCommon: 8f67bd7e0a6afade0f20718f859dc8c2275f2e83
RNCAsyncStorage: 7cbd0d823dbb0e415d40a7e77fea2292483c8bdb
RNCClipboard: f1736c75ab85b627a4d57587edb4b60999c4dd80
RNFastImage: 8e9b5b9e6df94d2e359c0a75a4745ad1311506fd
RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50
RNReanimated: 2cf7451318bb9cc430abeec8d67693f9cf4e039c
@ -1071,7 +1077,7 @@ SPEC CHECKSUMS:
Sentry: 30b51086ca9aac23337880152e95538f7e177f7f
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
Swime: d7b2c277503b6cea317774aedc2dce05613f8b0b
Yoga: 44c64131616253fa83366295acdbce3d14926041
Yoga: ff994563b2fd98c982ca58e8cd9db2cdaf4dda74
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
PODFILE CHECKSUM: a2f2cbb9af4b081ba2a1ca88de325713cfa64ec5

View File

@ -3,7 +3,7 @@
"versions": {
"native": "220806",
"major": 4,
"minor": 3,
"minor": 2,
"patch": 0,
"expo": "46.0.0"
},
@ -34,7 +34,8 @@
"@formatjs/intl-relativetimeformat": "^11.0.3",
"@mattermost/react-native-paste-input": "^0.5.0",
"@neverdull-agency/expo-unlimited-secure-store": "^1.0.10",
"@react-native-async-storage/async-storage": "^1.17.7",
"@react-native-async-storage/async-storage": "^1.17.8",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/blur": "^4.2.0",
"@react-native-community/cameraroll": "^4.1.2",
"@react-native-community/netinfo": "^9.3.0",
@ -67,14 +68,14 @@
"expo-updates": "^0.14.3",
"expo-video-thumbnails": "^6.4.0",
"expo-web-browser": "^11.0.0",
"i18next": "^21.8.16",
"i18next": "^21.9.0",
"li": "^1.3.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-i18next": "^11.18.3",
"react-intl": "^6.0.5",
"react-native": "^0.69.3",
"react-native": "^0.69.4",
"react-native-animated-spinkit": "^1.5.2",
"react-native-base64": "^0.2.1",
"react-native-blurhash": "^1.1.10",
@ -84,7 +85,7 @@
"react-native-flash-message": "^0.3.1",
"react-native-gesture-handler": "^2.5.0",
"react-native-htmlview": "^0.16.0",
"react-native-image-picker": "^4.8.4",
"react-native-image-picker": "^4.8.5",
"react-native-language-detection": "^0.1.0",
"react-native-pager-view": "^5.4.25",
"react-native-reanimated": "^2.9.1",
@ -109,7 +110,7 @@
"@babel/preset-typescript": "^7.18.6",
"@expo/config": "^7.0.0",
"@types/lodash": "^4.14.182",
"@types/react": "^18.0.15",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@types/react-native": "^0.69.5",
"@types/react-native-base64": "^0.2.0",

View File

@ -41,8 +41,8 @@ const contextMenuAccount = ({
type: 'success',
message: t('common:message.success.message', {
function: t(`account.${theParams.payload.property}.action`, {
...(typeof theParams.payload.currentValue === 'boolean' && {
context: theParams.payload.currentValue.toString()
...(theParams.payload.property !== 'reports' && {
context: (theParams.payload.currentValue || false).toString()
})
})
})
@ -55,8 +55,8 @@ const contextMenuAccount = ({
type: 'error',
message: t('common:message.error.message', {
function: t(`account.${theParams.payload.property}.action`, {
...(typeof theParams.payload.currentValue === 'boolean' && {
context: theParams.payload.currentValue.toString()
...(theParams.payload.property !== 'reports' && {
context: (theParams.payload.currentValue || false).toString()
})
})
}),

View File

@ -1,15 +1,23 @@
import analytics from '@components/analytics'
import { displayMessage } from '@components/Message'
import Clipboard from '@react-native-clipboard/clipboard'
import { useTheme } from '@utils/styles/ThemeManager'
import { useTranslation } from 'react-i18next'
import { Platform, Share } from 'react-native'
import { ContextMenuAction } from 'react-native-context-menu-view'
export interface Props {
copiableContent?: React.MutableRefObject<{
content?: string | undefined
complete: boolean
}>
actions: ContextMenuAction[]
type: 'status' | 'account'
url: string
}
const contextMenuShare = ({ actions, type, url }: Props) => {
const contextMenuShare = ({ copiableContent, actions, type, url }: Props) => {
const { theme } = useTheme()
const { t } = useTranslation('componentContextMenu')
actions.push({
@ -17,8 +25,24 @@ const contextMenuShare = ({ actions, type, url }: Props) => {
title: t(`share.${type}.action`),
systemIcon: 'square.and.arrow.up'
})
Platform.OS !== 'android' &&
actions.push({
id: 'copy',
title: t(`copy.action`),
systemIcon: 'doc.on.doc',
disabled: !copiableContent?.current.content?.length
})
return (index: number) => {
if (actions[index].id === 'copy') {
analytics('timeline_shared_headeractions_copy_press')
Clipboard.setString(copiableContent?.current.content || '')
displayMessage({
theme,
type: 'success',
message: t(`copy.succeed`)
})
}
if (actions[index].id === 'share') {
analytics('timeline_shared_headeractions_share_press')
switch (Platform.OS) {

View File

@ -249,37 +249,23 @@ const ParseHTML = React.memo(
({ children }: any) => {
const { t } = useTranslation('componentParse')
const [expandAllow, setExpandAllow] = useState(false)
const [totalLines, setTotalLines] = useState<number>()
const [expanded, setExpanded] = useState(highlighted)
return (
<View style={{ overflow: 'hidden' }}>
<CustomText
children={children}
onTextLayout={({ nativeEvent }) => {
if (
numberOfLines === 1 ||
nativeEvent.lines.length >= numberOfLines + 5
) {
setExpandAllow(true)
}
}}
numberOfLines={
expandAllow ? (expanded ? 999 : numberOfLines) : undefined
}
selectable={selectable}
/>
{expandAllow ? (
{typeof totalLines === 'number' ? (
<Pressable
accessibilityLabel=''
accessibilityLabel={t('HTML.accessibilityHint')}
onPress={() => {
analytics('status_readmore', { allow: expandAllow, expanded })
analytics('status_readmore', { totalLines, expanded })
layoutAnimation()
setExpanded(!expanded)
}}
style={{
flexDirection: 'row',
justifyContent: 'center',
marginTop: expanded ? 0 : -adaptedLineheight,
alignItems: 'center',
minHeight: 44,
backgroundColor: colors.backgroundDefault
}}
@ -288,14 +274,47 @@ const ParseHTML = React.memo(
style={{
textAlign: 'center',
...StyleConstants.FontStyle.S,
color: colors.primaryDefault
color: colors.primaryDefault,
marginRight: StyleConstants.Spacing.S
}}
children={t(`HTML.expanded.${expanded.toString()}`, {
hint: expandHint
hint: expandHint,
totalLines:
numberOfLines > 1 && typeof totalLines === 'number'
? t('HTML.totalLines', { count: totalLines })
: ''
})}
/>
<Icon
name={expanded ? 'Minimize2' : 'Maximize2'}
color={colors.primaryDefault}
strokeWidth={2}
size={StyleConstants.Font.Size[size]}
/>
</Pressable>
) : null}
<CustomText
children={children}
onTextLayout={({ nativeEvent }) => {
if (
numberOfLines === 1 ||
nativeEvent.lines.length >= numberOfLines + 5
) {
setTotalLines(nativeEvent.lines.length)
}
}}
style={{
height: numberOfLines === 1 && !expanded ? 0 : undefined
}}
numberOfLines={
typeof totalLines === 'number'
? expanded
? 999
: numberOfLines
: undefined
}
selectable={selectable}
/>
</View>
)
},

View File

@ -5,6 +5,7 @@ import TimelineAttachment from '@components/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timeline/Shared/Card'
import TimelineContent from '@components/Timeline/Shared/Content'
// @ts-ignore
import TimelineHeaderDefault from '@components/Timeline/Shared/HeaderDefault'
import TimelinePoll from '@components/Timeline/Shared/Poll'
import { useNavigation } from '@react-navigation/native'
@ -15,7 +16,7 @@ import { getInstanceAccount } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import { uniqBy } from 'lodash'
import React, { useCallback } from 'react'
import React, { useCallback, useEffect, useRef } from 'react'
import { Pressable, View } from 'react-native'
import { useSelector } from 'react-redux'
import TimelineContextMenu from './Shared/ContextMenu'
@ -53,10 +54,15 @@ const TimelineDefault: React.FC<Props> = ({
const ownAccount = actualStatus.account?.id === instanceAccount?.id
const copiableContent = useRef<{ content: string; complete: boolean }>({
content: '',
complete: false
})
if (
!highlighted &&
queryKey &&
shouldFilter({ status: actualStatus, queryKey })
shouldFilter({ copiableContent, status: actualStatus, queryKey })
) {
return <TimelineFiltered />
}
@ -75,10 +81,10 @@ const TimelineDefault: React.FC<Props> = ({
return (
<TimelineContextMenu
copiableContent={copiableContent}
status={actualStatus}
queryKey={queryKey}
rootQueryKey={rootQueryKey}
disabled={highlighted}
>
<Pressable
accessible={highlighted ? false : true}

View File

@ -5,6 +5,7 @@ import TimelineAttachment from '@components/Timeline/Shared/Attachment'
import TimelineAvatar from '@components/Timeline/Shared/Avatar'
import TimelineCard from '@components/Timeline/Shared/Card'
import TimelineContent from '@components/Timeline/Shared/Content'
// @ts-ignore
import TimelineHeaderNotification from '@components/Timeline/Shared/HeaderNotification'
import TimelinePoll from '@components/Timeline/Shared/Poll'
import { useNavigation } from '@react-navigation/native'
@ -15,7 +16,7 @@ import { getInstanceAccount } from '@utils/slices/instancesSlice'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import { isEqual, uniqBy } from 'lodash'
import React, { useCallback } from 'react'
import React, { useCallback, useRef } from 'react'
import { Pressable, View } from 'react-native'
import { useSelector } from 'react-redux'
import TimelineContextMenu from './Shared/ContextMenu'
@ -30,9 +31,14 @@ export interface Props {
const TimelineNotifications = React.memo(
({ notification, queryKey, highlighted = false }: Props) => {
const copiableContent = useRef<{ content: string; complete: boolean }>({
content: '',
complete: false
})
if (
notification.status &&
shouldFilter({ status: notification.status, queryKey })
shouldFilter({ copiableContent, status: notification.status, queryKey })
) {
return <TimelineFiltered />
}
@ -60,9 +66,9 @@ const TimelineNotifications = React.memo(
return (
<TimelineContextMenu
copiableContent={copiableContent}
status={notification.status}
queryKey={queryKey}
disabled={highlighted}
>
<Pressable
style={{

View File

@ -38,7 +38,6 @@ const TimelineContent = React.memo(
numberOfLines={999}
highlighted={highlighted}
disableDetails={disableDetails}
selectable={highlighted}
/>
<ParseHTML
content={status.content}
@ -53,7 +52,6 @@ const TimelineContent = React.memo(
expandHint={t('shared.content.expandHint')}
highlighted={highlighted}
disableDetails={disableDetails}
selectable={highlighted}
/>
</>
) : (
@ -66,7 +64,6 @@ const TimelineContent = React.memo(
tags={status.tags}
numberOfLines={highlighted ? 999 : numberOfLines}
disableDetails={disableDetails}
selectable={highlighted}
/>
)}
</>

View File

@ -12,23 +12,26 @@ import ContextMenu, {
} from 'react-native-context-menu-view'
export interface Props {
copiableContent: React.MutableRefObject<{
content: string
complete: boolean
}>
status?: Mastodon.Status
queryKey?: QueryKeyTimeline
rootQueryKey?: QueryKeyTimeline
disabled?: boolean // Allowing toot to be copied when highlighted
}
export const ContextMenuContext = createContext<ContextMenuAction[]>([])
const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
children,
copiableContent,
status,
queryKey,
rootQueryKey,
disabled,
...props
}) => {
if (!status || !queryKey || disabled || Platform.OS === 'android') {
if (!status || !queryKey || Platform.OS === 'android') {
return <>{children}</>
}
@ -37,6 +40,7 @@ const TimelineContextMenu: React.FC<Props & ContextMenuProps> = ({
const shareOnPress =
status.visibility !== 'direct'
? contextMenuShare({
copiableContent,
actions,
type: 'status',
url: status.url || status.uri

View File

@ -34,9 +34,14 @@ const TimelineFiltered = React.memo(
)
export const shouldFilter = ({
copiableContent,
status,
queryKey
}: {
copiableContent: React.MutableRefObject<{
content: string
complete: boolean
}>
status: Mastodon.Status
queryKey: QueryKeyTimeline
}) => {
@ -48,6 +53,11 @@ export const shouldFilter = ({
if (!ownAccount) {
const parser = new htmlparser2.Parser({
ontext: (text: string) => {
if (!copiableContent.current.complete) {
copiableContent.current.content =
copiableContent.current.content + text
}
const checkFilter = (filter: Mastodon.Filter) => {
const escapedPhrase = filter.phrase.replace(
/[.*+?^${}()|[\]\\]/g,
@ -103,6 +113,7 @@ export const shouldFilter = ({
status.spoiler_text && parser.write(status.spoiler_text)
parser.write(status.content)
parser.end()
copiableContent.current.complete = true
}
return shouldFilter

View File

@ -6,11 +6,10 @@ import Icon from '@components/Icon'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, View } from 'react-native'
import { Pressable, View } from 'react-native'
import ContextMenu, { ContextMenuAction } from 'react-native-context-menu-view'
import { ContextMenuContext } from './ContextMenu'
import HeaderSharedAccount from './HeaderShared/Account'
import HeaderSharedApplication from './HeaderShared/Application'
import HeaderSharedCreated from './HeaderShared/Created'
@ -110,6 +109,7 @@ const TimelineHeaderDefault = ({ queryKey, status, highlighted }: Props) => {
size={StyleConstants.Font.Size.L}
/>
}
style={{ width: '100%', height: '100%' }}
/>
</Pressable>
) : null}

View File

@ -4,7 +4,7 @@ import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, View } from 'react-native'
import { Pressable, View } from 'react-native'
import ContextMenu from 'react-native-context-menu-view'
import { ContextMenuContext } from './ContextMenu'
import HeaderSharedAccount from './HeaderShared/Account'
@ -48,7 +48,7 @@ const TimelineHeaderDefault = ({ queryKey, status, highlighted }: Props) => {
</View>
</View>
{queryKey && !highlighted ? (
{queryKey ? (
<Pressable
accessibilityHint={t('accessibilityHint')}
style={{

View File

@ -20,7 +20,7 @@ import HeaderSharedMuted from './HeaderShared/Muted'
import HeaderSharedVisibility from './HeaderShared/Visibility'
export interface Props {
queryKey?: QueryKeyTimeline
queryKey: QueryKeyTimeline
notification: Mastodon.Notification
}
@ -39,18 +39,18 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => {
: null
const statusOnPress = contextMenuStatus({
actions: contextMenuActions,
status,
status: status!,
queryKey
})
const accountOnPress = contextMenuAccount({
actions: contextMenuActions,
type: 'status',
queryKey,
id: status?.account.id
id: status!.account.id
})
const instanceOnPress = contextMenuInstance({
actions: contextMenuActions,
status,
status: status!,
queryKey
})
@ -91,6 +91,7 @@ const TimelineHeaderNotification = ({ queryKey, notification }: Props) => {
size={StyleConstants.Font.Size.L}
/>
}
style={{ width: '100%', height: '100%' }}
/>
}
/>

View File

@ -141,13 +141,7 @@ const TimelineTranslate = React.memo(
</Pressable>
{data && data.error === undefined
? data.text.map((d, i) => (
<ParseHTML
key={i}
content={d}
size={'M'}
numberOfLines={999}
selectable
/>
<ParseHTML key={i} content={d} size={'M'} numberOfLines={999} />
))
: null}
</>

View File

@ -14,6 +14,10 @@
"action": "Report user"
}
},
"copy": {
"action": "Copy toot",
"succeed": "Copied"
},
"instance": {
"title": "Instance action",
"block": {

View File

@ -1,9 +1,11 @@
{
"HTML": {
"accessibilityHint": "Tap to expand or collapse content",
"expanded": {
"true": "Fold {{hint}}",
"false": "Expand {{hint}}"
"true": "{{hint}}{{totalLines}}",
"false": "{{hint}}{{totalLines}}"
},
"defaultHint": "article"
"totalLines": " ({{count}} lines)",
"defaultHint": "Long toot"
}
}

View File

@ -81,7 +81,7 @@
"accessibilityHint": "Tap to go to {{name}}'s page"
},
"content": {
"expandHint": "hidden content"
"expandHint": "Hidden content"
},
"filtered": "Filtered",
"fullConversation": "Read conversations",

View File

@ -1703,13 +1703,18 @@
mkdirp "^1.0.4"
rimraf "^3.0.2"
"@react-native-async-storage/async-storage@^1.17.7":
version "1.17.7"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.7.tgz#f9213e8cc6202a8c29df5a4da1db588f3b0fa8a9"
integrity sha512-mDtWhCcpxzrZhA95f6zi0pnBsjBEZW1LKZWfxVXG0UfaWpPxDBCKowNk2xjRTytckZeVhjmPJPtBU+8QNQcR0A==
"@react-native-async-storage/async-storage@^1.17.8":
version "1.17.8"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.17.8.tgz#1ccff16dd02a85117b569f36eabaa2e49be40bbd"
integrity sha512-GoM/11oiSQrTcb6OycIPc6yv9HdWO12WbjsZX82v0xkAwefxJ0nPEHPhaeJiUnoOlCxj44+KoEPzlHG0Y8eRhA==
dependencies:
merge-options "^3.0.4"
"@react-native-clipboard/clipboard@^1.10.0":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@react-native-clipboard/clipboard/-/clipboard-1.10.0.tgz#605e784ed5435059c9b5db52b2d112f9fd09c409"
integrity sha512-1L+I0vmeUJgMi8MnNsqI00391/RFLkmmxj9qAuOS2madpvce/oNqJb8Pwk2Fc/uxIJSxOckTpq+dQwyPU6s+7w==
"@react-native-community/blur@^4.2.0":
version "4.2.0"
resolved "https://registry.yarnpkg.com/@react-native-community/blur/-/blur-4.2.0.tgz#f100d0ba220ecfed26be3c0ad2ceffa5eee17533"
@ -1781,7 +1786,7 @@
hermes-profile-transformer "^0.0.6"
ip "^1.1.5"
"@react-native-community/cli-platform-android@^8.0.2", "@react-native-community/cli-platform-android@^8.0.5":
"@react-native-community/cli-platform-android@^8.0.4", "@react-native-community/cli-platform-android@^8.0.5":
version "8.0.5"
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-android/-/cli-platform-android-8.0.5.tgz#da11d2678adeca98e83494d68de80e50571b4af4"
integrity sha512-z1YNE4T1lG5o9acoQR1GBvf7mq6Tzayqo/za5sHVSOJAC9SZOuVN/gg/nkBa9a8n5U7qOMFXfwhTMNqA474gXA==
@ -1796,7 +1801,7 @@
logkitty "^0.7.1"
slash "^3.0.0"
"@react-native-community/cli-platform-ios@^8.0.2", "@react-native-community/cli-platform-ios@^8.0.4":
"@react-native-community/cli-platform-ios@^8.0.4":
version "8.0.4"
resolved "https://registry.yarnpkg.com/@react-native-community/cli-platform-ios/-/cli-platform-ios-8.0.4.tgz#15225c09a1218a046f11165a54bf14b59dad7020"
integrity sha512-7Jdptedfg/J0Xo2rQbJ4jmo+PMYOiIiRcNDCSI5dBcNkQfSq4MMYUnKQx5DdZHgrfxE0O1vE4iNmJdd4wePz8w==
@ -1864,7 +1869,7 @@
dependencies:
joi "^17.2.1"
"@react-native-community/cli@^8.0.3":
"@react-native-community/cli@^8.0.4":
version "8.0.5"
resolved "https://registry.yarnpkg.com/@react-native-community/cli/-/cli-8.0.5.tgz#902a13b5336508f7989fddf39e6bf85b63a66de9"
integrity sha512-X0AMNK+sKDJQX8eQRkqgddJsZPWlHgLryX7O9usj78UFEK8VqVYtpv08piWecfAhC2mZU4/Lww4bKu9uJ1rdyQ==
@ -2330,7 +2335,7 @@
dependencies:
"@types/react" "*"
"@types/react@*", "@types/react@16 || 17 || 18", "@types/react@^18.0.15":
"@types/react@*", "@types/react@16 || 17 || 18":
version "18.0.15"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.15.tgz#d355644c26832dc27f3e6cbf0c4f4603fc4ab7fe"
integrity sha512-iz3BtLuIYH1uWdsv6wXYdhozhqj20oD4/Hk2DNXIn1kFsmp9x8d9QB6FnPhfkbhd2PgEONt9Q1x/ebkwjfFLow==
@ -2339,6 +2344,15 @@
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/react@^18.0.17":
version "18.0.17"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4"
integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/scheduler@*":
version "0.16.2"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
@ -4793,10 +4807,10 @@ https-proxy-agent@^5.0.0:
agent-base "6"
debug "4"
i18next@^21.8.16:
version "21.8.16"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.8.16.tgz#31fe4682e4e2077dbf229a88e5a58b7020e4ddc8"
integrity sha512-acJLCk38YMfEPjBR/1vS13SFY7rBQLs9E5m1tSRnWc9UW3f+SZszgH+NP1fZRA1+O+CdG2eLGGmuUMJW52EwzQ==
i18next@^21.9.0:
version "21.9.0"
resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.9.0.tgz#b63ebb0d4e1b23709951ca4774dc19d2ffac9553"
integrity sha512-B+6/yd7rCpJidyPuBaEApUECx7G8Ai6+tqYhrChsY4MmQqJhG7qJ4eT6Lm1OnRhieVelEtfxh4aAQktdNVZtDA==
dependencies:
"@babel/runtime" "^7.17.2"
@ -7056,10 +7070,10 @@ react-native-htmlview@^0.16.0:
entities "^1.1.1"
htmlparser2-without-node-native "^3.9.2"
react-native-image-picker@^4.8.4:
version "4.8.4"
resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-4.8.4.tgz#ac52f1e265458e944664adf1dcd0a9ee408fe083"
integrity sha512-Mjh2j/sddyolb16EpmprWzbtyeFvW8Xgzr/8WNi9d6bR2FC/kL78cY/a+7Yzujg5ZDtT1MWys+eWw/qtfwgGiw==
react-native-image-picker@^4.8.5:
version "4.8.5"
resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-4.8.5.tgz#5e5a0af56a13957cadfa1f8ce349d036d62e1499"
integrity sha512-+pQxkjO8cKv4RKTHOFS0fSHQ11HkWgb+imUPSOS8mwoChkR33aSuzV/6P4t9JCJgsus4qLAlB6BUosdIxw7GTA==
react-native-iphone-x-helper@^1.3.1:
version "1.3.1"
@ -7126,15 +7140,15 @@ react-native-tab-view@^3.1.1:
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-3.1.1.tgz#1f8d7a835ab4f5b1b1407ec8dddc1053b53fa3c6"
integrity sha512-M5pRN6utQfytKWoKlKVzg5NbkYu308qNoW1khGTtEOTs1k14p2dHJ/BWOJoJYHKbPVUyZldbG9MFT7gUl4YHnw==
react-native@^0.69.3:
version "0.69.3"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.69.3.tgz#8fc7afe0a302294262a6b49ba2089483db734c05"
integrity sha512-SyGkcoEUa/BkO+wKVnv4OsnLSNfUM5zLNXS3iT/3eXjKX91/FKBH/nfR9BE1c60X5LQe/P5QYqr6WPX3TRSQkA==
react-native@^0.69.4:
version "0.69.4"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.69.4.tgz#d66f2a117442a9398b065876afdc568b209dc4da"
integrity sha512-rqNMialM/T4pHRKWqTIpOxA65B/9kUjtnepxwJqvsdCeMP9Q2YdSx4VASFR9RoEFYcPRU41yGf6EKrChNfns3g==
dependencies:
"@jest/create-cache-key-function" "^27.0.1"
"@react-native-community/cli" "^8.0.3"
"@react-native-community/cli-platform-android" "^8.0.2"
"@react-native-community/cli-platform-ios" "^8.0.2"
"@react-native-community/cli" "^8.0.4"
"@react-native-community/cli-platform-android" "^8.0.4"
"@react-native-community/cli-platform-ios" "^8.0.4"
"@react-native/assets" "1.0.0"
"@react-native/normalize-color" "2.0.0"
"@react-native/polyfills" "2.0.0"