diff --git a/README.md b/README.md index 8852d7a7..7e6198ce 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,7 @@ git clone https://github.com/lovegaoshi/azusa-player-mobile.git yarn build yarn cd ios && pod install && cd .. +mv ios/sentry.properties.example ios/sentry.properties ``` ### MF插件 diff --git a/__tests__/mediafetch/ytbsearch.test.ts b/__tests__/mediafetch/ytbsearch.test.ts index e7de614d..987cfdb9 100644 --- a/__tests__/mediafetch/ytbsearch.test.ts +++ b/__tests__/mediafetch/ytbsearch.test.ts @@ -1,7 +1,7 @@ import fetcher from '../../src/utils/mediafetch/ytbsearch'; test('ytbsearch', async () => { const content = await fetcher.regexFetch({ - url: 'wake', + url: 'lady gaga', progressEmitter: () => {}, }); // console.log(content); diff --git a/ios/APM.xcodeproj/project.pbxproj b/ios/APM.xcodeproj/project.pbxproj index ee4b71d4..807e75bd 100644 --- a/ios/APM.xcodeproj/project.pbxproj +++ b/ios/APM.xcodeproj/project.pbxproj @@ -477,38 +477,38 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-azusa-player-mobile-APMTests/Pods-azusa-player-mobile-APMTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - FD10A7F022414F080027D42C /* Start Packager */ = { + 9F835F72A592488094ED0D47 /* Upload Debug Symbols to Sentry */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( ); - name = "Start Packager"; - outputFileListPaths = ( - ); + name = "Upload Debug Symbols to Sentry"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh"; }; - 9F835F72A592488094ED0D47 /* Upload Debug Symbols to Sentry */ = { + FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - runOnlyForDeploymentPostprocessing = 0; - name = "Upload Debug Symbols to Sentry"; + inputFileListPaths = ( + ); inputPaths = ( ); + name = "Start Packager"; + outputFileListPaths = ( + ); outputPaths = ( ); + runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh"; + shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ diff --git a/ios/APM.xcworkspace/contents.xcworkspacedata b/ios/APM.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..e4e287ab --- /dev/null +++ b/ios/APM.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 977d5b1d..54d40c02 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,30 +1,26 @@ PODS: - - AppAuth (1.6.2): - - AppAuth/Core (= 1.6.2) - - AppAuth/ExternalUserAgent (= 1.6.2) - - AppAuth/Core (1.6.2) - - AppAuth/ExternalUserAgent (1.6.2): + - AppAuth (1.7.3): + - AppAuth/Core (= 1.7.3) + - AppAuth/ExternalUserAgent (= 1.7.3) + - AppAuth/Core (1.7.3) + - AppAuth/ExternalUserAgent (1.7.3): - AppAuth/Core - - Base64 (1.1.2) - boost (1.83.0) - CocoaAsyncSocket (7.6.5) - - CodePush (8.1.1): - - Base64 (~> 1.1) - - JWT (~> 3.0.0-beta.12) - - React-Core - - SSZipArchive (~> 2.2.2) - DoubleConversion (1.1.6) - EXConstants (15.4.5): - ExpoModulesCore - - EXFont (11.10.2): + - EXFont (11.10.3): - ExpoModulesCore - - Expo (50.0.4): + - Expo (50.0.14): - ExpoModulesCore - ExpoClipboard (5.0.1): - ExpoModulesCore - - ExpoFileSystem (16.0.5): + - ExpoDocumentPicker (11.10.1): + - ExpoModulesCore + - ExpoFileSystem (16.0.8): - ExpoModulesCore - - ExpoImage (1.10.5): + - ExpoImage (1.10.6): - ExpoModulesCore - SDWebImage (~> 5.17.0) - SDWebImageAVIFCoder (~> 0.10.1) @@ -32,7 +28,7 @@ PODS: - SDWebImageWebPCoder (~> 0.13.0) - ExpoKeepAwake (12.8.2): - ExpoModulesCore - - ExpoModulesCore (1.11.8): + - ExpoModulesCore (1.11.12): - glog - RCT-Folly (= 2022.05.16.00) - React-Core @@ -41,14 +37,14 @@ PODS: - ReactCommon/turbomodule/core - ExpoSecureStore (12.8.1): - ExpoModulesCore - - FBLazyVector (0.73.3) - - FBReactNativeSpec (0.73.3): + - FBLazyVector (0.73.6) + - FBReactNativeSpec (0.73.6): - RCT-Folly (= 2022.05.16.00) - - RCTRequired (= 0.73.3) - - RCTTypeSafety (= 0.73.3) - - React-Core (= 0.73.3) - - React-jsi (= 0.73.3) - - ReactCommon/turbomodule/core (= 0.73.3) + - RCTRequired (= 0.73.6) + - RCTTypeSafety (= 0.73.6) + - React-Core (= 0.73.6) + - React-jsi (= 0.73.6) + - ReactCommon/turbomodule/core (= 0.73.6) - ffmpeg-kit-ios-audio (6.0) - ffmpeg-kit-react-native/audio (6.0.2): - ffmpeg-kit-ios-audio (= 6.0) @@ -111,11 +107,9 @@ PODS: - FlipperKit/FlipperKitNetworkPlugin - fmt (6.2.1) - glog (0.3.5) - - hermes-engine (0.73.3): - - hermes-engine/Pre-built (= 0.73.3) - - hermes-engine/Pre-built (0.73.3) - - JWT (3.0.0-beta.14): - - Base64 (~> 1.1.2) + - hermes-engine (0.73.6): + - hermes-engine/Pre-built (= 0.73.6) + - hermes-engine/Pre-built (0.73.6) - libaom (3.0.0): - libvmaf (>= 2.2.0) - libavif (0.11.1): @@ -138,13 +132,16 @@ PODS: - libwebp/sharpyuv (1.3.2) - libwebp/webp (1.3.2): - libwebp/sharpyuv - - lottie-ios (4.4.0) - - lottie-react-native (6.6.0): + - lottie-ios (4.4.1) + - lottie-react-native (6.7.2): - glog - - lottie-ios (~> 4.4.0) + - lottie-ios (= 4.4.1) - RCT-Folly (= 2022.05.16.00) - React-Core - OpenSSL-Universal (1.1.1100) + - PromisesObjC (2.4.0) + - PromisesSwift (2.4.0): + - PromisesObjC (= 2.4.0) - Protobuf (3.22.1) - RCT-Folly (2022.05.16.00): - boost @@ -168,26 +165,26 @@ PODS: - fmt (~> 6.2.1) - glog - libevent - - RCTRequired (0.73.3) - - RCTTypeSafety (0.73.3): - - FBLazyVector (= 0.73.3) - - RCTRequired (= 0.73.3) - - React-Core (= 0.73.3) - - React (0.73.3): - - React-Core (= 0.73.3) - - React-Core/DevSupport (= 0.73.3) - - React-Core/RCTWebSocket (= 0.73.3) - - React-RCTActionSheet (= 0.73.3) - - React-RCTAnimation (= 0.73.3) - - React-RCTBlob (= 0.73.3) - - React-RCTImage (= 0.73.3) - - React-RCTLinking (= 0.73.3) - - React-RCTNetwork (= 0.73.3) - - React-RCTSettings (= 0.73.3) - - React-RCTText (= 0.73.3) - - React-RCTVibration (= 0.73.3) - - React-callinvoker (0.73.3) - - React-Codegen (0.73.3): + - RCTRequired (0.73.6) + - RCTTypeSafety (0.73.6): + - FBLazyVector (= 0.73.6) + - RCTRequired (= 0.73.6) + - React-Core (= 0.73.6) + - React (0.73.6): + - React-Core (= 0.73.6) + - React-Core/DevSupport (= 0.73.6) + - React-Core/RCTWebSocket (= 0.73.6) + - React-RCTActionSheet (= 0.73.6) + - React-RCTAnimation (= 0.73.6) + - React-RCTBlob (= 0.73.6) + - React-RCTImage (= 0.73.6) + - React-RCTLinking (= 0.73.6) + - React-RCTNetwork (= 0.73.6) + - React-RCTSettings (= 0.73.6) + - React-RCTText (= 0.73.6) + - React-RCTVibration (= 0.73.6) + - React-callinvoker (0.73.6) + - React-Codegen (0.73.6): - DoubleConversion - FBReactNativeSpec - glog @@ -202,11 +199,11 @@ PODS: - React-rncore - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-Core (0.73.3): + - React-Core (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-Core/Default (= 0.73.3) + - React-Core/Default (= 0.73.6) - React-cxxreact - React-hermes - React-jsi @@ -216,7 +213,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/CoreModulesHeaders (0.73.3): + - React-Core/CoreModulesHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -230,7 +227,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/Default (0.73.3): + - React-Core/Default (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -243,23 +240,23 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/DevSupport (0.73.3): + - React-Core/DevSupport (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-Core/Default (= 0.73.3) - - React-Core/RCTWebSocket (= 0.73.3) + - React-Core/Default (= 0.73.6) + - React-Core/RCTWebSocket (= 0.73.6) - React-cxxreact - React-hermes - React-jsi - React-jsiexecutor - - React-jsinspector (= 0.73.3) + - React-jsinspector (= 0.73.6) - React-perflogger - React-runtimescheduler - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTActionSheetHeaders (0.73.3): + - React-Core/RCTActionSheetHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -273,7 +270,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTAnimationHeaders (0.73.3): + - React-Core/RCTAnimationHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -287,7 +284,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTBlobHeaders (0.73.3): + - React-Core/RCTBlobHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -301,7 +298,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTImageHeaders (0.73.3): + - React-Core/RCTImageHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -315,7 +312,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTLinkingHeaders (0.73.3): + - React-Core/RCTLinkingHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -329,7 +326,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTNetworkHeaders (0.73.3): + - React-Core/RCTNetworkHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -343,7 +340,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTSettingsHeaders (0.73.3): + - React-Core/RCTSettingsHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -357,7 +354,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTTextHeaders (0.73.3): + - React-Core/RCTTextHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -371,7 +368,7 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTVibrationHeaders (0.73.3): + - React-Core/RCTVibrationHeaders (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -385,11 +382,11 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-Core/RCTWebSocket (0.73.3): + - React-Core/RCTWebSocket (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-Core/Default (= 0.73.3) + - React-Core/Default (= 0.73.6) - React-cxxreact - React-hermes - React-jsi @@ -399,33 +396,33 @@ PODS: - React-utils - SocketRocket (= 0.6.1) - Yoga - - React-CoreModules (0.73.3): + - React-CoreModules (0.73.6): - RCT-Folly (= 2022.05.16.00) - - RCTTypeSafety (= 0.73.3) + - RCTTypeSafety (= 0.73.6) - React-Codegen - - React-Core/CoreModulesHeaders (= 0.73.3) - - React-jsi (= 0.73.3) + - React-Core/CoreModulesHeaders (= 0.73.6) + - React-jsi (= 0.73.6) - React-NativeModulesApple - React-RCTBlob - - React-RCTImage (= 0.73.3) + - React-RCTImage (= 0.73.6) - ReactCommon - SocketRocket (= 0.6.1) - - React-cxxreact (0.73.3): + - React-cxxreact (0.73.6): - boost (= 1.83.0) - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-callinvoker (= 0.73.3) - - React-debug (= 0.73.3) - - React-jsi (= 0.73.3) - - React-jsinspector (= 0.73.3) - - React-logger (= 0.73.3) - - React-perflogger (= 0.73.3) - - React-runtimeexecutor (= 0.73.3) - - React-debug (0.73.3) - - React-Fabric (0.73.3): + - React-callinvoker (= 0.73.6) + - React-debug (= 0.73.6) + - React-jsi (= 0.73.6) + - React-jsinspector (= 0.73.6) + - React-logger (= 0.73.6) + - React-perflogger (= 0.73.6) + - React-runtimeexecutor (= 0.73.6) + - React-debug (0.73.6) + - React-Fabric (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -436,20 +433,20 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/animations (= 0.73.3) - - React-Fabric/attributedstring (= 0.73.3) - - React-Fabric/componentregistry (= 0.73.3) - - React-Fabric/componentregistrynative (= 0.73.3) - - React-Fabric/components (= 0.73.3) - - React-Fabric/core (= 0.73.3) - - React-Fabric/imagemanager (= 0.73.3) - - React-Fabric/leakchecker (= 0.73.3) - - React-Fabric/mounting (= 0.73.3) - - React-Fabric/scheduler (= 0.73.3) - - React-Fabric/telemetry (= 0.73.3) - - React-Fabric/templateprocessor (= 0.73.3) - - React-Fabric/textlayoutmanager (= 0.73.3) - - React-Fabric/uimanager (= 0.73.3) + - React-Fabric/animations (= 0.73.6) + - React-Fabric/attributedstring (= 0.73.6) + - React-Fabric/componentregistry (= 0.73.6) + - React-Fabric/componentregistrynative (= 0.73.6) + - React-Fabric/components (= 0.73.6) + - React-Fabric/core (= 0.73.6) + - React-Fabric/imagemanager (= 0.73.6) + - React-Fabric/leakchecker (= 0.73.6) + - React-Fabric/mounting (= 0.73.6) + - React-Fabric/scheduler (= 0.73.6) + - React-Fabric/telemetry (= 0.73.6) + - React-Fabric/templateprocessor (= 0.73.6) + - React-Fabric/textlayoutmanager (= 0.73.6) + - React-Fabric/uimanager (= 0.73.6) - React-graphics - React-jsi - React-jsiexecutor @@ -458,7 +455,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/animations (0.73.3): + - React-Fabric/animations (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -477,7 +474,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/attributedstring (0.73.3): + - React-Fabric/attributedstring (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -496,7 +493,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistry (0.73.3): + - React-Fabric/componentregistry (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -515,7 +512,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/componentregistrynative (0.73.3): + - React-Fabric/componentregistrynative (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -534,7 +531,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components (0.73.3): + - React-Fabric/components (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -545,17 +542,17 @@ PODS: - React-Core - React-cxxreact - React-debug - - React-Fabric/components/inputaccessory (= 0.73.3) - - React-Fabric/components/legacyviewmanagerinterop (= 0.73.3) - - React-Fabric/components/modal (= 0.73.3) - - React-Fabric/components/rncore (= 0.73.3) - - React-Fabric/components/root (= 0.73.3) - - React-Fabric/components/safeareaview (= 0.73.3) - - React-Fabric/components/scrollview (= 0.73.3) - - React-Fabric/components/text (= 0.73.3) - - React-Fabric/components/textinput (= 0.73.3) - - React-Fabric/components/unimplementedview (= 0.73.3) - - React-Fabric/components/view (= 0.73.3) + - React-Fabric/components/inputaccessory (= 0.73.6) + - React-Fabric/components/legacyviewmanagerinterop (= 0.73.6) + - React-Fabric/components/modal (= 0.73.6) + - React-Fabric/components/rncore (= 0.73.6) + - React-Fabric/components/root (= 0.73.6) + - React-Fabric/components/safeareaview (= 0.73.6) + - React-Fabric/components/scrollview (= 0.73.6) + - React-Fabric/components/text (= 0.73.6) + - React-Fabric/components/textinput (= 0.73.6) + - React-Fabric/components/unimplementedview (= 0.73.6) + - React-Fabric/components/view (= 0.73.6) - React-graphics - React-jsi - React-jsiexecutor @@ -564,7 +561,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/inputaccessory (0.73.3): + - React-Fabric/components/inputaccessory (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -583,7 +580,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/legacyviewmanagerinterop (0.73.3): + - React-Fabric/components/legacyviewmanagerinterop (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -602,7 +599,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/modal (0.73.3): + - React-Fabric/components/modal (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -621,7 +618,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/rncore (0.73.3): + - React-Fabric/components/rncore (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -640,7 +637,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/root (0.73.3): + - React-Fabric/components/root (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -659,7 +656,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/safeareaview (0.73.3): + - React-Fabric/components/safeareaview (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -678,7 +675,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/scrollview (0.73.3): + - React-Fabric/components/scrollview (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -697,7 +694,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/text (0.73.3): + - React-Fabric/components/text (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -716,7 +713,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/textinput (0.73.3): + - React-Fabric/components/textinput (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -735,7 +732,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/unimplementedview (0.73.3): + - React-Fabric/components/unimplementedview (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -754,7 +751,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/components/view (0.73.3): + - React-Fabric/components/view (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -774,7 +771,7 @@ PODS: - React-utils - ReactCommon/turbomodule/core - Yoga - - React-Fabric/core (0.73.3): + - React-Fabric/core (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -793,7 +790,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/imagemanager (0.73.3): + - React-Fabric/imagemanager (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -812,7 +809,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/leakchecker (0.73.3): + - React-Fabric/leakchecker (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -831,7 +828,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/mounting (0.73.3): + - React-Fabric/mounting (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -850,7 +847,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/scheduler (0.73.3): + - React-Fabric/scheduler (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -869,7 +866,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/telemetry (0.73.3): + - React-Fabric/telemetry (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -888,7 +885,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/templateprocessor (0.73.3): + - React-Fabric/templateprocessor (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -907,7 +904,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/textlayoutmanager (0.73.3): + - React-Fabric/textlayoutmanager (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -927,7 +924,7 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-Fabric/uimanager (0.73.3): + - React-Fabric/uimanager (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog @@ -946,42 +943,42 @@ PODS: - React-runtimescheduler - React-utils - ReactCommon/turbomodule/core - - React-FabricImage (0.73.3): + - React-FabricImage (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly/Fabric (= 2022.05.16.00) - - RCTRequired (= 0.73.3) - - RCTTypeSafety (= 0.73.3) + - RCTRequired (= 0.73.6) + - RCTTypeSafety (= 0.73.6) - React-Fabric - React-graphics - React-ImageManager - React-jsi - - React-jsiexecutor (= 0.73.3) + - React-jsiexecutor (= 0.73.6) - React-logger - React-rendererdebug - React-utils - ReactCommon - Yoga - - React-graphics (0.73.3): + - React-graphics (0.73.6): - glog - RCT-Folly/Fabric (= 2022.05.16.00) - - React-Core/Default (= 0.73.3) + - React-Core/Default (= 0.73.6) - React-utils - - React-hermes (0.73.3): + - React-hermes (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - RCT-Folly/Futures (= 2022.05.16.00) - - React-cxxreact (= 0.73.3) + - React-cxxreact (= 0.73.6) - React-jsi - - React-jsiexecutor (= 0.73.3) - - React-jsinspector (= 0.73.3) - - React-perflogger (= 0.73.3) - - React-ImageManager (0.73.3): + - React-jsiexecutor (= 0.73.6) + - React-jsinspector (= 0.73.6) + - React-perflogger (= 0.73.6) + - React-ImageManager (0.73.6): - glog - RCT-Folly/Fabric - React-Core/Default @@ -990,34 +987,34 @@ PODS: - React-graphics - React-rendererdebug - React-utils - - React-jserrorhandler (0.73.3): + - React-jserrorhandler (0.73.6): - RCT-Folly/Fabric (= 2022.05.16.00) - React-debug - React-jsi - React-Mapbuffer - - React-jsi (0.73.3): + - React-jsi (0.73.6): - boost (= 1.83.0) - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-jsiexecutor (0.73.3): + - React-jsiexecutor (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-cxxreact (= 0.73.3) - - React-jsi (= 0.73.3) - - React-perflogger (= 0.73.3) - - React-jsinspector (0.73.3) - - React-logger (0.73.3): + - React-cxxreact (= 0.73.6) + - React-jsi (= 0.73.6) + - React-perflogger (= 0.73.6) + - React-jsinspector (0.73.6) + - React-logger (0.73.6): - glog - - React-Mapbuffer (0.73.3): + - React-Mapbuffer (0.73.6): - glog - React-debug - - react-native-app-auth (7.1.0): + - react-native-app-auth (7.1.3): - AppAuth (~> 1.6) - React-Core - react-native-background-timer (2.4.1): @@ -1025,19 +1022,19 @@ PODS: - react-native-blob-jsi-helper (0.3.1): - React - React-Core - - react-native-blob-util (0.19.6): + - react-native-blob-util (0.19.8): - React-Core - react-native-cookies (6.2.1): - React-Core - - react-native-get-random-values (1.10.0): + - react-native-get-random-values (1.11.0): - React-Core - - react-native-netinfo (11.2.1): + - react-native-netinfo (11.3.1): - React-Core - - react-native-pager-view (6.2.3): + - react-native-pager-view (6.3.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - react-native-safe-area-context (4.8.2): + - react-native-safe-area-context (4.9.0): - React-Core - react-native-skia (0.1.225): - glog @@ -1051,17 +1048,18 @@ PODS: - react-native-track-player (4.0.1): - React-Core - SwiftAudioEx (= 1.0.0) - - react-native-video (5.2.1): + - react-native-video (6.0.0-beta.5): - React-Core - - react-native-video/Video (= 5.2.1) - - react-native-video/Video (5.2.1): + - react-native-video/Video (= 6.0.0-beta.5) + - react-native-video/Video (6.0.0-beta.5): + - PromisesSwift - React-Core - - react-native-webview (13.6.4): + - react-native-webview (13.8.4): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - React-nativeconfig (0.73.3) - - React-NativeModulesApple (0.73.3): + - React-nativeconfig (0.73.6) + - React-NativeModulesApple (0.73.6): - glog - hermes-engine - React-callinvoker @@ -1071,10 +1069,10 @@ PODS: - React-runtimeexecutor - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - React-perflogger (0.73.3) - - React-RCTActionSheet (0.73.3): - - React-Core/RCTActionSheetHeaders (= 0.73.3) - - React-RCTAnimation (0.73.3): + - React-perflogger (0.73.6) + - React-RCTActionSheet (0.73.6): + - React-Core/RCTActionSheetHeaders (= 0.73.6) + - React-RCTAnimation (0.73.6): - RCT-Folly (= 2022.05.16.00) - RCTTypeSafety - React-Codegen @@ -1082,7 +1080,7 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTAppDelegate (0.73.3): + - React-RCTAppDelegate (0.73.6): - RCT-Folly - RCTRequired - RCTTypeSafety @@ -1096,7 +1094,7 @@ PODS: - React-RCTNetwork - React-runtimescheduler - ReactCommon - - React-RCTBlob (0.73.3): + - React-RCTBlob (0.73.6): - hermes-engine - RCT-Folly (= 2022.05.16.00) - React-Codegen @@ -1106,7 +1104,7 @@ PODS: - React-NativeModulesApple - React-RCTNetwork - ReactCommon - - React-RCTFabric (0.73.3): + - React-RCTFabric (0.73.6): - glog - hermes-engine - RCT-Folly/Fabric (= 2022.05.16.00) @@ -1124,7 +1122,7 @@ PODS: - React-runtimescheduler - React-utils - Yoga - - React-RCTImage (0.73.3): + - React-RCTImage (0.73.6): - RCT-Folly (= 2022.05.16.00) - RCTTypeSafety - React-Codegen @@ -1133,14 +1131,14 @@ PODS: - React-NativeModulesApple - React-RCTNetwork - ReactCommon - - React-RCTLinking (0.73.3): + - React-RCTLinking (0.73.6): - React-Codegen - - React-Core/RCTLinkingHeaders (= 0.73.3) - - React-jsi (= 0.73.3) + - React-Core/RCTLinkingHeaders (= 0.73.6) + - React-jsi (= 0.73.6) - React-NativeModulesApple - ReactCommon - - ReactCommon/turbomodule/core (= 0.73.3) - - React-RCTNetwork (0.73.3): + - ReactCommon/turbomodule/core (= 0.73.6) + - React-RCTNetwork (0.73.6): - RCT-Folly (= 2022.05.16.00) - RCTTypeSafety - React-Codegen @@ -1148,7 +1146,7 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTSettings (0.73.3): + - React-RCTSettings (0.73.6): - RCT-Folly (= 2022.05.16.00) - RCTTypeSafety - React-Codegen @@ -1156,25 +1154,25 @@ PODS: - React-jsi - React-NativeModulesApple - ReactCommon - - React-RCTText (0.73.3): - - React-Core/RCTTextHeaders (= 0.73.3) + - React-RCTText (0.73.6): + - React-Core/RCTTextHeaders (= 0.73.6) - Yoga - - React-RCTVibration (0.73.3): + - React-RCTVibration (0.73.6): - RCT-Folly (= 2022.05.16.00) - React-Codegen - React-Core/RCTVibrationHeaders - React-jsi - React-NativeModulesApple - ReactCommon - - React-rendererdebug (0.73.3): + - React-rendererdebug (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - RCT-Folly (= 2022.05.16.00) - React-debug - - React-rncore (0.73.3) - - React-runtimeexecutor (0.73.3): - - React-jsi (= 0.73.3) - - React-runtimescheduler (0.73.3): + - React-rncore (0.73.6) + - React-runtimeexecutor (0.73.6): + - React-jsi (= 0.73.6) + - React-runtimescheduler (0.73.6): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -1185,70 +1183,75 @@ PODS: - React-rendererdebug - React-runtimeexecutor - React-utils - - React-utils (0.73.3): + - React-utils (0.73.6): - glog - RCT-Folly (= 2022.05.16.00) - React-debug - - ReactCommon (0.73.3): - - React-logger (= 0.73.3) - - ReactCommon/turbomodule (= 0.73.3) - - ReactCommon/turbomodule (0.73.3): + - ReactCommon (0.73.6): + - React-logger (= 0.73.6) + - ReactCommon/turbomodule (= 0.73.6) + - ReactCommon/turbomodule (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-callinvoker (= 0.73.3) - - React-cxxreact (= 0.73.3) - - React-jsi (= 0.73.3) - - React-logger (= 0.73.3) - - React-perflogger (= 0.73.3) - - ReactCommon/turbomodule/bridging (= 0.73.3) - - ReactCommon/turbomodule/core (= 0.73.3) - - ReactCommon/turbomodule/bridging (0.73.3): + - React-callinvoker (= 0.73.6) + - React-cxxreact (= 0.73.6) + - React-jsi (= 0.73.6) + - React-logger (= 0.73.6) + - React-perflogger (= 0.73.6) + - ReactCommon/turbomodule/bridging (= 0.73.6) + - ReactCommon/turbomodule/core (= 0.73.6) + - ReactCommon/turbomodule/bridging (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-callinvoker (= 0.73.3) - - React-cxxreact (= 0.73.3) - - React-jsi (= 0.73.3) - - React-logger (= 0.73.3) - - React-perflogger (= 0.73.3) - - ReactCommon/turbomodule/core (0.73.3): + - React-callinvoker (= 0.73.6) + - React-cxxreact (= 0.73.6) + - React-jsi (= 0.73.6) + - React-logger (= 0.73.6) + - React-perflogger (= 0.73.6) + - ReactCommon/turbomodule/core (0.73.6): - DoubleConversion - fmt (~> 6.2.1) - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) - - React-callinvoker (= 0.73.3) - - React-cxxreact (= 0.73.3) - - React-jsi (= 0.73.3) - - React-logger (= 0.73.3) - - React-perflogger (= 0.73.3) - - RNCAsyncStorage (1.21.0): + - React-callinvoker (= 0.73.6) + - React-cxxreact (= 0.73.6) + - React-jsi (= 0.73.6) + - React-logger (= 0.73.6) + - React-perflogger (= 0.73.6) + - RNCAsyncStorage (1.23.1): - React-Core - - RNFlashList (1.6.3): + - RNFlashList (1.6.4): - React-Core - - RNGestureHandler (2.14.1): + - RNGestureHandler (2.16.0): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - RNReanimated (3.6.2): + - RNReanimated (3.8.1): - glog - RCT-Folly (= 2022.05.16.00) - React-Core - ReactCommon/turbomodule/core - - RNScreens (3.29.0): + - RNScreens (3.30.1): - glog - RCT-Folly (= 2022.05.16.00) - React-Core + - RNSentry (5.20.0): + - hermes-engine + - React-Core + - React-hermes + - Sentry/HybridSDK (= 8.21.0) - RNShareMenu (6.0.0): - React - RNSnackbar (2.6.2): - React-Core - - RNSVG (14.1.0): + - RNSVG (15.1.0): - React-Core - RNVectorIcons (10.0.3): - glog @@ -1265,8 +1268,11 @@ PODS: - SDWebImageWebPCoder (0.13.0): - libwebp (~> 1.0) - SDWebImage/Core (~> 5.17) + - Sentry/HybridSDK (8.21.0): + - SentryPrivate (= 8.21.0) + - SentryPrivate (8.21.0) - SocketRocket (0.6.1) - - SSZipArchive (2.2.3) + - SSZipArchive (2.4.3) - SVGAPlayer (2.5.7): - SVGAPlayer/Core (= 2.5.7) - SVGAPlayer/ProtoFiles (= 2.5.7) @@ -1280,12 +1286,12 @@ PODS: DEPENDENCIES: - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - - CodePush (from `../node_modules/react-native-code-push`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - EXConstants (from `../node_modules/expo-constants/ios`) - EXFont (from `../node_modules/expo-font/ios`) - Expo (from `../node_modules/expo`) - ExpoClipboard (from `../node_modules/expo-clipboard/ios`) + - ExpoDocumentPicker (from `../node_modules/expo-document-picker/ios`) - ExpoFileSystem (from `../node_modules/expo-file-system/ios`) - ExpoImage (from `../node_modules/expo-image/ios`) - ExpoKeepAwake (from `../node_modules/expo-keep-awake/ios`) @@ -1383,6 +1389,7 @@ DEPENDENCIES: - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) + - "RNSentry (from `../node_modules/@sentry/react-native`)" - RNShareMenu (from `../node_modules/react-native-share-menu`) - RNSnackbar (from `../node_modules/react-native-snackbar`) - RNSVG (from `../node_modules/react-native-svg`) @@ -1392,7 +1399,6 @@ DEPENDENCIES: SPEC REPOS: trunk: - AppAuth - - Base64 - CocoaAsyncSocket - ffmpeg-kit-ios-audio - Flipper @@ -1404,7 +1410,6 @@ SPEC REPOS: - Flipper-PeerTalk - FlipperKit - fmt - - JWT - libaom - libavif - libevent @@ -1412,11 +1417,15 @@ SPEC REPOS: - libwebp - lottie-ios - OpenSSL-Universal + - PromisesObjC + - PromisesSwift - Protobuf - SDWebImage - SDWebImageAVIFCoder - SDWebImageSVGCoder - SDWebImageWebPCoder + - Sentry + - SentryPrivate - SocketRocket - SSZipArchive - SVGAPlayer @@ -1425,8 +1434,6 @@ SPEC REPOS: EXTERNAL SOURCES: boost: :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" - CodePush: - :path: "../node_modules/react-native-code-push" DoubleConversion: :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" EXConstants: @@ -1437,6 +1444,8 @@ EXTERNAL SOURCES: :path: "../node_modules/expo" ExpoClipboard: :path: "../node_modules/expo-clipboard/ios" + ExpoDocumentPicker: + :path: "../node_modules/expo-document-picker/ios" ExpoFileSystem: :path: "../node_modules/expo-file-system/ios" ExpoImage: @@ -1457,7 +1466,7 @@ EXTERNAL SOURCES: :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" hermes-engine: :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec" - :tag: hermes-2023-11-17-RNv0.73.0-21043a3fc062be445e56a2c10ecd8be028dd9cc5 + :tag: hermes-2024-02-20-RNv0.73.5-18f99ace4213052c5e7cdbcd39ee9766cd5df7e4 lottie-react-native: :path: "../node_modules/lottie-react-native" RCT-Folly: @@ -1580,6 +1589,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-reanimated" RNScreens: :path: "../node_modules/react-native-screens" + RNSentry: + :path: "../node_modules/@sentry/react-native" RNShareMenu: :path: "../node_modules/react-native-share-menu" RNSnackbar: @@ -1592,23 +1603,22 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570 - Base64: cecfb41a004124895a7bcee567a89bae5a89d49b + AppAuth: a13994980c1ec792f7e2e665acd4d4aa6be43240 boost: d3f49c53809116a5d38da093a8aa78bf551aed09 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - CodePush: c3fdecab0dba1f760a1c6d1a562b9b88ce311fe1 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 EXConstants: 988aa430ca0f76b43cd46b66e7fae3287f9cc2fc - EXFont: 21b9c760abd593ce8f0d5386b558ced76018506f - Expo: 1e3bcf9dd99de57a636127057f6b488f0609681a + EXFont: f20669cb266ef48b004f1eb1f2b20db96cd1df9f + Expo: e01a77c6fa4bc80a6d1bb949cda1d12d21044abd ExpoClipboard: b597982124f067ff9f5b89093eb3d97898d5d877 - ExpoFileSystem: 04795dd4d47e76eaf12e38c92091f77d794f9e7f - ExpoImage: 2b71f20472f293c1fbbf2400795b03d5bf8dd598 + ExpoDocumentPicker: 70254802886e29a45d4ad25486e64b6fc9c8f0cc + ExpoFileSystem: eecaf6796aed0f4dd20042dc2ca2cac6c4bc1185 + ExpoImage: 8cf2d51de3d03b7e984e9b0ba8f19c0c22057001 ExpoKeepAwake: 0f5cad99603a3268e50af9a6eb8b76d0d9ac956c - ExpoModulesCore: 96d1751929ad10622773bb729ab28a8423f0dd0c + ExpoModulesCore: 61dc57c6e2a35f2f84baf488146db624e03af4cd ExpoSecureStore: c84ae37d1c36f38524d289c67c3a2e3fc56f1108 - FBLazyVector: 70590b4f9e8ae9b0ce076efacea3abd7bc585ace - FBReactNativeSpec: e47ea8c8f044c25e41a4fa5e8b7ff3923d3e0a94 + FBLazyVector: f64d1e2ea739b4d8f7e4740cde18089cd97fe864 + FBReactNativeSpec: 9f2b8b243131565335437dba74923a8d3015e780 ffmpeg-kit-ios-audio: 9fa9953fc197280a69e59c603c7fa7690df7190c ffmpeg-kit-react-native: 3cea88c9c5cfad62e1465279ea7d800dfbba3b00 Flipper: c7a0093234c4bdd456e363f2f19b2e4b27652d44 @@ -1621,91 +1631,95 @@ SPEC CHECKSUMS: FlipperKit: 37525a5d056ef9b93d1578e04bc3ea1de940094f fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - hermes-engine: 5420539d016f368cd27e008f65f777abd6098c56 - JWT: ef71dfb03e1f842081e64dc42eef0e164f35d251 + hermes-engine: 9cecf9953a681df7556b8cc9c74905de8f3293c0 libaom: 144606b1da4b5915a1054383c3a4459ccdb3c661 libavif: 84bbb62fb232c3018d6f1bab79beea87e35de7b7 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 libvmaf: 27f523f1e63c694d14d534cd0fddd2fab0ae8711 libwebp: 1786c9f4ff8a279e4dac1e8f385004d5fc253009 - lottie-ios: ef1be1f90d54255f08e09d767950e43714661178 - lottie-react-native: 34cfb1db79d0feb7bf7b200d4a4e2f164b0c5f58 + lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494 + lottie-react-native: 2d9efc8a5ffabe688b55a1a1ac1fb94b9d971995 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c + PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 + PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851 Protobuf: d7f7c8329edf5eb8af65547a8ba3e9c1cee927d5 RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0 - RCTRequired: 9b898847f76977a6dfed2a08f4c5ed37add75ec0 - RCTTypeSafety: 0debdc4ba38c8138016d8d8ada4bdf9ec1b8aa82 - React: f8afb04431634ac7e9b876dc96d30af9871f5946 - React-callinvoker: 5ea86c3f93326867aa5114989d229db54d4759d0 - React-Codegen: f8f3172b716f793b334e6603b3b33207c0e813c7 - React-Core: bbac074eba495788a01d1e5455b132872bf86843 - React-CoreModules: 92fee6d8f4095e151b9678e44fcf0dc8eabeae37 - React-cxxreact: e856e0370bf52aea71acce10007ad9ba6a63b66c - React-debug: 23ea1f904cd98ae3b04b2b4982584641d3c7bcb5 - React-Fabric: f692e74b325a408f328d337615a22539315d8a90 - React-FabricImage: 969993a105d5e2a9bfab6945b78b88a2b0d70504 - React-graphics: f95976953fc89d60b1022a4ea3d8281985993fe7 - React-hermes: ac421eebea18bab58a57b70c590b7c11edaac00b - React-ImageManager: d67a26f14b62ff5a0c86c36d5d580940f4f07771 - React-jserrorhandler: 7087c3b3d9691ba72798adf600a4157beeb16fd7 - React-jsi: 57498df51dfb8a37a996f470a457d8797e931eaa - React-jsiexecutor: d83a7d7aea2ffc60dbda0f3d523578a76820f0e1 - React-jsinspector: 6fad0fe14882fb6b1c32e5cc8a4bd3d33a8b6790 - React-logger: cb0dd15ac67b00e7b771ef15203edcb29d4a3f8e - React-Mapbuffer: d59258be3b0d2280c6ba8964ab6e36ec69211871 - react-native-app-auth: 1da4b0ec30756ae1f4df8e96d2505b1ce5fbcc1f + RCTRequired: ca1d7414aba0b27efcfa2ccd37637edb1ab77d96 + RCTTypeSafety: 678e344fb976ff98343ca61dc62e151f3a042292 + React: e296bcebb489deaad87326067204eb74145934ab + React-callinvoker: d0b7015973fa6ccb592bb0363f6bc2164238ab8c + React-Codegen: f034a5de6f28e15e8d95d171df17e581d5309268 + React-Core: 44c936d0ab879e9c32e5381bd7596a677c59c974 + React-CoreModules: 558228e12cddb9ca00ff7937894cc5104a21be6b + React-cxxreact: 1fcf565012c203655b3638f35aa03c13c2ed7e9e + React-debug: d444db402065cca460d9c5b072caab802a04f729 + React-Fabric: 7d11905695e42f8bdaedddcf294959b43b290ab8 + React-FabricImage: 6e06a512d2fb5f55669c721578736785d915d4f5 + React-graphics: 5500206f7c9a481456365403c9fcf1638de108b7 + React-hermes: 783023e43af9d6be4fbaeeb96b5beee00649a5f7 + React-ImageManager: df193215ff3cf1a8dad297e554c89c632e42436c + React-jserrorhandler: a4d0f541c5852cf031db2f82f51de90be55b1334 + React-jsi: ae102ccb38d2e4d0f512b7074d0c9b4e1851f402 + React-jsiexecutor: bd12ec75873d3ef0a755c11f878f2c420430f5a9 + React-jsinspector: 85583ef014ce53d731a98c66a0e24496f7a83066 + React-logger: 3eb80a977f0d9669468ef641a5e1fabbc50a09ec + React-Mapbuffer: 84ea43c6c6232049135b1550b8c60b2faac19fab + react-native-app-auth: aafaa6e2934ceeb72d1f5a42962937ffeed9566c react-native-background-timer: 17ea5e06803401a379ebf1f20505b793ac44d0fe react-native-blob-jsi-helper: 13c10135af4614dbc0712afba5960784cd44f043 - react-native-blob-util: d8fa1a7f726867907a8e43163fdd8b441d4489ea + react-native-blob-util: 26f1fb0c91f2b437380d4f3875769a7c3e06080e react-native-cookies: f54fcded06bb0cda05c11d86788020b43528a26c - react-native-get-random-values: 384787fd76976f5aec9465aff6fa9e9129af1e74 - react-native-netinfo: 8a7fd3f7130ef4ad2fb4276d5c9f8d3f28d2df3d - react-native-pager-view: d81ab2060b9caf57ca8c3a0d57467ff407cdb825 - react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89 - react-native-skia: 8cadde22b1487f3f037d1529e2adc2ec2612d055 + react-native-get-random-values: 21325b2244dfa6b58878f51f9aa42821e7ba3d06 + react-native-netinfo: bdb108d340cdb41875c9ced535977cac6d2ff321 + react-native-pager-view: 0eb900a8c5d83c02a74b0125d4b5f9fdcc5b8f44 + react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b + react-native-skia: 78677b7285efd5081bab86275528dcf79829d685 react-native-svga-player: f1c7faf0864b22437b9b7cc7d7aa202d56f3906c react-native-track-player: 97d76dbbd35f27cc709e5f04540615e54264b3f9 - react-native-video: c26780b224543c62d5e1b2a7244a5cd1b50e8253 - react-native-webview: f95eb7d4d6a7ca45d04d861d99f628241b2aff83 - React-nativeconfig: 4d3076dc3dc498ec49819e4e4225b55d3507f902 - React-NativeModulesApple: 46f14baf36010b22ffd84fd89d5586e4148edfb3 - React-perflogger: 27ccacf853ba725524ef2b4e444f14e34d0837b0 - React-RCTActionSheet: 77dd6a2a5cfab9e85b7f1add0f7e2e9cd697d936 - React-RCTAnimation: 977a25a4e8007ecc90e556abcceb1b25602eea7c - React-RCTAppDelegate: 252a478047dbc9d0ac0dcda7440b4d3fbb6184a4 - React-RCTBlob: 1e18ab09f57cf3bd2b9681cbeedfca866d971f50 - React-RCTFabric: f09af5b9aac819d8c362ef3030b2d16be426c176 - React-RCTImage: b1eac9526111cf7e37c304f94e81b76a5ae6a984 - React-RCTLinking: d7f7dc665af6442ff38e18e34308da7865347bb1 - React-RCTNetwork: c2c1df3a3c838e9547259e3638f6b290aebb3b72 - React-RCTSettings: f3074b14047a57fa95499c28fb89028a894d3c18 - React-RCTText: 9d48b2bbce5e1ed9c4d9514414dc6d99731d1b0a - React-RCTVibration: 394ea84082b08b5b3c211dc2bc9c0c4c163e7f23 - React-rendererdebug: 3445e5d7d8fa3c66974d779b6a77b41186224b0f - React-rncore: bfb1b25c3e6ce9535708a7ac109c91fed3c8085b - React-runtimeexecutor: 7e71a40def8262ef7d82a1145d873ea61b1a27b5 - React-runtimescheduler: aa382ce525689b88459e1181b3649220f175dc31 - React-utils: b22b4a51aa578b3aac1e7c19501c0b9ba358ed79 - ReactCommon: e708b8be8cb317b83e31c6ccfeda8bf6c0d1a2b3 - RNCAsyncStorage: 618d03a5f52fbccb3d7010076bc54712844c18ef - RNFlashList: 4b4b6b093afc0df60ae08f9cbf6ccd4c836c667a - RNGestureHandler: 25b969a1ffc806b9f9ad2e170d4a3b049c6af85e - RNReanimated: 5589be82dc26b3f94738eb7c6b1f942787532b25 - RNScreens: b582cb834dc4133307562e930e8fa914b8c04ef2 + react-native-video: df7d8a4c8568ed4a31b28e6cd2bfa4a98b186e36 + react-native-webview: 9395e82c917d81407deb9b1fe53158dd6c8880ff + React-nativeconfig: b4d4e9901d4cabb57be63053fd2aa6086eb3c85f + React-NativeModulesApple: cd26e56d56350e123da0c1e3e4c76cb58a05e1ee + React-perflogger: 5f49905de275bac07ac7ea7f575a70611fa988f2 + React-RCTActionSheet: 37edf35aeb8e4f30e76c82aab61f12d1b75c04ec + React-RCTAnimation: a69de7f3daa8462743094f4736c455e844ea63f7 + React-RCTAppDelegate: 51fb96b554a6acd0cd7818acecd5aa5ca2f3ab9f + React-RCTBlob: d91771caebf2d015005d750cd1dc2b433ad07c99 + React-RCTFabric: c5b9451d1f2b546119b7a0353226a8a26247d4a9 + React-RCTImage: a0bfe87b6908c7b76bd7d74520f40660bd0ad881 + React-RCTLinking: 5f10be1647952cceddfa1970fdb374087582fc34 + React-RCTNetwork: a0bc3dd45a2dc7c879c80cebb6f9707b2c8bbed6 + React-RCTSettings: 28c202b68afa59afb4067510f2c69c5a530fb9e3 + React-RCTText: 4119d9e53ca5db9502b916e1b146e99798986d21 + React-RCTVibration: 55bd7c48487eb9a2562f2bd3fdc833274f5b0636 + React-rendererdebug: 5fa97ba664806cee4700e95aec42dff1b6f8ea36 + React-rncore: b0a8e1d14dabb7115c7a5b4ec8b9b74d1727d382 + React-runtimeexecutor: bb328dbe2865f3a550df0240df8e2d8c3aaa4c57 + React-runtimescheduler: 9636eee762c699ca7c85751a359101797e4c8b3b + React-utils: d16c1d2251c088ad817996621947d0ac8167b46c + ReactCommon: 2aa35648354bd4c4665b9a5084a7d37097b89c10 + RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c + RNFlashList: b521ebdd7f9352673817f1d98e8bdc0c8cf8545b + RNGestureHandler: bc2cdb2dc42facdf34992ae364b8a728e19a3686 + RNReanimated: 8a4d86eb951a4a99d8e86266dc71d7735c0c30a9 + RNScreens: b6b64d956af3715adbfe84808694ae82d3fec74f + RNSentry: 5381e9284aec59a546e4a7d40e33ad0839b99c1e RNShareMenu: cb9dac548c8bf147d06f0bf07296ad51ea9f5fc3 RNSnackbar: 3727b42bf6c4314a53c18185b5203e915a4ab020 - RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a - RNVectorIcons: 210f910e834e3485af40693ad4615c1ec22fc02b + RNSVG: 50cf2c7018e57cf5d3522d98d0a3a4dd6bf9d093 + RNVectorIcons: 73ab573085f65a572d3b6233e68996d4707fd505 SDWebImage: 750adf017a315a280c60fde706ab1e552a3ae4e9 SDWebImageAVIFCoder: 8348fef6d0ec69e129c66c9fe4d74fbfbf366112 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SDWebImageWebPCoder: af09429398d99d524cae2fe00f6f0f6e491ed102 + Sentry: ebc12276bd17613a114ab359074096b6b3725203 + SentryPrivate: d651efb234cf385ec9a1cdd3eff94b5e78a0e0fe SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 + SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef SVGAPlayer: 318b85a78b61292d6ae9dfcd651f3f0d1cdadd86 SwiftAudioEx: 6f511018b7a0fdfd14ed1bb4081f953588245cc0 - Yoga: ff0382b894475dba0b4d2a5fda860bfee5a9afad + Yoga: 805bf71192903b20fc14babe48080582fee65a80 PODFILE CHECKSUM: fef0f8dbf24db5daee1f2f1bdb771d050baf4487 -COCOAPODS: 1.12.1 +COCOAPODS: 1.15.2 diff --git a/ios/sentry.properties.example b/ios/sentry.properties.example new file mode 100644 index 00000000..de50cdbb --- /dev/null +++ b/ios/sentry.properties.example @@ -0,0 +1,4 @@ +defaults.url=https://sentry.io/ +defaults.org=example-org +defaults.project=example-project +auth.token=sntrys_YOUR_TOKEN_HERE \ No newline at end of file diff --git a/package.json b/package.json index ec0ed89a..fea698e9 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-community/netinfo": "^11.3.1", "@react-native-cookies/cookies": "^6.2.1", + "@react-native-masked-view/masked-view": "^0.3.1", "@react-native/babel-preset": "^0.75.0-main", "@react-native/metro-config": "^0.75.0-main", "@react-navigation/drawer": "^6.6.15", @@ -55,7 +56,7 @@ "dayjs": "^1.11.9", "deepmerge": "^4.3.1", "dropbox": "git+https://lovegaoshi@github.com/lovegaoshi/dropbox-sdk-js.git", - "expo": "^50.0.14", + "expo": "^50.0.15", "expo-clipboard": "~5.0.1", "expo-document-picker": "~11.10.1", "expo-image": "^1.10.6", @@ -64,7 +65,7 @@ "fflate": "^0.8.2", "ffmpeg-kit-react-native": "^6.0.2", "he": "^1.2.0", - "i18next": "^23.11.0", + "i18next": "^23.11.1", "libmuse": "git+https://github.com/lovegaoshi/muse.git#apm-release", "lottie-react-native": "^6.7.2", "lru-cache": "7.14.0", @@ -81,16 +82,16 @@ "react-native-blob-jsi-helper": "^0.3.1", "react-native-blob-util": "^0.19.8", "react-native-draggable-flatlist": "^4.0.1", - "react-native-gesture-handler": "^2.16.0", + "react-native-gesture-handler": "2.16.0", "react-native-get-random-values": "^1.11.0", - "react-native-lyric": "git+https://github.com/lovegaoshi/react-native-lyric.git", + "react-native-lyric": "git+https://github.com/lovegaoshi/react-native-lyric.git#dev", "react-native-pager-view": "^6.3.0", "react-native-paper": "^5.12.3", "react-native-qrcode-svg": "^6.3.0", "react-native-reanimated": "^3.8.1", "react-native-reanimated-carousel": "^3.5.1", "react-native-safe-area-context": "^4.9.0", - "react-native-screens": "3.30.1", + "react-native-screens": "3.29.0", "react-native-shadow-2": "^7.0.8", "react-native-share-menu": "git+https://github.com/lovegaoshi/react-native-share-menu.git", "react-native-snackbar": "^2.4.0", @@ -124,8 +125,8 @@ "@types/he": "^1.2.3", "@types/jest": "^29.5.12", "@types/md5": "^2.3.5", - "@types/node": "^20.12.5", - "@types/react": "^18.2.74", + "@types/node": "^20.12.7", + "@types/react": "^18.2.75", "@types/react-native": "^0.73.0", "@types/react-native-background-timer": "^2.0.2", "@types/react-native-share-menu": "^5.0.5", @@ -156,7 +157,7 @@ "react-test-renderer": "18.2.0", "reactotron-react-native": "^5.1.6", "rimraf": "^5.0.5", - "typescript": "5.4.4" + "typescript": "5.4.5" }, "engines": { "node": ">=18.0.0" diff --git a/src/App.tsx b/src/App.tsx index c700baf3..cea71f0d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -75,8 +75,8 @@ export default function App(appProps: NoxComponent.AppProps) { return ( - - + + {PIPMode ? ( ) : isLandscape ? ( @@ -84,8 +84,8 @@ export default function App(appProps: NoxComponent.AppProps) { ) : ( )} - - + + ); } diff --git a/src/AzusaPlayer.tsx b/src/AzusaPlayer.tsx index b45f054d..2ba3dc3a 100644 --- a/src/AzusaPlayer.tsx +++ b/src/AzusaPlayer.tsx @@ -26,12 +26,12 @@ import Playlist from './components/playlist/View'; import PlayerBottomPanel from './components/player/controls/PlayerProgressControls'; import { useNoxSetting } from '@stores/useApp'; import PlaylistDrawer from './components/playlists/View'; -import { ViewEnum } from './enums/View'; +import { NoxRoutes } from './enums/Routes'; import Settings from './components/setting/View'; import Explore from './components/explore/View'; import './localization/i18n'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import { ICONS } from '@enums/Icons'; +import { ScreenIcons } from '@enums/Icons'; import NoxBottomTab from './components/bottomtab/NoxBottomTab'; const { LightTheme, DarkTheme } = adaptNavigationTheme({ @@ -55,12 +55,12 @@ const NoxPlayer = ({ navigation, setNavigation = () => undefined }: Props) => { @@ -113,30 +113,34 @@ const AzusaPlayer = () => { }} > , + drawerIcon: () => , title: String(t('appDrawer.homeScreenName')), header: () => null, }} component={NoxPlayerWrapper} /> , + drawerIcon: () => ( + + ), title: String(t('appDrawer.exploreScreenName')), }} component={Explore} /> , + drawerIcon: () => ( + + ), title: String(t('appDrawer.settingScreenName')), header: () => null, }} diff --git a/src/components/background/MainBackground.tsx b/src/components/background/MainBackground.tsx index cbb0cdfe..4615f8a3 100644 --- a/src/components/background/MainBackground.tsx +++ b/src/components/background/MainBackground.tsx @@ -13,7 +13,7 @@ import resolveBackgroundImage, { const MainBackground = ({ children }: { children: React.JSX.Element }) => { const playerStyle = useNoxSetting(state => state.playerStyle); const isLandscape = useIsLandscape(); - const mobileHeight = Dimensions.get('window').height; + const { width, height } = Dimensions.get('window'); const [bkgrdImg, setBkgrdImg] = useState(); const bkgrdImgRaw = isLandscape && playerStyle.bkgrdImgLandscape @@ -30,7 +30,7 @@ const MainBackground = ({ children }: { children: React.JSX.Element }) => { { uri: bkgrdImg.identifier, headers: customReqHeader(bkgrdImg.identifier, {}), }} - style={{ width: '100%', height: '100%', position: 'absolute' }} + style={[styles.videoStyle, { width, height }]} onError={e => { logger.error(JSON.stringify(e)); logger.error( @@ -90,8 +90,6 @@ const styles = StyleSheet.create({ flex: 1, }, videoStyle: { - width: '100%', - height: '100%', position: 'absolute', }, fullscreenStyle: { diff --git a/src/components/bottomtab/NoxBottomTab.tsx b/src/components/bottomtab/NoxBottomTab.tsx index 23b94a0c..f60867f6 100644 --- a/src/components/bottomtab/NoxBottomTab.tsx +++ b/src/components/bottomtab/NoxBottomTab.tsx @@ -4,7 +4,7 @@ import { IconButton } from 'react-native-paper'; import { useNavigation } from '@react-navigation/native'; import { getDrawerStatusFromState } from '@react-navigation/drawer'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import { useNoxSetting } from '@stores/useApp'; interface IconProps { @@ -22,7 +22,7 @@ const BottomIconButton = ({ icon, onPress }: IconProps) => { ); }; -enum Routes { +enum RouteIcons { playlist = 'playlist-music', music = 'music-note', explore = 'compass', @@ -42,7 +42,7 @@ const NoxAndroidBottomTab = ({ navigation }: NoxComponent.NavigationProps2) => { const onDrawerPress = () => { if (navigation === undefined) return; - setRoute(Routes.playlist); + setRoute(RouteIcons.playlist); if (isDrawerOpen()) { navigation.closeDrawer(); return; @@ -50,7 +50,7 @@ const NoxAndroidBottomTab = ({ navigation }: NoxComponent.NavigationProps2) => { navigation.openDrawer(); }; - const renderIcon = (icon: Routes) => + const renderIcon = (icon: RouteIcons) => route === icon ? icon : `${icon}-outline`; if (gestureMode) { @@ -63,28 +63,28 @@ const NoxAndroidBottomTab = ({ navigation }: NoxComponent.NavigationProps2) => { ]} > { - navigationGlobal.navigate(ViewEnum.PLAYER_HOME as never); - setRoute(Routes.music); + navigationGlobal.navigate(NoxRoutes.PlayerHome as never); + setRoute(RouteIcons.music); }} /> { - navigationGlobal.navigate(ViewEnum.EXPORE as never); - setRoute(Routes.explore); + navigationGlobal.navigate(NoxRoutes.Explore as never); + setRoute(RouteIcons.explore); }} /> { - navigationGlobal.navigate(ViewEnum.SETTINGS as never); - setRoute(Routes.setting); + navigationGlobal.navigate(NoxRoutes.Settings as never); + setRoute(RouteIcons.setting); }} /> diff --git a/src/components/dialogs/CopiedPlaylistDialog.tsx b/src/components/dialogs/CopiedPlaylistDialog.tsx index 3af1df86..80602c7d 100644 --- a/src/components/dialogs/CopiedPlaylistDialog.tsx +++ b/src/components/dialogs/CopiedPlaylistDialog.tsx @@ -50,7 +50,7 @@ export default ({ const playlistList = () => { const filteredPlaylists = - getState().playmode === NoxRepeatMode.SUGGEST + getState().playmode === NoxRepeatMode.Suggest ? playlistIds : playlistIds.filter(val => val !== fromList.id); return filteredPlaylists.map(val => [val, playlists[val].title]); @@ -58,7 +58,7 @@ export default ({ React.useEffect(() => { // TODO: this is not scrolling? - if (visible && getState().playmode === NoxRepeatMode.SUGGEST) { + if (visible && getState().playmode === NoxRepeatMode.Suggest) { playlistRef.current?.scrollToIndex({ index: playlistIds.indexOf(fromList.id), }); diff --git a/src/components/explore/SongRow.tsx b/src/components/explore/SongRow.tsx new file mode 100644 index 00000000..33d74f6d --- /dev/null +++ b/src/components/explore/SongRow.tsx @@ -0,0 +1,82 @@ +import * as React from 'react'; +import { View, Dimensions, FlatList, TouchableOpacity } from 'react-native'; +import { Text } from 'react-native-paper'; +import { Image } from 'expo-image'; +import { useNavigation } from '@react-navigation/native'; + +import { useNoxSetting } from '@stores/useApp'; +import usePlayback from '@hooks/usePlayback'; +import { NoxRoutes } from '@enums/Routes'; +import { BiliSongCardProp } from './SongTab'; + +export const BiliSongRow = ({ + songs = [], + title, + totalSongs, +}: BiliSongCardProp) => { + const navigationGlobal = useNavigation(); + const playerStyle = useNoxSetting(state => state.playerStyle); + const scroll = useNoxSetting(state => state.incSongListScrollCounter); + const { playAsSearchList } = usePlayback(); + + const fontColor = playerStyle.metaData.darkTheme ? 'white' : 'black'; + + return ( + + {title && ( + + {title} + + )} + ( + + { + navigationGlobal.navigate(NoxRoutes.Playlist as never); + playAsSearchList({ + songs: totalSongs || songs, + song: item, + }).then(() => setTimeout(scroll, 500)); + }} + > + + + + {item.name} + + + {item.singer} + + + + + )} + /> + + ); +}; diff --git a/src/components/explore/SongTab.tsx b/src/components/explore/SongTab.tsx new file mode 100644 index 00000000..77f120e1 --- /dev/null +++ b/src/components/explore/SongTab.tsx @@ -0,0 +1,163 @@ +import * as React from 'react'; +import { + View, + ScrollView, + Dimensions, + FlatList, + TouchableOpacity, +} from 'react-native'; +import { Text } from 'react-native-paper'; +import { Image } from 'expo-image'; +import { useTranslation } from 'react-i18next'; +import { useNavigation } from '@react-navigation/native'; + +import { chunkArray } from '@utils/Utils'; +import { useNoxSetting } from '@stores/useApp'; +import usePlayback from '@hooks/usePlayback'; +import { NoxRoutes } from '@enums/Routes'; + +export interface BiliCatSongs { + [key: number]: NoxMedia.Song[]; +} + +export interface BiliSongCardProp { + songs: NoxMedia.Song[]; + title?: string; + totalSongs?: NoxMedia.Song[]; +} + +export const BiliSongCard = ({ + songs = [], + title, + totalSongs, +}: BiliSongCardProp) => { + const navigationGlobal = useNavigation(); + const playerStyle = useNoxSetting(state => state.playerStyle); + const scroll = useNoxSetting(state => state.incSongListScrollCounter); + const { playAsSearchList } = usePlayback(); + + const fontColor = playerStyle.metaData.darkTheme ? 'white' : 'black'; + + return ( + + {title && {title}} + ( + + { + navigationGlobal.navigate(NoxRoutes.Playlist as never); + playAsSearchList({ + songs: totalSongs || songs, + song: item, + // HACK: oh well. + }).then(() => setTimeout(scroll, 500)); + }} + > + + + + {item.name} + + + {item.singer} + + + + + )} + /> + + ); +}; + +export const BiliSongCatsCard = ({ songs = {} }: { songs?: BiliCatSongs }) => { + const { t } = useTranslation(); + + return ( + + + {t('BiliCategory.ranking')} + + + {Object.keys(songs).map(k => ( + + ))} + + + + ); +}; + +export const BiliSongsTabCard = ({ + songs = {}, + title, +}: { + songs?: BiliCatSongs; + title: string; +}) => { + const concatSongs = Object.values(songs).reduce( + (acc, curr) => acc.concat(curr), + [] + ); + const splicedSongs: NoxMedia.Song[][] = chunkArray(concatSongs, 4); + + return ( + + + {title} + + + {splicedSongs.map((k, i) => ( + + ))} + + + + ); +}; diff --git a/src/components/explore/View.tsx b/src/components/explore/View.tsx index 07392dfd..08d51dc2 100644 --- a/src/components/explore/View.tsx +++ b/src/components/explore/View.tsx @@ -5,11 +5,11 @@ import { useNoxSetting } from '@stores/useApp'; import BiliExplore from './bilibili/View'; import { styles } from '../style'; -enum Routes { +enum NoxRoutes { bilibili = 'bilibili', } -const exploreContent = (route: Routes) => { +const exploreContent = (route: NoxRoutes) => { switch (route) { default: return ; @@ -17,7 +17,7 @@ const exploreContent = (route: Routes) => { }; export default () => { - const [currentRoute, setCurrentRoute] = React.useState(Routes.bilibili); + const [currentRoute, setCurrentRoute] = React.useState(NoxRoutes.bilibili); const playerStyle = useNoxSetting(state => state.playerStyle); return ( diff --git a/src/components/explore/bilibili/View.tsx b/src/components/explore/bilibili/View.tsx index 597bfccd..ceabf254 100644 --- a/src/components/explore/bilibili/View.tsx +++ b/src/components/explore/bilibili/View.tsx @@ -1,225 +1,13 @@ import * as React from 'react'; -import { - View, - ScrollView, - Dimensions, - FlatList, - TouchableOpacity, - RefreshControl, -} from 'react-native'; +import { View, ScrollView, RefreshControl } from 'react-native'; import { Text } from 'react-native-paper'; -import { Image } from 'expo-image'; import { useTranslation } from 'react-i18next'; -import { useNavigation } from '@react-navigation/native'; -import { chunkArray } from '@utils/Utils'; import { fetchDynamic } from '@utils/mediafetch/biliDynamic'; import { fetchRanking } from '@utils/mediafetch/biliRanking'; import { styles } from '@components/style'; -import { useNoxSetting } from '@stores/useApp'; -import usePlayback from '@hooks/usePlayback'; -import { ViewEnum } from '@enums/View'; - -interface BiliCatSongs { - [key: number]: NoxMedia.Song[]; -} - -interface BiliSongCardProp { - songs: NoxMedia.Song[]; - title?: string; - totalSongs?: NoxMedia.Song[]; -} - -const BiliSongRow = ({ songs = [], title, totalSongs }: BiliSongCardProp) => { - const navigationGlobal = useNavigation(); - const playerStyle = useNoxSetting(state => state.playerStyle); - const { playAsSearchList } = usePlayback(); - - const fontColor = playerStyle.metaData.darkTheme ? 'white' : 'black'; - - return ( - - {title && ( - - {title} - - )} - ( - - { - navigationGlobal.navigate(ViewEnum.PLAYER_PLAYLIST as never); - playAsSearchList({ songs: totalSongs || songs, song: item }); - }} - > - - - - {item.name} - - - {item.singer} - - - - - )} - /> - - ); -}; - -const BiliSongCard = ({ songs = [], title, totalSongs }: BiliSongCardProp) => { - const navigationGlobal = useNavigation(); - const playerStyle = useNoxSetting(state => state.playerStyle); - const { playAsSearchList } = usePlayback(); - - const fontColor = playerStyle.metaData.darkTheme ? 'white' : 'black'; - - return ( - - {title && {title}} - ( - - { - navigationGlobal.navigate(ViewEnum.PLAYER_PLAYLIST as never); - playAsSearchList({ songs: totalSongs || songs, song: item }); - }} - > - - - - {item.name} - - - {item.singer} - - - - - )} - /> - - ); -}; - -const BiliSongCatsCard = ({ songs = {} }: { songs?: BiliCatSongs }) => { - const { t } = useTranslation(); - - return ( - - - {t('BiliCategory.ranking')} - - - {Object.keys(songs).map(k => ( - - ))} - - - - ); -}; - -const BiliSongsTabCard = ({ - songs = {}, - title, -}: { - songs?: BiliCatSongs; - title: string; -}) => { - const concatSongs = Object.values(songs).reduce( - (acc, curr) => acc.concat(curr), - [] - ); - const splicedSongs: NoxMedia.Song[][] = chunkArray(concatSongs, 4); - - return ( - - - {title} - - - {splicedSongs.map((k, i) => ( - - ))} - - - - ); -}; +import { BiliCatSongs, BiliSongsTabCard } from '../SongTab'; +import { BiliSongRow } from '../SongRow'; export default () => { const { t } = useTranslation(); @@ -259,10 +47,10 @@ export default () => { } > - - Bilibili experimental discover page - + + {t('BiliCategory.dynamic')} + {Object.keys(biliDynamic).map((k, i) => ( { const onPlaylistPress = () => { navigationGlobal.navigate( - navigationGlobal.getState()?.routes?.at(-1)?.name === - ViewEnum.PLAYER_PLAYLIST - ? (ViewEnum.PLAYER_PLAYLISTS as never) - : (ViewEnum.PLAYER_PLAYLIST as never) + navigationGlobal.getState()?.routes?.at(-1)?.name === NoxRoutes.Playlist + ? (NoxRoutes.PlaylistsDrawer as never) + : (NoxRoutes.Playlist as never) ); }; @@ -31,7 +30,7 @@ export default ({ panelWidth = 110 }: Props) => { function deepLinkHandler(data: { url: string }) { if (data.url === 'trackplayer://notification.click') { logger.debug('[Drawer] click from notification; navigate to home'); - navigationGlobal.navigate(ViewEnum.PLAYER_HOME as never); + navigationGlobal.navigate(NoxRoutes.PlayerHome as never); } } // This event will be fired when the app is already open and the notification is clicked @@ -62,24 +61,24 @@ export default ({ panelWidth = 110 }: Props) => { /> navigationGlobal.navigate(ViewEnum.LYRICS as never)} + onPress={() => navigationGlobal.navigate(NoxRoutes.Lyrics as never)} /> navigationGlobal.navigate(ViewEnum.EXPORE as never)} + onPress={() => navigationGlobal.navigate(NoxRoutes.Explore as never)} /> navigationGlobal.navigate(ViewEnum.SETTINGS as never)} + onPress={() => navigationGlobal.navigate(NoxRoutes.Settings as never)} /> ); diff --git a/src/components/landscape/LandscapePlaylistPanel.tsx b/src/components/landscape/LandscapePlaylistPanel.tsx index 2c804b20..500da30e 100644 --- a/src/components/landscape/LandscapePlaylistPanel.tsx +++ b/src/components/landscape/LandscapePlaylistPanel.tsx @@ -1,7 +1,7 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { Dimensions, View } from 'react-native'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import DummySettings from '../setting/DummySettings'; import LandscapeLyricView from './LandscapeLyric'; import { SettingsLandscape as Settings } from '../setting/View'; @@ -26,27 +26,27 @@ export default ({ panelWidth }: Props) => { diff --git a/src/components/player/Lyric.tsx b/src/components/player/Lyric.tsx index a214c189..307c8f03 100644 --- a/src/components/player/Lyric.tsx +++ b/src/components/player/Lyric.tsx @@ -70,7 +70,10 @@ export const LyricView = ({ noScrollThrottle = true, onPress = () => undefined, }: LyricViewProps) => { - const { position } = useProgress(); + const playerSetting = useNoxSetting(state => state.playerSetting); + const { position } = useProgress( + playerSetting.karaokeLyrics ? 30 : undefined + ); const [lrc, setLrc] = useState('正在加载歌词...'); const [lrcOptions, setLrcOptions] = useState( [] @@ -255,6 +258,7 @@ export const LyricView = ({ height={height} noScrollThrottle={noScrollThrottle} onPress={onPress} + useMaskedView={playerSetting.karaokeLyrics} /> {showUI && ( <> diff --git a/src/components/player/PlayerTopInfo.tsx b/src/components/player/PlayerTopInfo.tsx index c4b285c5..771d480d 100644 --- a/src/components/player/PlayerTopInfo.tsx +++ b/src/components/player/PlayerTopInfo.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { View, StyleSheet } from 'react-native'; import { IconButton } from 'react-native-paper'; import { useNavigation } from '@react-navigation/native'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import { useNoxSetting } from '@stores/useApp'; import RandomGIFButton from '../buttons/RandomGIF'; @@ -30,9 +30,7 @@ export default ({ navigation }: NoxComponent.NavigationProps) => { - navigationGlobal.navigate(ViewEnum.PLAYER_PLAYLIST as never) - } + onPress={() => navigationGlobal.navigate(NoxRoutes.Playlist as never)} size={40} /> diff --git a/src/components/player/TrackInfo/SongMenu.tsx b/src/components/player/TrackInfo/SongMenu.tsx index 50582e1c..bd1e3e6a 100644 --- a/src/components/player/TrackInfo/SongMenu.tsx +++ b/src/components/player/TrackInfo/SongMenu.tsx @@ -12,7 +12,7 @@ import { addR128Gain, getR128Gain } from '@utils/ffmpeg/r128Store'; import ABSliderMenu from './ABSliderMenu'; import usePlayback from '@hooks/usePlayback'; -enum ICONS { +enum Icons { SEND_TO = 'playlist-plus', COPY_SONG_NAME = '', SEARCH_IN_PLAYLIST = 'text-search', @@ -111,7 +111,7 @@ export default ({ }} /> { closeMenu(); reloadSong(); @@ -119,7 +119,7 @@ export default ({ title={t('SongOperations.reloadSong')} /> { startRadio(song); @@ -128,7 +128,7 @@ export default ({ title={t('SongOperations.songStartRadio')} /> Alert.alert( `R128Gain of ${song.parsedName}`, @@ -145,7 +145,7 @@ export default ({ /> removeSongs(true)} title={t('SongOperations.songRemoveTitle')} /> diff --git a/src/components/player/controls/usePlayerControls.ts b/src/components/player/controls/usePlayerControls.ts index 631b1d47..41bf0f07 100644 --- a/src/components/player/controls/usePlayerControls.ts +++ b/src/components/player/controls/usePlayerControls.ts @@ -51,7 +51,7 @@ export default () => { event.position > Math.min(bRepeatDuration, event.duration) - fadeIntervalSec ) { - if (getState().playmode !== NoxRepeatMode.REPEAT_TRACK) { + if (getState().playmode !== NoxRepeatMode.RepeatTrack) { logger.debug( `[FADEOUT] fading out....${event.position} / ${event.duration}` ); @@ -63,7 +63,7 @@ export default () => { } if (abRepeat[1] === 1) return; if (event.position > bRepeatDuration) { - if (getState().playmode === NoxRepeatMode.REPEAT_TRACK) { + if (getState().playmode === NoxRepeatMode.RepeatTrack) { TrackPlayer.seekTo(abRepeat[0] * event.duration); return; } diff --git a/src/components/playlist/BiliSearch/BiliSearchbar.tsx b/src/components/playlist/BiliSearch/BiliSearchbar.tsx index aaf1e290..d6ae9f9f 100644 --- a/src/components/playlist/BiliSearch/BiliSearchbar.tsx +++ b/src/components/playlist/BiliSearch/BiliSearchbar.tsx @@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'; import ShareMenu, { ShareCallback } from 'react-native-share-menu'; import { useNavigation } from '@react-navigation/native'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import { useNoxSetting } from '@stores/useApp'; import usePlayback from '@hooks/usePlayback'; import useBiliSearch from '@hooks/useBiliSearch'; @@ -70,7 +70,7 @@ export default ({ }; const handleExternalSearch = (data: string) => { - navigationGlobal.navigate(ViewEnum.PLAYER_PLAYLIST as never); + navigationGlobal.navigate(NoxRoutes.Playlist as never); return handleSearch(data); }; diff --git a/src/components/playlist/BiliSearch/Icons.tsx b/src/components/playlist/BiliSearch/Icons.tsx index ff9be172..db1d0e6f 100644 --- a/src/components/playlist/BiliSearch/Icons.tsx +++ b/src/components/playlist/BiliSearch/Icons.tsx @@ -2,9 +2,9 @@ import * as React from 'react'; import Svg, { Path } from 'react-native-svg'; import { Image } from 'expo-image'; import { StyleSheet } from 'react-native'; -import { SEARCH_OPTIONS } from '@enums/Storage'; +import { SearchOptions } from '@enums/Storage'; -const ICONS = { +const Icons = { BILIBILI: () => ( { switch (icon) { - case SEARCH_OPTIONS.BILIBILI: - return ICONS.BILIBILI; - case SEARCH_OPTIONS.YOUTUBE: - return ICONS.YOUTUBE; + case SearchOptions.BILIBILI: + return Icons.BILIBILI; + case SearchOptions.YOUTUBE: + return Icons.YOUTUBE; default: - return ICONS.MUSICFREE; + return Icons.MUSICFREE; } }; -export default ICONS; +export default Icons; const style = StyleSheet.create({ musicFreeIcon: { width: 40, height: 40, marginLeft: -5, marginTop: 4 }, diff --git a/src/components/playlist/BiliSearch/SearchMenu.tsx b/src/components/playlist/BiliSearch/SearchMenu.tsx index 3a24a73d..593ddaef 100644 --- a/src/components/playlist/BiliSearch/SearchMenu.tsx +++ b/src/components/playlist/BiliSearch/SearchMenu.tsx @@ -4,10 +4,10 @@ import * as DocumentPicker from 'expo-document-picker'; import { Platform, NativeModules, PermissionsAndroid } from 'react-native'; import { useTranslation } from 'react-i18next'; -import { SEARCH_OPTIONS } from '@enums/Storage'; +import { SearchOptions } from '@enums/Storage'; import useAlert from '@components/dialogs/useAlert'; import { MUSICFREE } from '@utils/mediafetch/musicfree'; -import ICONS from './Icons'; +import Icons from './Icons'; import { useNoxSetting } from '@stores/useApp'; import { rgb2Hex } from '@utils/Utils'; @@ -32,7 +32,7 @@ export default ({ const { OneWayAlert } = useAlert(); const playerStyle = useNoxSetting(state => state.playerStyle); const setSearchOption = useNoxSetting(state => state.setSearchOption); - const setDefaultSearch = (defaultSearch: SEARCH_OPTIONS | MUSICFREE) => { + const setDefaultSearch = (defaultSearch: SearchOptions | MUSICFREE) => { toggleVisible(); setSearchOption(defaultSearch); }; @@ -71,25 +71,25 @@ export default ({ return ( setDefaultSearch(SEARCH_OPTIONS.BILIBILI)} + leadingIcon={Icons.BILIBILI} + onPress={() => setDefaultSearch(SearchOptions.BILIBILI)} title={'Bilibili'} /> setDefaultSearch(SEARCH_OPTIONS.YOUTUBE)} + leadingIcon={Icons.YOUTUBE} + onPress={() => setDefaultSearch(SearchOptions.YOUTUBE)} title={'Youtube'} /> {showMusicFree && ( setDefaultSearch(MUSICFREE.aggregated)} title={`MusicFree.${MUSICFREE.aggregated}`} /> )} {Platform.OS === 'android' && ( ICONS.LOCAL(rgb2Hex(playerStyle.colors.primary))} + leadingIcon={() => Icons.LOCAL(rgb2Hex(playerStyle.colors.primary))} onPress={chooseLocalFolderAndroid} title={t('Menu.local')} /> diff --git a/src/components/playlist/Menu/PlaylistMenu.tsx b/src/components/playlist/Menu/PlaylistMenu.tsx index 6cc26d81..fe7258f6 100644 --- a/src/components/playlist/Menu/PlaylistMenu.tsx +++ b/src/components/playlist/Menu/PlaylistMenu.tsx @@ -4,11 +4,11 @@ import { useTranslation } from 'react-i18next'; import usePlaylist from './usePlaylistMenu'; import PlaylistSettingsButton from './PlaylistSettingsButton'; -import { PLAYLIST_ENUMS } from '@enums/Playlist'; +import { PlaylistTypes } from '@enums/Playlist'; import { CopiedPlaylistMenuItem } from '@components/buttons/CopiedPlaylistButton'; import PlaylistSortButton from './PlaylistSortButton'; -enum ICONS { +enum Icons { SETTINGS = 'cog', BILISHAZAM = 'magnify-plus', REMOVE_BILISHAZAM = 'magnify-close', @@ -47,8 +47,7 @@ export default ({ playlistBiliShazam, sortPlaylist, } = usePlaylist({ callback: toggleVisible }); - const limitedPlaylistFeatures = - playlist.type !== PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST; + const limitedPlaylistFeatures = playlist.type !== PlaylistTypes.Typical; return ( @@ -69,40 +68,40 @@ export default ({ onCancel={toggleVisible} /> playlistSync2Bilibili()} title={t('PlaylistOperations.bilisyncTitle')} /> playlistBiliShazam()} title={t('PlaylistOperations.bilishazamTitle')} /> playlistAnalyze()} title={t('PlaylistOperations.analyticsTitle')} /> playlistCleanup()} title={t('PlaylistOperations.removeBrokenTitle')} disabled={limitedPlaylistFeatures} /> confirmOnPlaylistReload()} title={t('PlaylistOperations.reloadBVIDTitle')} disabled={limitedPlaylistFeatures} /> confirmOnPlaylistClear()} title={t('PlaylistOperations.clearPlaylistTitle')} disabled={limitedPlaylistFeatures} /> confirmOnPlaylistDelete()} title={t('PlaylistOperations.removePlaylistTitle')} disabled={limitedPlaylistFeatures} diff --git a/src/components/playlist/Menu/PlaylistSortButton.tsx b/src/components/playlist/Menu/PlaylistSortButton.tsx index 541ad0c2..1b36cf33 100644 --- a/src/components/playlist/Menu/PlaylistSortButton.tsx +++ b/src/components/playlist/Menu/PlaylistSortButton.tsx @@ -3,7 +3,7 @@ import { Menu, Checkbox, Text } from 'react-native-paper'; import { useTranslation } from 'react-i18next'; import Dialog from '@components/dialogs/GenericSelectDialog'; -import { SORT_OPTIONS } from '@enums/Playlist'; +import { SortOptions } from '@enums/Playlist'; import { StyleSheet } from 'react-native-windows'; import { View } from 'react-native'; @@ -12,7 +12,7 @@ const ICON = 'sort'; interface Props { onCancel?: () => void; sortPlaylist: ( - sortOptions: SORT_OPTIONS, + sortOptions: SortOptions, ascending: boolean, playlist: NoxMedia.Playlist ) => void; @@ -27,7 +27,7 @@ export default ({ const { t } = useTranslation(); const [dialogOpen, setDialogOpen] = useState(false); const [ascending, setAscending] = useState(false); - const sortOptions = Object.entries(SORT_OPTIONS); + const sortOptions = Object.entries(SortOptions); const handleClose = () => { setDialogOpen(false); diff --git a/src/components/playlist/SongList/SongInfo.tsx b/src/components/playlist/SongList/SongInfo.tsx index c7739903..479fa57f 100644 --- a/src/components/playlist/SongList/SongInfo.tsx +++ b/src/components/playlist/SongList/SongInfo.tsx @@ -8,7 +8,7 @@ import { import { View, GestureResponderEvent, StyleSheet } from 'react-native'; import { useNoxSetting } from '@stores/useApp'; import { seconds2MMSS } from '@utils/Utils'; -import { PLAYLIST_ENUMS } from '@enums/Playlist'; +import { PlaylistTypes } from '@enums/Playlist'; import NoxCache from '@utils/Cache'; interface UsePlaylist { @@ -47,8 +47,7 @@ const SongInfo = ({ ); const title = - playerSetting.parseSongName && - currentPlaylist.type !== PLAYLIST_ENUMS.TYPE_SEARCH_PLAYLIST + playerSetting.parseSongName && currentPlaylist.type !== PlaylistTypes.Search ? item.parsedName : item.name; const id = item.id; diff --git a/src/components/playlist/SongList/SongList.tsx b/src/components/playlist/SongList/SongList.tsx index 8316512c..d6e7f52a 100644 --- a/src/components/playlist/SongList/SongList.tsx +++ b/src/components/playlist/SongList/SongList.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { View, BackHandler, StyleSheet } from 'react-native'; import { FlashList } from '@shopify/flash-list'; import { IconButton } from 'react-native-paper'; @@ -19,6 +19,9 @@ const PlaylistList = () => { const currentPlayingId = useNoxSetting(state => state.currentPlayingId); const playerStyle = useNoxSetting(state => state.playerStyle); const currentPlaylist = useNoxSetting(state => state.currentPlaylist); + const songListScrollCounter = useNoxSetting( + state => state.songListScrollCounter + ); const usedPlaylist = usePlaylist(currentPlaylist); const { refreshPlaylist, @@ -42,6 +45,8 @@ const PlaylistList = () => { const [contentViewHeight, setContentViewHeight] = useState(0); const [scrollPositionY, setScrollPositionY] = useState(0); + useEffect(() => scrollTo(), [songListScrollCounter]); + useFocusEffect( React.useCallback(() => { const subscription = BackHandler.addEventListener( diff --git a/src/components/playlist/SongList/SongMenu.tsx b/src/components/playlist/SongList/SongMenu.tsx index dce7f29c..6d5b295c 100644 --- a/src/components/playlist/SongList/SongMenu.tsx +++ b/src/components/playlist/SongList/SongMenu.tsx @@ -8,10 +8,10 @@ import { CopiedPlaylistMenuItem } from '@components/buttons/CopiedPlaylistButton import RenameSongButton from '@components/player/TrackInfo/RenameSong/RenameSongButton'; import useSongOperations from '@hooks/useSongOperations'; import { SearchRegex } from '@enums/Playlist'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import useBiliSearch from '@hooks/useBiliSearch'; -enum ICONS { +enum Icons { SEND_TO = 'playlist-plus', COPY_SONG_NAME = '', SEARCH_IN_PLAYLIST = 'text-search', @@ -108,7 +108,7 @@ export default ({ usePlaylist, prepareForLayoutAnimationRender }: Props) => { }} /> { startRadio(selectedSongs()[0]); @@ -117,7 +117,7 @@ export default ({ usePlaylist, prepareForLayoutAnimationRender }: Props) => { title={t('SongOperations.songStartRadio')} /> { searchAndEnableSearch( `${SearchRegex.absoluteMatch.text}${ @@ -130,9 +130,9 @@ export default ({ usePlaylist, prepareForLayoutAnimationRender }: Props) => { disabled={checking} title={t('SongOperations.songSearchInPlaylistTitle')} /> - {selectedSongs()[0]?.source === SOURCE.bilivideo && ( + {selectedSongs()[0]?.source === Source.bilivideo && ( { const song = selectedSongs()[0]; setSearchVal(song.bvid); @@ -144,18 +144,18 @@ export default ({ usePlaylist, prepareForLayoutAnimationRender }: Props) => { /> )} removeSongs()} title={t('SongOperations.songRemoveTitle')} /> removeSongs(true)} title={t('SongOperations.songRemoveNBanTitle')} /> {__DEV__ && ( console.log(selectedSongs())} title={'console.log'} /> diff --git a/src/components/playlist/usePlaylistRN.ts b/src/components/playlist/usePlaylistRN.ts index 0cdec4f6..504780b8 100644 --- a/src/components/playlist/usePlaylistRN.ts +++ b/src/components/playlist/usePlaylistRN.ts @@ -7,7 +7,7 @@ import { useNetInfo } from '@react-native-community/netinfo'; import { activateKeepAwakeAsync, deactivateKeepAwake } from 'expo-keep-awake'; import { useNoxSetting } from '@stores/useApp'; -import { PLAYLIST_ENUMS, SearchRegex } from '@enums/Playlist'; +import { PlaylistTypes, SearchRegex } from '@enums/Playlist'; import usePlaylist from '@hooks/usePlaylist'; import logger from '@utils/Logger'; import noxCache, { noxCacheKey } from '@utils/Cache'; @@ -147,7 +147,7 @@ export default (playlist: NoxMedia.Playlist) => { useEffect(() => { if ( playerSetting.autoRSSUpdate && - playlist.type === PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST && + playlist.type === PlaylistTypes.Typical && playlist.subscribeUrl.length > 0 && playlist.subscribeUrl[0].length > 0 && new Date().getTime() - playlist.lastSubscribed > 86400000 diff --git a/src/components/playlists/Playlists.tsx b/src/components/playlists/Playlists.tsx index ee833154..1b1a5f05 100644 --- a/src/components/playlists/Playlists.tsx +++ b/src/components/playlists/Playlists.tsx @@ -8,11 +8,11 @@ import DraggableFlatList, { } from 'react-native-draggable-flatlist'; import { useNoxSetting } from '@stores/useApp'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import AddPlaylistButton, { AddPlaylistButtonRef, } from '../buttons/AddPlaylistButton'; -import { STORAGE_KEYS } from '@enums/Storage'; +import { StorageKeys } from '@enums/Storage'; import NewPlaylistDialog from '../dialogs/NewPlaylistDialog'; import useAlert from '../dialogs/useAlert'; import ShuffleAllButton from '@components/playlists/ShuffleAllButton'; @@ -51,7 +51,7 @@ export default () => { const goToPlaylist = (playlistId: string) => { setCurrentPlaylist(playlists[playlistId]); - navigation.navigate(ViewEnum.PLAYER_PLAYLIST as never); + navigation.navigate(NoxRoutes.Playlist as never); }; const SearchPlaylistAsNewButton = () => ( @@ -109,7 +109,7 @@ export default () => { goToPlaylist(STORAGE_KEYS.FAVORITE_PLAYLIST_KEY)} + onPress={() => goToPlaylist(StorageKeys.FAVORITE_PLAYLIST_KEY)} /> @@ -118,29 +118,29 @@ export default () => { {false && ( navigation.navigate(ViewEnum.SETTINGS as never)} + onPress={() => navigation.navigate(NoxRoutes.Settings as never)} /> )} goToPlaylist(STORAGE_KEYS.SEARCH_PLAYLIST_KEY)} + onPress={() => goToPlaylist(StorageKeys.SEARCH_PLAYLIST_KEY)} style={[ { backgroundColor: currentPlaylist.id === - playlists[STORAGE_KEYS.SEARCH_PLAYLIST_KEY]?.id + playlists[StorageKeys.SEARCH_PLAYLIST_KEY]?.id ? playerStyle.customColors.playlistDrawerBackgroundColor : undefined, }, ]} > { setNewPlaylistDialogOpen(false)} onSubmit={() => setNewPlaylistDialogOpen(false)} /> diff --git a/src/components/playlists/ShuffleAllButton.tsx b/src/components/playlists/ShuffleAllButton.tsx index 1895739b..994c06e6 100644 --- a/src/components/playlists/ShuffleAllButton.tsx +++ b/src/components/playlists/ShuffleAllButton.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { IconButton } from 'react-native-paper'; import { useNavigation } from '@react-navigation/native'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import usePlayback from '@hooks/usePlayback'; export default () => { @@ -9,7 +9,7 @@ export default () => { const { shuffleAll } = usePlayback(); const onPressed = async () => { await shuffleAll(); - navigation.navigate(ViewEnum.PLAYER_HOME as never); + navigation.navigate(NoxRoutes.PlayerHome as never); }; return ; diff --git a/src/components/playlists/View.tsx b/src/components/playlists/View.tsx index 1f4467e1..dd7edc60 100644 --- a/src/components/playlists/View.tsx +++ b/src/components/playlists/View.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next'; import { useNoxSetting } from '@stores/useApp'; import useAAPlayback from '@hooks/useAAPlayback'; -import { ViewEnum } from '@enums/View'; +import { NoxRoutes } from '@enums/Routes'; import { logger } from '@utils/Logger'; import Playlists from './Playlists'; @@ -61,7 +61,7 @@ export default (props: any) => { function deepLinkHandler(data: { url: string }) { if (data.url === 'trackplayer://notification.click') { logger.debug('[Drawer] click from notification; navigate to home'); - navigation.navigate(ViewEnum.PLAYER_HOME as never); + navigation.navigate(NoxRoutes.PlayerHome as never); } } @@ -79,18 +79,18 @@ export default (props: any) => { diff --git a/src/components/setting/DeveloperSettings.tsx b/src/components/setting/DeveloperSettings.tsx index d6a5848e..952ec4c9 100644 --- a/src/components/setting/DeveloperSettings.tsx +++ b/src/components/setting/DeveloperSettings.tsx @@ -26,7 +26,7 @@ import PluginSettings from './plugins/View'; import showLog from './debug/Log'; import { showDebugLog } from './debug/DebugConsole'; -enum ICONS { +enum Icons { setlog = 'console', update = 'update', showlog = 'bug', @@ -60,6 +60,10 @@ const developerSettings: { [key: string]: SettingEntry } = { settingName: 'keepForeground', settingCategory: 'GeneralSettings', }, + karaokeLyrics: { + settingName: 'karaokeLyrics', + settingCategory: 'GeneralSettings', + }, /** chatGPTSongName: { settingName: 'chatGPTResolveSongName', @@ -166,36 +170,37 @@ const Home = ({ navigation }: NoxComponent.NavigationProps) => { + navigation.navigate(VIEW.PLUGINS)} settingCategory="Settings" /> {!APPSTORE && ( checkVersion(false)} settingCategory="DeveloperSettings" /> )} showLog()} settingCategory="DeveloperSettings" /> { } /> `${val}: ${fadeIntervalMs}ms`} /> { } /> { } /> Promise; } const SyncButton = ({ location, restoreFromUint8Array }: SyncInterface) => { switch (location) { - case EXPORT_OPTIONS.LOCAL: + case SyncOptions.LOCAL: return <>; - case EXPORT_OPTIONS.DROPBOX: + case SyncOptions.DROPBOX: return ( ); - case EXPORT_OPTIONS.PERSONAL: + case SyncOptions.PERSONAL: return ( ); - case EXPORT_OPTIONS.GITEE: + case SyncOptions.GITEE: return ; default: return <>; @@ -59,13 +59,13 @@ export default () => { const renderOption = (option = playerSetting.settingExportLocation) => { switch (option) { - case EXPORT_OPTIONS.LOCAL: + case SyncOptions.LOCAL: return t('Sync.Local'); - case EXPORT_OPTIONS.DROPBOX: + case SyncOptions.DROPBOX: return t('Sync.Dropbox'); - case EXPORT_OPTIONS.PERSONAL: + case SyncOptions.PERSONAL: return t('Sync.PersonalCloud'); - case EXPORT_OPTIONS.GITEE: + case SyncOptions.GITEE: return t('Sync.Gitee'); default: return 'ERROR'; diff --git a/src/components/setting/View.tsx b/src/components/setting/View.tsx index dd408744..b719af62 100644 --- a/src/components/setting/View.tsx +++ b/src/components/setting/View.tsx @@ -14,7 +14,7 @@ import AboutSettings from './AboutSettings'; import SplashSettings from './SplashSettings'; import Bilibili from '../login/Bilibili'; -enum ICONS { +enum Icons { HOME = 'cog', SKIN = 'palette', BACKUP = 'backup-restore', @@ -55,44 +55,44 @@ const HomeSettings = ({ navigation }: Props) => { > navigation.navigate(VIEW.GENERAL)} settingCategory="Settings" /> navigation.navigate(VIEW.SKIN)} settingCategory="Settings" /> navigation.navigate(VIEW.LOGIN)} settingCategory="Settings" /> navigation.navigate(VIEW.BACKUP)} settingCategory="Settings" /> - + navigation.navigate(VIEW.DEVELOPER)} settingCategory="Settings" /> navigation.navigate(VIEW.SPLASH_GALLARY)} settingCategory="Settings" /> navigation.navigate(VIEW.INFO)} settingCategory="Settings" diff --git a/src/components/setting/sync/useSync.ts b/src/components/setting/sync/useSync.ts index 5ebbe389..8137b7ba 100644 --- a/src/components/setting/sync/useSync.ts +++ b/src/components/setting/sync/useSync.ts @@ -13,7 +13,7 @@ import { addImportedPlaylist, } from '@utils/ChromeStorage'; import useInitializeStore from '@stores/initializeStores'; -import { STORAGE_KEYS } from '@enums/Storage'; +import { StorageKeys } from '@enums/Storage'; /** * this hook will handle all sync back from file operations. it will @@ -54,7 +54,7 @@ const useSync = () => { onPress: async () => { setSyncCheckVisible(true); setNoxExtensionContent( - parsedContent[STORAGE_KEYS.MY_FAV_LIST_KEY].map( + parsedContent[StorageKeys.MY_FAV_LIST_KEY].map( (val: any) => parsedContent[val].title || parsedContent[val].info.title ) diff --git a/src/enums/Icons.ts b/src/enums/Icons.ts index 7deb6f73..cefbe451 100644 --- a/src/enums/Icons.ts +++ b/src/enums/Icons.ts @@ -1,6 +1,6 @@ -export enum ICONS { - homeScreen = 'home', - exploreScreen = 'compass', - settingScreen = 'cog', - playlistScreen = 'playlist-music', +export enum ScreenIcons { + HomeScreen = 'home', + ExploreScreen = 'compass', + SettingScreen = 'cog', + PlaylistScreen = 'playlist-music', } diff --git a/src/enums/Intent.ts b/src/enums/Intent.ts index b46b03af..ca2b2648 100644 --- a/src/enums/Intent.ts +++ b/src/enums/Intent.ts @@ -1,4 +1,4 @@ -export enum INTENT_DATA { - resume = 'resume', - playAll = 'play_all', +export enum IntentData { + Resume = 'resume', + PlayAll = 'play_all', } diff --git a/src/enums/MediaFetch.ts b/src/enums/MediaFetch.ts index f4f01963..bc900135 100644 --- a/src/enums/MediaFetch.ts +++ b/src/enums/MediaFetch.ts @@ -1,4 +1,4 @@ -export enum SOURCE { +export enum Source { biliaudio = 'biliaudio', bilivideo = 'bilivideo', steriatk = 'steriatk', diff --git a/src/enums/Playlist.ts b/src/enums/Playlist.ts index 4b6ae4fd..6bbd4f66 100644 --- a/src/enums/Playlist.ts +++ b/src/enums/Playlist.ts @@ -1,7 +1,7 @@ -export enum PLAYLIST_ENUMS { - TYPE_TYPICA_PLAYLIST = 'typical', - TYPE_SEARCH_PLAYLIST = 'search', - TYPE_FAVORI_PLAYLIST = 'favorite', +export enum PlaylistTypes { + Typical = 'typical', + Search = 'search', + Favorite = 'favorite', } export const SearchRegex: { [key: string]: { regex: RegExp; text: string } } = { @@ -11,10 +11,10 @@ export const SearchRegex: { [key: string]: { regex: RegExp; text: string } } = { cachedMatch: { regex: /Cached:/, text: 'Cached:' }, }; -export enum SORT_OPTIONS { - TITLE = 'title', - ARTIST = 'artist', - ALBUM = 'album', - DATE = 'date', - PREVIOUS_ORDER = 'previous', +export enum SortOptions { + Title = 'title', + Artist = 'artist', + Album = 'album', + Date = 'date', + PreviousOrder = 'previous', } diff --git a/src/enums/RepeatMode.ts b/src/enums/RepeatMode.ts index de1cc7bf..51d1bf28 100644 --- a/src/enums/RepeatMode.ts +++ b/src/enums/RepeatMode.ts @@ -2,8 +2,8 @@ * these values are also react-native-vector-icon names. */ export enum NoxRepeatMode { - SHUFFLE = 'shuffle', - REPEAT = 'repeat', - REPEAT_TRACK = 'repeat-once', - SUGGEST = 'dice-multiple', + Shuffle = 'shuffle', + Repeat = 'repeat', + RepeatTrack = 'repeat-once', + Suggest = 'dice-multiple', } diff --git a/src/enums/Routes.ts b/src/enums/Routes.ts new file mode 100644 index 00000000..69782f60 --- /dev/null +++ b/src/enums/Routes.ts @@ -0,0 +1,10 @@ +export enum NoxRoutes { + PlayerHome = 'NoxHome', + Settings = 'NoxSettings', + PlayerCover = 'NoxCover', + Playlist = 'NoxPlaylist', + PlaylistsDrawer = 'NoxPlaylists', + UserLogin = 'NoxLogin', + Explore = 'NoxExplore', + Lyrics = 'NoxLyrics', +} diff --git a/src/enums/Storage.ts b/src/enums/Storage.ts index 0a5be986..8413815e 100644 --- a/src/enums/Storage.ts +++ b/src/enums/Storage.ts @@ -1,10 +1,10 @@ import { NoxRepeatMode } from './RepeatMode'; -import { VERSIONS } from './Version'; -import { EXPORT_OPTIONS } from './Sync'; +import { Versions } from './Version'; +import { SyncOptions } from './Sync'; -export { EXPORT_OPTIONS } from './Sync'; +export { SyncOptions } from './Sync'; -export enum STORAGE_KEYS { +export enum StorageKeys { PLAYER_SETTING_KEY = 'PlayerSetting', FAVORITE_PLAYLIST_KEY = 'FavFavList-Special', SEARCH_PLAYLIST_KEY = 'SearchPlaylist-Special', @@ -27,14 +27,14 @@ export enum STORAGE_KEYS { MUSICFREE_PLUGIN = 'MusicFreePlugin', } -export enum SEARCH_OPTIONS { +export enum SearchOptions { BILIBILI = 'bilibili', YOUTUBE = 'youtube', } -export const appID = 'NoxPlayerMobile'; +export const AppID = 'NoxPlayerMobile'; -export const DEFAULT_SETTING: NoxStorage.PlayerSettingDict = { +export const DefaultSetting: NoxStorage.PlayerSettingDict = { playMode: 'shufflePlay', defaultPlayMode: 'shufflePlay', defaultVolume: 1, @@ -43,17 +43,17 @@ export const DEFAULT_SETTING: NoxStorage.PlayerSettingDict = { skin: '诺莺nox', parseSongName: true, keepSearchedSongListWhenPlaying: false, - settingExportLocation: EXPORT_OPTIONS.DROPBOX, + settingExportLocation: SyncOptions.DROPBOX, personalCloudIP: '', personalCloudID: 'azusamobile', - noxVersion: VERSIONS.latest, - noxCheckedVersion: VERSIONS.latest, + noxVersion: Versions.Latest, + noxCheckedVersion: Versions.Latest, hideCoverInMobile: false, loadPlaylistAsArtist: false, sendBiliHeartbeat: false, noCookieBiliSearch: false, - playbackMode: NoxRepeatMode.SHUFFLE, + playbackMode: NoxRepeatMode.Shuffle, dataSaver: false, fastBiliSearch: true, noInterruption: false, @@ -67,8 +67,9 @@ export const DEFAULT_SETTING: NoxStorage.PlayerSettingDict = { screenAlwaysWake: false, biliEditAPI: false, keepForeground: false, + karaokeLyrics: false, - appID, + appID: AppID, language: undefined, cacheSize: 1, }; diff --git a/src/enums/Sync.ts b/src/enums/Sync.ts index b10fac45..b4757fb5 100644 --- a/src/enums/Sync.ts +++ b/src/enums/Sync.ts @@ -1,4 +1,4 @@ -export enum EXPORT_OPTIONS { +export enum SyncOptions { LOCAL = '本地', DROPBOX = 'Dropbox', PERSONAL = '私有云', diff --git a/src/enums/Utils.ts b/src/enums/Utils.ts index 49ae5b97..a4e9fa62 100644 --- a/src/enums/Utils.ts +++ b/src/enums/Utils.ts @@ -1,4 +1,4 @@ -export enum REOPERATIONTYPE { - extractWith = 1, - extractParenthesis = 2, +export enum ReOperationType { + ExtractWith = 1, + ExtractParenthesis = 2, } diff --git a/src/enums/Version.ts b/src/enums/Version.ts index 441e3abd..d1047c78 100644 --- a/src/enums/Version.ts +++ b/src/enums/Version.ts @@ -1,3 +1,3 @@ -export enum VERSIONS { - latest = '2.14.5', +export enum Versions { + Latest = '2.14.5', } diff --git a/src/enums/View.ts b/src/enums/View.ts deleted file mode 100644 index 4b90ab24..00000000 --- a/src/enums/View.ts +++ /dev/null @@ -1,10 +0,0 @@ -export enum ViewEnum { - PLAYER_HOME = 'NoxHome', - SETTINGS = 'NoxSettings', - PLAYER_COVER = 'NoxCover', - PLAYER_PLAYLIST = 'NoxPlaylist', - PLAYER_PLAYLISTS = 'NoxPlaylists', - USER_LOGIN = 'NoxLogin', - EXPORE = 'NoxExplore', - LYRICS = 'NoxLyrics', -} diff --git a/src/hooks/useAAPlayback.ts b/src/hooks/useAAPlayback.ts index 7871ceaa..d2052404 100644 --- a/src/hooks/useAAPlayback.ts +++ b/src/hooks/useAAPlayback.ts @@ -3,7 +3,7 @@ import { useEffect } from 'react'; import TrackPlayer, { Event } from 'react-native-track-player'; import usePlayback from './usePlayback'; import { useNoxSetting } from '@stores/useApp'; -import { INTENT_DATA } from '@enums/Intent'; +import { IntentData } from '@enums/Intent'; const useAAPlayback = () => { const { buildBrowseTree, playFromMediaId, playFromSearch, shuffleAll } = @@ -27,7 +27,7 @@ const useAAPlayback = () => { // HACK: for some reason I decided to register AA related listeners here. // I need the intent shuffleall handling somewhere it only runs once, which // is here... but this looks BAD. - if (intentData === INTENT_DATA.playAll) { + if (intentData === IntentData.PlayAll) { shuffleAll(); setIntentData(); } diff --git a/src/hooks/usePlayback.ts b/src/hooks/usePlayback.ts index 4fe6c2b8..03786017 100644 --- a/src/hooks/usePlayback.ts +++ b/src/hooks/usePlayback.ts @@ -57,7 +57,7 @@ const usePlayback = () => { }: PlayFromPlaylist) => { playlist = playlistParser(playlist); setCurrentPlayingList(playlist); - if (getState().playmode === NoxRepeatMode.REPEAT_TRACK) { + if (getState().playmode === NoxRepeatMode.RepeatTrack) { await TrackPlayer.setRepeatMode(RepeatMode.Off); } if (song === undefined) { diff --git a/src/hooks/usePlaylist.ts b/src/hooks/usePlaylist.ts index a6566e37..a7defb6b 100644 --- a/src/hooks/usePlaylist.ts +++ b/src/hooks/usePlaylist.ts @@ -3,7 +3,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react'; import { reParseSearch } from '../utils/re'; import { useNoxSetting } from '../stores/useApp'; import usePlaylistCRUD from './usePlaylistCRUD'; -import { SORT_OPTIONS } from '@enums/Playlist'; +import { SortOptions } from '@enums/Playlist'; export interface UsePlaylist { playlist: NoxMedia.Playlist; @@ -39,7 +39,7 @@ export interface UsePlaylist { onBackPress: () => boolean; getSelectedSongs: () => NoxMedia.Song[] | undefined; sortPlaylist: ( - sort?: SORT_OPTIONS, + sort?: SortOptions, ascend?: boolean, playlist?: NoxMedia.Playlist ) => void; diff --git a/src/hooks/usePlaylistCRUD.ts b/src/hooks/usePlaylistCRUD.ts index 06ee3f67..e7d273be 100644 --- a/src/hooks/usePlaylistCRUD.ts +++ b/src/hooks/usePlaylistCRUD.ts @@ -9,7 +9,7 @@ import { biliShazamOnSonglist } from '../utils/mediafetch/bilishazam'; import { syncFavlist } from '@utils/Bilibili/bilifavOperate'; import { updateSubscribeFavList } from '../utils/BiliSubscribe'; import { sortPlaylist as sortPlaylistR } from '../utils/playlistOperations'; -import { SORT_OPTIONS } from '../enums/Playlist'; +import { SortOptions } from '../enums/Playlist'; const usePlaylistCRUD = (mPlaylist?: NoxMedia.Playlist) => { const { playlistAnalyze } = useAnalytics(); @@ -214,7 +214,7 @@ const usePlaylistCRUD = (mPlaylist?: NoxMedia.Playlist) => { }; const sortPlaylist = ( - sort = SORT_OPTIONS.PREVIOUS_ORDER, + sort = SortOptions.PreviousOrder, ascend = false, playlist = getPlaylist() ) => { diff --git a/src/hooks/useSetupPlayer.ts b/src/hooks/useSetupPlayer.ts index 5f3f5c61..7f4076a1 100644 --- a/src/hooks/useSetupPlayer.ts +++ b/src/hooks/useSetupPlayer.ts @@ -10,7 +10,7 @@ import { getCurrentTPQueue, initializePlaybackMode } from '@stores/playingList'; import useVersionCheck from '@hooks/useVersionCheck'; import { songlistToTracklist } from '@utils/RNTPUtils'; import useInitializeStore from '@stores/initializeStores'; -import { INTENT_DATA } from '@enums/Intent'; +import { IntentData } from '@enums/Intent'; import { useNoxSetting } from '@stores/useApp'; const { NoxAndroidAutoModule } = NativeModules; @@ -65,10 +65,10 @@ export default ({ intentData }: NoxComponent.AppProps) => { await AdditionalPlaybackService(serviceOptions); setIntentData(intentData); switch (intentData) { - case INTENT_DATA.resume: + case IntentData.Resume: await TrackPlayer.play(); break; - case INTENT_DATA.playAll: + case IntentData.PlayAll: // this hook cannot use usePlayback bc of rerendering. default: await TrackPlayer.pause(); diff --git a/src/hooks/useSongOperations.ts b/src/hooks/useSongOperations.ts index e258ea8b..77c8142f 100644 --- a/src/hooks/useSongOperations.ts +++ b/src/hooks/useSongOperations.ts @@ -1,6 +1,6 @@ import { useNoxSetting } from '@stores/useApp'; import { logger } from '@utils/Logger'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const useSongOperations = () => { const setExternalSearchText = useNoxSetting( @@ -10,10 +10,10 @@ const useSongOperations = () => { const startRadio = (song: NoxMedia.Song) => { switch (song.source) { - case SOURCE.ytbvideo: + case Source.ytbvideo: setExternalSearchText(`youtu.be/${song.bvid}`); break; - case SOURCE.bilivideo: + case Source.bilivideo: setExternalSearchText(`bilibili.com/video/similarvideo/${song.bvid}`); default: logger.warn( @@ -24,7 +24,7 @@ const useSongOperations = () => { }; const radioAvailable = (song?: NoxMedia.Song) => - [SOURCE.ytbvideo, SOURCE.bilivideo].includes(song?.source as SOURCE); + [Source.ytbvideo, Source.bilivideo].includes(song?.source as Source); return { startRadio, radioAvailable }; }; diff --git a/src/hooks/useTPControls.ts b/src/hooks/useTPControls.ts index 19a536c1..f7514f15 100644 --- a/src/hooks/useTPControls.ts +++ b/src/hooks/useTPControls.ts @@ -68,7 +68,7 @@ export default () => { }; const skipToBiliSuggest = async (next = true) => { - if (noxPlayingList.getState().playmode !== NoxRepeatMode.SUGGEST) { + if (noxPlayingList.getState().playmode !== NoxRepeatMode.Suggest) { throw new Error('playmode is not bilisuggest.'); } const suggestedSong = [await getBiliSuggest()]; diff --git a/src/hooks/useVersionCheck.ts b/src/hooks/useVersionCheck.ts index 8691af72..45d8f517 100644 --- a/src/hooks/useVersionCheck.ts +++ b/src/hooks/useVersionCheck.ts @@ -6,7 +6,7 @@ import { APPSTORE } from '@env'; import { useNoxSetting } from '@stores/useApp'; import useAlert from '../components/dialogs/useAlert'; -import { VERSIONS } from '../enums/Version'; +import { Versions } from '../enums/Version'; import logger from '@utils/Logger'; import useInstallAPK from './useInstallAPK'; @@ -122,7 +122,7 @@ export default () => { }; const updateVersion = async (currentPlayerSetting = playerSetting) => { - const latest = VERSIONS.latest; + const latest = Versions.Latest; switch (currentPlayerSetting.noxVersion) { case latest: return; diff --git a/src/localization/en/translation.json b/src/localization/en/translation.json index e0ee2a68..646ac3b4 100644 --- a/src/localization/en/translation.json +++ b/src/localization/en/translation.json @@ -116,6 +116,8 @@ "chatGPTResolveSongNameDesc": "TODO: Use chatGPT to resolve song names", "keepForegroundName": "Keep Foreground Service", "keepForegroundDesc": "enable to waste a LOT of battery", + "karaokeLyricsName": "Karaoke Lyrics", + "karaokeLyricsDesc": "Show karaoke style lyrics", "biliEditAPIName": "use bilibili edit API", "biliEditAPIDesc": "use bilibili edit API when renaming songs", "screenAlwaysWakeName": "Lyric screen always on", diff --git a/src/localization/zhcn/translation.json b/src/localization/zhcn/translation.json index aa92cf44..96abf576 100644 --- a/src/localization/zhcn/translation.json +++ b/src/localization/zhcn/translation.json @@ -2,6 +2,7 @@ "_comment": "src/localization/en/translation.json", "BiliCategory": { "ranking": "b站音乐区排行榜", + "dynamic": "b站音乐区动态", "3": "音乐", "28": "原创音乐", "31": "翻唱", @@ -126,6 +127,8 @@ "chatGPTResolveSongNameDesc": "TODO:用chatGPT解析歌名", "keepForegroundName": "费电", "keepForegroundDesc": "保持前台服务,贼拉费电", + "karaokeLyricsName": "逐字歌词", + "karaokeLyricsDesc": "使用逐字歌词", "biliEditAPIName": "使用b站修改投稿API", "biliEditAPIDesc": "更改歌名时,使用b站修改投稿API", "screenAlwaysWakeName": "歌词界面常亮", diff --git a/src/objects/Playlist.ts b/src/objects/Playlist.ts index ee134634..6b06d4be 100644 --- a/src/objects/Playlist.ts +++ b/src/objects/Playlist.ts @@ -1,11 +1,11 @@ import { v4 as uuidv4 } from 'uuid'; import i18n from 'i18next'; -import { PLAYLIST_ENUMS } from '../enums/Playlist'; +import { PlaylistTypes } from '../enums/Playlist'; export const dummyPlaylist = ( title = i18n.t('PlaylistOperations.searchListName'), - type = PLAYLIST_ENUMS.TYPE_TYPICA_PLAYLIST + type = PlaylistTypes.Typical ): NoxMedia.Playlist => { return { songList: [], diff --git a/src/objects/Song.ts b/src/objects/Song.ts index d97869bd..866bbca4 100644 --- a/src/objects/Song.ts +++ b/src/objects/Song.ts @@ -3,7 +3,7 @@ import he from 'he'; import { extractParenthesis } from '../utils/re'; import { reExtractSongName } from '@stores/appStore'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { MUSICFREE } from '@utils/mediafetch/musicfree'; import { i0hdslbHTTPResolve } from '@utils/Utils'; @@ -26,7 +26,7 @@ interface SongProps { duration?: number; album?: string; addedDate?: number; - source?: SOURCE | MUSICFREE; + source?: Source | MUSICFREE; isLive?: boolean; liveStatus?: boolean; metadataOnLoad?: boolean; diff --git a/src/services/PlaybackService.ts b/src/services/PlaybackService.ts index dabef26c..05470c87 100644 --- a/src/services/PlaybackService.ts +++ b/src/services/PlaybackService.ts @@ -152,7 +152,7 @@ export async function PlaybackService() { console.error('resolveURL failed', event.track, e); } } - if (getState().playmode === NoxRepeatMode.REPEAT_TRACK) { + if (getState().playmode === NoxRepeatMode.RepeatTrack) { TrackPlayer.setRepeatMode(RepeatMode.Track); } } diff --git a/src/stores/playerSettingStore.ts b/src/stores/playerSettingStore.ts index 51f7e9ad..68e0af75 100644 --- a/src/stores/playerSettingStore.ts +++ b/src/stores/playerSettingStore.ts @@ -1,7 +1,7 @@ // vanilla store of zustand serving playbackServices. import { createStore } from 'zustand/vanilla'; -import { DEFAULT_SETTING } from '@enums/Storage'; +import { DefaultSetting } from '@enums/Storage'; import { saveSettings, getSettings } from '@utils/ChromeStorage'; interface AppStore { @@ -10,7 +10,7 @@ interface AppStore { } const playerSettingStore = createStore((set, get) => ({ - playerSetting: DEFAULT_SETTING, + playerSetting: DefaultSetting, setPlayerSetting: (val: Partial) => { const newPlayerSetting = { ...get().playerSetting, ...val }; set({ playerSetting: newPlayerSetting }); diff --git a/src/stores/playingList.ts b/src/stores/playingList.ts index 86a4b559..cfde097b 100644 --- a/src/stores/playingList.ts +++ b/src/stores/playingList.ts @@ -23,7 +23,7 @@ const playlistStore = createStore(() => ({ playingListShuffled: [], currentPlayingIndex: -1, currentPlayingId: '', - playmode: NoxRepeatMode.SHUFFLE, + playmode: NoxRepeatMode.Shuffle, })); export const setPlayingIndex = (index = 0, songId?: string) => { @@ -75,7 +75,7 @@ export const setPlayingList = (list: Array) => { export const getCurrentTPQueue = (playmode?: NoxRepeatMode) => { const state = playlistStore.getState(); if (!playmode) playmode = state.playmode; - if (playmode === NoxRepeatMode.SHUFFLE) { + if (playmode === NoxRepeatMode.Shuffle) { return state.playingListShuffled; } return state.playingList; @@ -108,17 +108,17 @@ export const getPlaybackModeNotifIcon = ( // RepeatMode.Off. let TPRepeatMode = RepeatMode.Off; switch (state) { - case NoxRepeatMode.REPEAT: + case NoxRepeatMode.Repeat: nextIcon = 2; break; - case NoxRepeatMode.REPEAT_TRACK: + case NoxRepeatMode.RepeatTrack: nextIcon = 3; TPRepeatMode = RepeatMode.Track; break; - case NoxRepeatMode.SUGGEST: + case NoxRepeatMode.Suggest: nextIcon = 5; break; - case NoxRepeatMode.SHUFFLE: + case NoxRepeatMode.Shuffle: nextIcon = 4; break; default: @@ -127,7 +127,7 @@ export const getPlaybackModeNotifIcon = ( return [nextIcon, TPRepeatMode]; }; -const RefreshPlayingIndex = [NoxRepeatMode.SHUFFLE, NoxRepeatMode.REPEAT]; +const RefreshPlayingIndex = [NoxRepeatMode.Shuffle, NoxRepeatMode.Repeat]; /** * calls TP.setRepeatMode by the input repeat mode, saves repeat mode into asnycStorage, then * returns the icon associated with the repeat mode (for notification bar). @@ -149,14 +149,14 @@ export const initializePlaybackMode = (state: NoxRepeatMode) => { */ export const cycleThroughPlaymode = () => { switch (playlistStore.getState().playmode) { - case NoxRepeatMode.SHUFFLE: - return initializePlaybackMode(NoxRepeatMode.REPEAT); - case NoxRepeatMode.REPEAT: - return initializePlaybackMode(NoxRepeatMode.REPEAT_TRACK); - case NoxRepeatMode.REPEAT_TRACK: - return initializePlaybackMode(NoxRepeatMode.SUGGEST); - case NoxRepeatMode.SUGGEST: - return initializePlaybackMode(NoxRepeatMode.SHUFFLE); + case NoxRepeatMode.Shuffle: + return initializePlaybackMode(NoxRepeatMode.Repeat); + case NoxRepeatMode.Repeat: + return initializePlaybackMode(NoxRepeatMode.RepeatTrack); + case NoxRepeatMode.RepeatTrack: + return initializePlaybackMode(NoxRepeatMode.Suggest); + case NoxRepeatMode.Suggest: + return initializePlaybackMode(NoxRepeatMode.Shuffle); default: return undefined; } diff --git a/src/stores/useApp.ts b/src/stores/useApp.ts index 5ed62e18..d20c3ffc 100644 --- a/src/stores/useApp.ts +++ b/src/stores/useApp.ts @@ -15,7 +15,7 @@ import { saveLyricMapping, saveDefaultSearch, } from '@utils/ChromeStorage'; -import { DEFAULT_SETTING, STORAGE_KEYS, SEARCH_OPTIONS } from '@enums/Storage'; +import { DefaultSetting, StorageKeys, SearchOptions } from '@enums/Storage'; import { setPlayerSetting as setPlayerSettingVanilla } from './playerSettingStore'; import { savePlayerStyle } from '@utils/StyleStorage'; import { createStyle } from '@components/style'; @@ -23,14 +23,17 @@ import { getABRepeatRaw } from './appStore'; import { setPlayingList, setPlayingIndex } from '@stores/playingList'; import DummyLyricDetail from '../objects/LyricDetail'; import { MUSICFREE } from '../utils/mediafetch/musicfree'; -import { INTENT_DATA } from '@enums/Intent'; +import { IntentData } from '@enums/Intent'; interface NoxSetting { - intentData?: INTENT_DATA; - setIntentData: (val?: INTENT_DATA) => void; + songListScrollCounter: number; + incSongListScrollCounter: () => void; - searchOption: SEARCH_OPTIONS | MUSICFREE; - setSearchOption: (val: SEARCH_OPTIONS | MUSICFREE) => void; + intentData?: IntentData; + setIntentData: (val?: IntentData) => void; + + searchOption: SearchOptions | MUSICFREE; + setSearchOption: (val: SearchOptions | MUSICFREE) => void; gestureMode: boolean; setGestureMode: (val: boolean) => void; @@ -130,9 +133,15 @@ interface NoxSetting { * as well as saving and loading states to/from asyncStorage. */ export const useNoxSetting = create((set, get) => ({ + songListScrollCounter: 0, + incSongListScrollCounter: () => + set(state => ({ + songListScrollCounter: state.songListScrollCounter + 1, + })), + setIntentData: intentData => set({ intentData }), - searchOption: SEARCH_OPTIONS.BILIBILI, + searchOption: SearchOptions.BILIBILI, setSearchOption: v => { set({ searchOption: v }); saveDefaultSearch(v); @@ -210,18 +219,18 @@ export const useNoxSetting = create((set, get) => ({ searchPlaylist: dummyPlaylist(), setSearchPlaylist: val => { let playlists = get().playlists; - playlists[STORAGE_KEYS.SEARCH_PLAYLIST_KEY] = val; + playlists[StorageKeys.SEARCH_PLAYLIST_KEY] = val; set({ searchPlaylist: val, playlists }); }, favoritePlaylist: dummyPlaylist(), setFavoritePlaylist: val => { let playlists = get().playlists; - playlists[STORAGE_KEYS.FAVORITE_PLAYLIST_KEY] = val; + playlists[StorageKeys.FAVORITE_PLAYLIST_KEY] = val; saveFavPlaylist(val); set({ favoritePlaylist: val, playlists }); }, - playerSetting: DEFAULT_SETTING, + playerSetting: DefaultSetting, setPlayerSetting: val => { const newPlayerSetting = { ...get().playerSetting, ...val }; set({ playerSetting: newPlayerSetting }); @@ -243,7 +252,7 @@ export const useNoxSetting = create((set, get) => ({ let playlists = get().playlists; const currentPlaylist = get().currentPlaylist; if (currentPlaylist.id === playlistId) { - set({ currentPlaylist: playlists[STORAGE_KEYS.SEARCH_PLAYLIST_KEY] }); + set({ currentPlaylist: playlists[StorageKeys.SEARCH_PLAYLIST_KEY] }); } delPlaylist(playlists[playlistId], playlistIds); delete playlists[playlistId]; @@ -315,7 +324,7 @@ export const useNoxSetting = create((set, get) => ({ playlists: val.playlists, currentPlayingList: playingList, currentPlayingID: val.lastPlaylistId[1], - storedPlayerSetting: val.settings || DEFAULT_SETTING, + storedPlayerSetting: val.settings || DefaultSetting, cookies: val.cookies, language: val.settings.language, lastPlayDuration: val.lastPlayDuration, diff --git a/src/types/component.d.ts b/src/types/component.d.ts index 618782b1..7d561d66 100644 --- a/src/types/component.d.ts +++ b/src/types/component.d.ts @@ -3,12 +3,12 @@ import { ParamListBase } from '@react-navigation/native'; import { DrawerNavigationProp } from '@react-navigation/drawer'; import { Track } from 'react-native-track-player'; -import { INTENT_DATA } from '@enums/Intent'; +import { IntentData } from '@enums/Intent'; declare global { namespace NoxComponent { interface AppProps { - intentData?: INTENT_DATA; + intentData?: IntentData; } interface NavigationProps { navigation: DrawerNavigationProp; diff --git a/src/types/media.d.ts b/src/types/media.d.ts index 18f27c38..017ab900 100644 --- a/src/types/media.d.ts +++ b/src/types/media.d.ts @@ -1,5 +1,5 @@ -import { SORT_OPTIONS, PLAYLIST_ENUMS } from '@enums/Playlist'; -import { SOURCE } from '@enums/MediaFetch'; +import { SortOptions, PlaylistTypes } from '@enums/Playlist'; +import { Source } from '@enums/MediaFetch'; import { MUSICFREE } from '@utils/mediafetch/musicfree'; declare global { @@ -20,7 +20,7 @@ declare global { duration: number; album?: string; addedDate?: number; - source?: SOURCE | MUSICFREE; + source?: Source | MUSICFREE; isLive?: boolean; liveStatus?: boolean; metadataOnLoad?: boolean; @@ -30,7 +30,7 @@ declare global { export interface Playlist { title: string; id: string; - type: PLAYLIST_ENUMS; + type: PlaylistTypes; songList: Array; @@ -42,7 +42,7 @@ declare global { biliSync: boolean; newSongOverwrite?: boolean; - sort?: SORT_OPTIONS; + sort?: SortOptions; // function to support infinite loading; only applicable to // search playlists. bc we stringify playlists, this will be // lost upon loading from storage diff --git a/src/types/storage.d.ts b/src/types/storage.d.ts index 621e416d..2bea1263 100644 --- a/src/types/storage.d.ts +++ b/src/types/storage.d.ts @@ -1,9 +1,9 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { ColorSchemeName } from 'react-native'; -import { EXPORT_OPTIONS } from '../enums/Sync'; +import { SyncOptions } from '../enums/Sync'; import { NoxRepeatMode } from '../enums/RepeatMode'; -import { SEARCH_OPTIONS } from '../enums/Storage'; +import { SearchOptions } from '../enums/Storage'; declare global { namespace NoxStorage { @@ -16,7 +16,7 @@ declare global { skin: string; parseSongName: boolean; keepSearchedSongListWhenPlaying: boolean; - settingExportLocation: EXPORT_OPTIONS; + settingExportLocation: SyncOptions; personalCloudIP: string; personalCloudID: string; noxVersion: string; @@ -39,6 +39,7 @@ declare global { wavyProgressBar: boolean; screenAlwaysWake: boolean; keepForeground: boolean; + karaokeLyrics: boolean; appID: string; language?: string; @@ -62,7 +63,7 @@ declare global { language?: string; lastPlayDuration: number; colorScheme: ColorSchemeName; - defaultSearchOptions?: SEARCH_OPTIONS; + defaultSearchOptions?: SearchOptions; } export interface initializedResults { diff --git a/src/utils/BiliSearch.ts b/src/utils/BiliSearch.ts index d59374df..c9501d8f 100644 --- a/src/utils/BiliSearch.ts +++ b/src/utils/BiliSearch.ts @@ -1,6 +1,6 @@ import { logger } from './Logger'; -import { SEARCH_OPTIONS } from '@enums/Storage'; +import { SearchOptions } from '@enums/Storage'; import steriatkFetch from './mediafetch/steriatk'; import biliVideoSimilarFetch from './mediafetch/biliVideoSimilar'; import biliBangumiFetch from './mediafetch/biliBangumi'; @@ -45,7 +45,7 @@ interface Props { useBiliTag?: boolean; fastSearch?: boolean; cookiedSearch?: boolean; - defaultSearch?: SEARCH_OPTIONS | MUSICFREE; + defaultSearch?: SearchOptions | MUSICFREE; } export const matchBiliURL = ( @@ -72,7 +72,7 @@ export const searchBiliURLs = async ({ useBiliTag = false, fastSearch = true, cookiedSearch = false, - defaultSearch = SEARCH_OPTIONS.BILIBILI, + defaultSearch = SearchOptions.BILIBILI, }: Props) => { let results: NoxMedia.SearchPlaylist = { songList: [], @@ -98,7 +98,7 @@ export const searchBiliURLs = async ({ return results; } // bilisearchFetch switch (defaultSearch) { - case SEARCH_OPTIONS.YOUTUBE: + case SearchOptions.YOUTUBE: results = await ytbsearchFetch.regexFetch({ url: input, progressEmitter, diff --git a/src/utils/BiliSubscribe.ts b/src/utils/BiliSubscribe.ts index 2ff56aa9..0c110a94 100644 --- a/src/utils/BiliSubscribe.ts +++ b/src/utils/BiliSubscribe.ts @@ -1,5 +1,5 @@ import { searchBiliURLs } from './BiliSearch'; -import { PLAYLIST_ENUMS } from '../enums/Playlist'; +import { PlaylistTypes } from '../enums/Playlist'; import { parseSongName } from '@stores/appStore'; interface Props { @@ -24,9 +24,9 @@ export const updateSubscribeFavList = async ({ callback = () => undefined, }: Props): Promise => { let newPlaylist = { ...playlist, lastSubscribed: new Date().getTime() }; - if ([PLAYLIST_ENUMS.TYPE_FAVORI_PLAYLIST].includes(playlist.type)) + if ([PlaylistTypes.Favorite].includes(playlist.type)) throw new Error('[biliSubscribe] incorrect playlist type for subscription'); - if (playlist.type === PLAYLIST_ENUMS.TYPE_SEARCH_PLAYLIST) { + if (playlist.type === PlaylistTypes.Search) { if (!playlist.refresh) throw new Error('[biliSubscribe] nothing to subscribe'); newPlaylist = { ...newPlaylist, ...(await playlist.refresh(newPlaylist)) }; diff --git a/src/utils/Cache.ts b/src/utils/Cache.ts index 6766cb80..80ba494f 100644 --- a/src/utils/Cache.ts +++ b/src/utils/Cache.ts @@ -11,7 +11,7 @@ import playerSettingStore from '@stores/playerSettingStore'; import { getCachedMediaMapping, saveCachedMediaMapping } from './ChromeStorage'; import { logger } from './Logger'; import { customReqHeader } from './BiliFetch'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const { getState } = playerSettingStore; @@ -127,7 +127,7 @@ class NoxMediaCache { loadCacheMedia = (song: NoxMedia.Song, prefix = 'file://') => { // HACK: return song.source if song is local. - if (song.source === SOURCE.local) { + if (song.source === Source.local) { // return song.bvid; } return this.loadCacheObject(noxCacheKey(song), prefix); @@ -161,7 +161,7 @@ class NoxMediaCache { }; peekCache = (song: NoxMedia.Song) => { - if (song.source === SOURCE.local) return true; + if (song.source === Source.local) return true; return this.cache.peek(noxCacheKey(song)); }; diff --git a/src/utils/ChromeStorage.ts b/src/utils/ChromeStorage.ts index 08d07f07..3b124933 100644 --- a/src/utils/ChromeStorage.ts +++ b/src/utils/ChromeStorage.ts @@ -7,14 +7,14 @@ import i18n from 'i18next'; import { dummyPlaylist, dummyPlaylistList } from '../objects/Playlist'; import { NoxRepeatMode } from '../enums/RepeatMode'; -import { PLAYLIST_ENUMS } from '../enums/Playlist'; +import { PlaylistTypes } from '../enums/Playlist'; import AzusaTheme from '../components/styles/AzusaTheme'; import { chunkArray, arrayToObject } from '../utils/Utils'; import { - STORAGE_KEYS, - appID, - DEFAULT_SETTING, - SEARCH_OPTIONS, + StorageKeys, + AppID, + DefaultSetting, + SearchOptions, } from '@enums/Storage'; import { MUSICFREE } from './mediafetch/musicfree'; /** @@ -64,22 +64,22 @@ export const removeItem = async (key: string) => { }; export const setMusicFreePlugin = (val: MUSICFREE[]) => - saveItem(STORAGE_KEYS.MUSICFREE_PLUGIN, val); + saveItem(StorageKeys.MUSICFREE_PLUGIN, val); export const getMusicFreePlugin = (): Promise => - getItem(STORAGE_KEYS.MUSICFREE_PLUGIN, []); + getItem(StorageKeys.MUSICFREE_PLUGIN, []); export const getFadeInterval = async () => - Number(await getItem(STORAGE_KEYS.FADE_INTERVAL)) || 0; + Number(await getItem(StorageKeys.FADE_INTERVAL)) || 0; export const saveFadeInterval = async (val: number) => - await saveItem(STORAGE_KEYS.FADE_INTERVAL, val); + await saveItem(StorageKeys.FADE_INTERVAL, val); /** * a save helper function for mapping types ({string: val}). * @returns the mapping object */ const getMapping = async ( - key: STORAGE_KEYS, + key: StorageKeys, transform: (val: any) => any = arrayToObject ) => { try { @@ -95,56 +95,56 @@ const getMapping = async ( }; export const getRegExtractMapping = (): Promise => - getItem(STORAGE_KEYS.REGEXTRACT_MAPPING, []); + getItem(StorageKeys.REGEXTRACT_MAPPING, []); export const saveRegextractMapping = (val: NoxRegExt.JSONExtractor[]) => - saveItem(STORAGE_KEYS.REGEXTRACT_MAPPING, val); + saveItem(StorageKeys.REGEXTRACT_MAPPING, val); export const getR128GainMapping = (): Promise => - getMapping(STORAGE_KEYS.R128GAIN_MAPPING); + getMapping(StorageKeys.R128GAIN_MAPPING); export const saveR128GainMapping = (val: NoxStorage.R128Dict) => - saveChucked(STORAGE_KEYS.R128GAIN_MAPPING, Object.entries(val)); + saveChucked(StorageKeys.R128GAIN_MAPPING, Object.entries(val)); export const getABMapping = (): Promise => - getMapping(STORAGE_KEYS.ABREPEAT_MAPPING); + getMapping(StorageKeys.ABREPEAT_MAPPING); export const saveABMapping = async (val: NoxStorage.ABDict) => - saveChucked(STORAGE_KEYS.ABREPEAT_MAPPING, Object.entries(val)); + saveChucked(StorageKeys.ABREPEAT_MAPPING, Object.entries(val)); -export const getDefaultSearch = (): Promise => - getItem(STORAGE_KEYS.DEFAULT_SEARCH, SEARCH_OPTIONS.BILIBILI); +export const getDefaultSearch = (): Promise => + getItem(StorageKeys.DEFAULT_SEARCH, SearchOptions.BILIBILI); -export const saveDefaultSearch = (val: SEARCH_OPTIONS | MUSICFREE) => - saveItem(STORAGE_KEYS.DEFAULT_SEARCH, val); +export const saveDefaultSearch = (val: SearchOptions | MUSICFREE) => + saveItem(StorageKeys.DEFAULT_SEARCH, val); export const getCachedMediaMapping = () => - getItem(STORAGE_KEYS.CACHED_MEDIA_MAPPING, []); + getItem(StorageKeys.CACHED_MEDIA_MAPPING, []); export const saveCachedMediaMapping = (val: any[]) => - saveItem(STORAGE_KEYS.CACHED_MEDIA_MAPPING, val); + saveItem(StorageKeys.CACHED_MEDIA_MAPPING, val); export const getColorScheme = async () => { - const colorScheme = (await getItem(STORAGE_KEYS.COLORTHEME)) || null; + const colorScheme = (await getItem(StorageKeys.COLORTHEME)) || null; Appearance.setColorScheme(colorScheme); return colorScheme; }; export const saveColorScheme = (val: ColorSchemeName) => - saveItem(STORAGE_KEYS.COLORTHEME, val); + saveItem(StorageKeys.COLORTHEME, val); // we keep the set-cookie header for noxplayer's remove personal search option // TODO: security risk. move this to an encrypted storage. export const addCookie = async (site: string, setHeader: string) => { return; - const cookies = (await getItem(STORAGE_KEYS.COOKIES)) || {}; - saveItem(STORAGE_KEYS.COOKIES, { ...cookies, [site]: setHeader }); + const cookies = (await getItem(StorageKeys.COOKIES)) || {}; + saveItem(StorageKeys.COOKIES, { ...cookies, [site]: setHeader }); }; export const removeCookie = async (site: string) => { - const cookies = (await getItem(STORAGE_KEYS.COOKIES)) || {}; + const cookies = (await getItem(StorageKeys.COOKIES)) || {}; cookies[site] = []; - saveItem(STORAGE_KEYS.COOKIES, cookies); + saveItem(StorageKeys.COOKIES, cookies); }; /** @@ -221,37 +221,36 @@ export const getPlaylist = async ( }; export const savePlayerSkins = async (skins: Array) => - saveChucked(STORAGE_KEYS.SKINSTORAGE, skins); + saveChucked(StorageKeys.SKINSTORAGE, skins); export const getPlayerSkins = async () => - await loadChucked(await getItem(STORAGE_KEYS.SKINSTORAGE, [])); + await loadChucked(await getItem(StorageKeys.SKINSTORAGE, [])); export const saveLyricMapping = async ( lyricMapping: Map -) => - saveChucked(STORAGE_KEYS.LYRIC_MAPPING, Array.from(lyricMapping.entries())); +) => saveChucked(StorageKeys.LYRIC_MAPPING, Array.from(lyricMapping.entries())); export const getLyricMapping = () => - getMapping(STORAGE_KEYS.LYRIC_MAPPING, (val: any) => new Map(val)); + getMapping(StorageKeys.LYRIC_MAPPING, (val: any) => new Map(val)); // no point to provide getters, as states are managed by zustand. // unlike azusaplayer which the storage context still reads localstorage, instaed // of keeping them as states. export const saveSettings = (setting: NoxStorage.PlayerSettingDict) => - saveItem(STORAGE_KEYS.PLAYER_SETTING_KEY, setting); + saveItem(StorageKeys.PLAYER_SETTING_KEY, setting); export const getSettings = async () => ({ - ...DEFAULT_SETTING, - ...(await getItem(STORAGE_KEYS.PLAYER_SETTING_KEY, {})), + ...DefaultSetting, + ...(await getItem(StorageKeys.PLAYER_SETTING_KEY, {})), }); export const savePlaylistIds = (val: string[]) => - saveItem(STORAGE_KEYS.MY_FAV_LIST_KEY, val); + saveItem(StorageKeys.MY_FAV_LIST_KEY, val); export const savePlayerSkin = (val: NoxTheme.Style | NoxTheme.AdaptiveStyle) => - saveItem(STORAGE_KEYS.SKIN, val); + saveItem(StorageKeys.SKIN, val); -export const getPlayerSkin = () => getItem(STORAGE_KEYS.SKIN); +export const getPlayerSkin = () => getItem(StorageKeys.SKIN); export const addPlaylist = ( playlist: NoxMedia.Playlist, @@ -283,55 +282,54 @@ export const delPlaylist = ( }; export const saveFavPlaylist = (playlist: NoxMedia.Playlist) => - savePlaylist(playlist, STORAGE_KEYS.FAVORITE_PLAYLIST_KEY); + savePlaylist(playlist, StorageKeys.FAVORITE_PLAYLIST_KEY); export const savelastPlaylistId = (val: [string, string]) => - saveItem(STORAGE_KEYS.LAST_PLAY_LIST, val); + saveItem(StorageKeys.LAST_PLAY_LIST, val); export const savePlayMode = (val: string) => - saveItem(STORAGE_KEYS.PLAYMODE_KEY, val); + saveItem(StorageKeys.PLAYMODE_KEY, val); export const saveLastPlayDuration = (val: number) => - saveItem(STORAGE_KEYS.LAST_PLAY_DURATION, val); + saveItem(StorageKeys.LAST_PLAY_DURATION, val); export const initPlayerObject = async (): Promise => { const lyricMapping = (await getLyricMapping()) || {}; const playerObject = { settings: { - ...DEFAULT_SETTING, - ...((await getItem(STORAGE_KEYS.PLAYER_SETTING_KEY)) || {}), + ...DefaultSetting, + ...((await getItem(StorageKeys.PLAYER_SETTING_KEY)) || {}), }, - playlistIds: (await getItem(STORAGE_KEYS.MY_FAV_LIST_KEY)) || [], + playlistIds: (await getItem(StorageKeys.MY_FAV_LIST_KEY)) || [], playlists: {}, - lastPlaylistId: (await getItem(STORAGE_KEYS.LAST_PLAY_LIST)) || [ + lastPlaylistId: (await getItem(StorageKeys.LAST_PLAY_LIST)) || [ 'NULL', 'NULL', ], searchPlaylist: dummyPlaylist( i18n.t('PlaylistOperations.searchListName'), - PLAYLIST_ENUMS.TYPE_SEARCH_PLAYLIST + PlaylistTypes.Search ), - favoriPlaylist: await getPlaylist( - STORAGE_KEYS.FAVORITE_PLAYLIST_KEY, - () => dummyPlaylist('Favorite', PLAYLIST_ENUMS.TYPE_FAVORI_PLAYLIST) + favoriPlaylist: await getPlaylist(StorageKeys.FAVORITE_PLAYLIST_KEY, () => + dummyPlaylist('Favorite', PlaylistTypes.Favorite) ), playbackMode: await getItem( - STORAGE_KEYS.PLAYMODE_KEY, - NoxRepeatMode.SHUFFLE + StorageKeys.PLAYMODE_KEY, + NoxRepeatMode.Shuffle ), - skin: await getItem(STORAGE_KEYS.SKIN, AzusaTheme), + skin: await getItem(StorageKeys.SKIN, AzusaTheme), skins: (await getPlayerSkins()) || [], - cookies: await getItem(STORAGE_KEYS.COOKIES, {}), + cookies: await getItem(StorageKeys.COOKIES, {}), lyricMapping, - lastPlayDuration: await getItem(STORAGE_KEYS.LAST_PLAY_DURATION, 0), + lastPlayDuration: await getItem(StorageKeys.LAST_PLAY_DURATION, 0), colorScheme: await getColorScheme(), defaultSearchOptions: await getDefaultSearch(), } as NoxStorage.PlayerStorageObject; - playerObject.playlists[STORAGE_KEYS.SEARCH_PLAYLIST_KEY] = + playerObject.playlists[StorageKeys.SEARCH_PLAYLIST_KEY] = playerObject.searchPlaylist; - playerObject.playlists[STORAGE_KEYS.FAVORITE_PLAYLIST_KEY] = + playerObject.playlists[StorageKeys.FAVORITE_PLAYLIST_KEY] = playerObject.favoriPlaylist; await Promise.all( @@ -355,7 +353,7 @@ export const exportPlayerContent = async (content?: any) => { }; const clearPlaylists = async () => { - const playlistIds = (await getItem(STORAGE_KEYS.MY_FAV_LIST_KEY)) || []; + const playlistIds = (await getItem(StorageKeys.MY_FAV_LIST_KEY)) || []; for (const playlistId of playlistIds) { delPlaylistRaw(await getPlaylist(playlistId)); } @@ -379,17 +377,17 @@ const saveImportedPlaylist = async (playlists: any[]) => { export const clearPlaylistNImport = async (parsedContent: any) => { await clearPlaylists(); await saveImportedPlaylist( - parsedContent[STORAGE_KEYS.MY_FAV_LIST_KEY].map( + parsedContent[StorageKeys.MY_FAV_LIST_KEY].map( (val: string) => parsedContent[val] ) ); - await savePlaylistIds(parsedContent[STORAGE_KEYS.MY_FAV_LIST_KEY]); + await savePlaylistIds(parsedContent[StorageKeys.MY_FAV_LIST_KEY]); }; export const addImportedPlaylist = async (playlists: any[]) => { await saveImportedPlaylist(playlists); await savePlaylistIds( - (await getItem(STORAGE_KEYS.MY_FAV_LIST_KEY)).concat( + (await getItem(StorageKeys.MY_FAV_LIST_KEY)).concat( playlists.map(val => val.info.id) ) ); @@ -406,10 +404,10 @@ const parseImportedPartial = ( export const importPlayerContentRaw = async (parsedContent: any) => { const importedAppID = parseImportedPartial( - STORAGE_KEYS.PLAYER_SETTING_KEY, + StorageKeys.PLAYER_SETTING_KEY, parsedContent ).appID; - if (importedAppID !== appID) { + if (importedAppID !== AppID) { throw new Error(`${importedAppID} is not valid appID`); } else { const oldCache = await getCachedMediaMapping(); diff --git a/src/utils/mediafetch/biliAudioAM.ts b/src/utils/mediafetch/biliAudioAM.ts index dccaed80..c6cac7a1 100644 --- a/src/utils/mediafetch/biliAudioAM.ts +++ b/src/utils/mediafetch/biliAudioAM.ts @@ -3,7 +3,7 @@ import { logger } from '../Logger'; import { regexFetchProps } from './generic'; import { fetchBiliPaginatedAPI } from './paginatedbili'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import SongTS from '@objects/Song'; /** @@ -78,7 +78,7 @@ const fetchBiliAudioColleList = async ( resolveBiliBVID: async v => v.map((data: any) => SongTS({ - cid: `${SOURCE.biliaudio}-${data.id}`, + cid: `${Source.biliaudio}-${data.id}`, bvid: data.id, name: data.title, nameRaw: data.title, @@ -89,7 +89,7 @@ const fetchBiliAudioColleList = async ( page: 1, duration: data.duration, album: data.title, - source: SOURCE.biliaudio, + source: Source.biliaudio, }) ), }); diff --git a/src/utils/mediafetch/biliAudioColle.ts b/src/utils/mediafetch/biliAudioColle.ts index 28bebbc3..fee8c868 100644 --- a/src/utils/mediafetch/biliAudioColle.ts +++ b/src/utils/mediafetch/biliAudioColle.ts @@ -4,7 +4,7 @@ import { logger } from '../Logger'; import { regexFetchProps } from './generic'; import { fetchBiliPaginatedAPI } from './paginatedbili'; import { getBiliCookie } from '@utils/Bilibili/biliCookies'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import SongTS from '@objects/Song'; /** @@ -79,7 +79,7 @@ const fetchBiliAudioColleList = async ( resolveBiliBVID: async v => v.map((data: any) => SongTS({ - cid: `${SOURCE.biliaudio}-${data.id}`, + cid: `${Source.biliaudio}-${data.id}`, bvid: data.id, name: data.title, nameRaw: data.title, @@ -90,7 +90,7 @@ const fetchBiliAudioColleList = async ( page: 1, duration: data.duration, album: data.title, - source: SOURCE.biliaudio, + source: Source.biliaudio, }) ), params: { diff --git a/src/utils/mediafetch/biliAudioSimilar.ts b/src/utils/mediafetch/biliAudioSimilar.ts index e44d4f20..7c6711df 100644 --- a/src/utils/mediafetch/biliAudioSimilar.ts +++ b/src/utils/mediafetch/biliAudioSimilar.ts @@ -12,7 +12,7 @@ import { logger } from '../Logger'; import { regexFetchProps } from './generic'; import bfetch from '@utils/BiliFetch'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import SongTS from '@objects/Song'; /** @@ -70,7 +70,7 @@ const fetchBiliAudioSimilarList = async ( const json = await res.json(); return json.data.map((data: any) => SongTS({ - cid: `${SOURCE.biliaudio}-${data.id}`, + cid: `${Source.biliaudio}-${data.id}`, bvid: data.id, name: data.title, nameRaw: data.title, @@ -81,7 +81,7 @@ const fetchBiliAudioSimilarList = async ( page: 1, duration: data.duration, album: data.title, - source: SOURCE.biliaudio, + source: Source.biliaudio, }) ); }; diff --git a/src/utils/mediafetch/biliBangumi.ts b/src/utils/mediafetch/biliBangumi.ts index 7b34ec4f..1262bfa9 100644 --- a/src/utils/mediafetch/biliBangumi.ts +++ b/src/utils/mediafetch/biliBangumi.ts @@ -13,12 +13,12 @@ import { regexFetchProps } from './generic'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; import bfetch from '@utils/BiliFetch'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const API = 'https://api.bilibili.com/pgc/view/web/season?ep_id={ep}'; const API_PLAY = 'https://api.bilibili.com/pgc/player/web/playurl?cid={cid}&ep_id={ep}'; -const CIDPREFIX = `${SOURCE.biliBangumi}-`; +const CIDPREFIX = `${Source.biliBangumi}-`; const fetchPlayUrlPromise = async (cid: string, epid: string) => { try { @@ -55,7 +55,7 @@ const regexFetch = async ({ page: 1, duration: ep.duration, album: ep.share_copy, - source: SOURCE.biliBangumi, + source: Source.biliBangumi, }) ), }; diff --git a/src/utils/mediafetch/biliDynamic.ts b/src/utils/mediafetch/biliDynamic.ts index 52edbec6..10cf7f95 100644 --- a/src/utils/mediafetch/biliDynamic.ts +++ b/src/utils/mediafetch/biliDynamic.ts @@ -1,7 +1,7 @@ import { logger } from '../Logger'; import SongTS from '@objects/Song'; import bfetch from '@utils/BiliFetch'; -import { BiliMusicTid, SOURCE } from '@enums/MediaFetch'; +import { BiliMusicTid, Source } from '@enums/MediaFetch'; import { biliApiLimiter } from './throttle'; const API = @@ -20,7 +20,7 @@ const dynamicToSong = (data: any) => page: 1, duration: data.duration, album: data.title, - source: SOURCE.bilivideo, + source: Source.bilivideo, }); export const fetchDynamic = async (rid = '3', page = 1) => { diff --git a/src/utils/mediafetch/biliRanking.ts b/src/utils/mediafetch/biliRanking.ts index 42244908..bdd26b29 100644 --- a/src/utils/mediafetch/biliRanking.ts +++ b/src/utils/mediafetch/biliRanking.ts @@ -1,7 +1,7 @@ import { logger } from '../Logger'; import SongTS from '@objects/Song'; import bfetch from '@utils/BiliFetch'; -import { SOURCE, BiliMusicTid } from '@enums/MediaFetch'; +import { Source, BiliMusicTid } from '@enums/MediaFetch'; import { biliApiLimiter } from './throttle'; const API = 'https://api.bilibili.com/x/web-interface/ranking/v2?rid={rid}'; @@ -19,7 +19,7 @@ const rankingToSong = (data: any) => page: 1, duration: data.duration, album: data.title, - source: SOURCE.bilivideo, + source: Source.bilivideo, }); export const fetchRanking = async (rid = '3') => { diff --git a/src/utils/mediafetch/biliVideoSimilar.ts b/src/utils/mediafetch/biliVideoSimilar.ts index e6c1b6d6..e1a3fc65 100644 --- a/src/utils/mediafetch/biliVideoSimilar.ts +++ b/src/utils/mediafetch/biliVideoSimilar.ts @@ -3,7 +3,7 @@ import { logger } from '../Logger'; import { regexFetchProps } from './generic'; import bfetch from '@utils/BiliFetch'; -import { SOURCE, BiliMusicTid } from '@enums/MediaFetch'; +import { Source, BiliMusicTid } from '@enums/MediaFetch'; import SongTS from '@objects/Song'; import { fetchBVID } from './bilivideo'; @@ -34,7 +34,7 @@ const fetchBiliVideoSimilarList = async (bvid: string) => { page: 1, duration: data.duration, album: data.title, - source: SOURCE.bilivideo, + source: Source.bilivideo, }) ) ); diff --git a/src/utils/mediafetch/biliaudio.ts b/src/utils/mediafetch/biliaudio.ts index 5c5b7373..6f2b1750 100644 --- a/src/utils/mediafetch/biliaudio.ts +++ b/src/utils/mediafetch/biliaudio.ts @@ -13,14 +13,14 @@ import { regexFetchProps } from './generic'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; import bfetch from '@utils/BiliFetch'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { biliApiLimiter } from './throttle'; const URL_AUDIO_INFO = 'https://www.bilibili.com/audio/music-service-c/web/song/info?sid={sid}'; const URL_AUDIO_PLAY_URL = 'https://www.bilibili.com/audio/music-service-c/web/url?sid={sid}'; -const CIDPREFIX = `${SOURCE.biliaudio}-`; +const CIDPREFIX = `${Source.biliaudio}-`; const fetchPlayUrlPromise = async (sid: string) => { try { @@ -57,7 +57,7 @@ export const baFetch = async (auids: string[]) => { page: 1, duration: data.duration, album: data.title, - source: SOURCE.biliaudio, + source: Source.biliaudio, }); }) ) diff --git a/src/utils/mediafetch/biliavideo.ts b/src/utils/mediafetch/biliavideo.ts index 2a5f5868..b950ed3f 100644 --- a/src/utils/mediafetch/biliavideo.ts +++ b/src/utils/mediafetch/biliavideo.ts @@ -4,7 +4,7 @@ import { biliApiLimiter } from './throttle'; import { logger } from '../Logger'; import bfetch from '@utils/BiliFetch'; import { biliShazamOnSonglist } from './bilishazam'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import SongTS from '@objects/Song'; const URL_VIDEO_INFO = @@ -32,7 +32,7 @@ const fetchAVIDRaw = async (aid: string): Promise => { page: index + 1, duration: page.duration, album: data.title, - source: SOURCE.bilivideo, + source: Source.bilivideo, }); }); // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/utils/mediafetch/bilichannelAudio.ts b/src/utils/mediafetch/bilichannelAudio.ts index 40d9b445..36016d10 100644 --- a/src/utils/mediafetch/bilichannelAudio.ts +++ b/src/utils/mediafetch/bilichannelAudio.ts @@ -9,7 +9,7 @@ * steps to refactor: * each site needs a fetch to parse regex extracted, a videoinfo fetcher and a song fetcher. */ -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { logger } from '../Logger'; import { regexFetchProps } from './generic'; import { fetchAwaitBiliPaginatedAPI } from './paginatedbili'; @@ -20,7 +20,7 @@ import { info } from 'console'; // https://api.bilibili.com/audio/music-service/web/song/upper?uid=741520&pn=1&ps=70&order=1 const URL_BILICHANNEL_AUDIO_INFO = 'https://api.bilibili.com/audio/music-service/web/song/upper?uid=741520&pn={pn}&ps=30&order=1'; -const CIDPREFIX = `${SOURCE.biliaudio}-`; +const CIDPREFIX = `${Source.biliaudio}-`; export const fetchBiliChannelAudioList = async ( mid: string, @@ -50,7 +50,7 @@ export const fetchBiliChannelAudioList = async ( page: 1, duration: info.duration, album: info.title, - source: SOURCE.biliaudio, + source: Source.biliaudio, }) ), }); diff --git a/src/utils/mediafetch/bililive.ts b/src/utils/mediafetch/bililive.ts index 97bd1a42..eb928306 100644 --- a/src/utils/mediafetch/bililive.ts +++ b/src/utils/mediafetch/bililive.ts @@ -4,7 +4,7 @@ import SongTS from '@objects/Song'; import { logger } from '../Logger'; import bfetch from '@utils/BiliFetch'; import { biliApiLimiter } from './throttle'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; interface BiliLiveRoomInfo { room_id: string; @@ -48,14 +48,14 @@ const fetchVideoInfoRaw = async (aid: string) => { const roomInfo = await getRoomInfo(aid); const liverInfo = await getLiver(roomInfo.room_id); return SongTS({ - cid: `${SOURCE.biliLive}-${roomInfo.room_id}`, + cid: `${Source.biliLive}-${roomInfo.room_id}`, bvid: roomInfo.room_id, name: roomInfo.title, singer: liverInfo.uname, cover: roomInfo.user_cover, singerId: aid, album: `b站直播间${aid}`, - source: SOURCE.biliLive, + source: Source.biliLive, isLive: true, liveStatus: roomInfo.live_status === 1, }); diff --git a/src/utils/mediafetch/bilisearch.ts b/src/utils/mediafetch/bilisearch.ts index 0c2f2b08..b321894a 100644 --- a/src/utils/mediafetch/bilisearch.ts +++ b/src/utils/mediafetch/bilisearch.ts @@ -4,7 +4,7 @@ import { timestampToSeconds } from '../Utils'; import bfetch from '../BiliFetch'; import { getBiliCookie } from '@utils/Bilibili/biliCookies'; import SongTS from '@objects/Song'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const URL_BILI_SEARCH = 'https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword={keyword}&page={pn}&tids=3'; @@ -48,7 +48,7 @@ const fastSearchResolveBVID = async (bvobjs: any[]) => { page: 1, duration: timestampToSeconds(obj.duration), album: name, - source: SOURCE.bilivideo, + source: Source.bilivideo, }); }); }; diff --git a/src/utils/mediafetch/bilisublive.ts b/src/utils/mediafetch/bilisublive.ts index ac351c26..b617491a 100644 --- a/src/utils/mediafetch/bilisublive.ts +++ b/src/utils/mediafetch/bilisublive.ts @@ -4,7 +4,7 @@ import axios from 'axios'; import { regexFetchProps } from './generic'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { fetchBiliPaginatedAPI } from './paginatedbili'; // https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/live/info.md#%E6%89%B9%E9%87%8F%E6%9F%A5%E8%AF%A2%E7%9B%B4%E6%92%AD%E9%97%B4%E7%8A%B6%E6%80%81 @@ -33,9 +33,9 @@ const getRoomInfos = async (uids: number[]) => { .map( (roomInfo: any) => SongTS({ - cid: `${SOURCE.biliLive}-${roomInfo.room_id}`, + cid: `${Source.biliLive}-${roomInfo.room_id}`, bvid: roomInfo.room_id, - source: SOURCE.biliLive, + source: Source.biliLive, name: roomInfo.title, singer: roomInfo.uname, singerId: roomInfo.uid, diff --git a/src/utils/mediafetch/bilivideo.ts b/src/utils/mediafetch/bilivideo.ts index b6aded5a..00d7781b 100644 --- a/src/utils/mediafetch/bilivideo.ts +++ b/src/utils/mediafetch/bilivideo.ts @@ -7,7 +7,7 @@ import { biliShazamOnSonglist } from './bilishazam'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; import bfetch from '@utils/BiliFetch'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; export enum FieldEnum { AudioUrl = 'AudioUrl', @@ -45,7 +45,7 @@ const fetchBVIDRaw = async (bvid: string): Promise => { page: index + 1, duration: page.duration, album: data.title, - source: SOURCE.bilivideo, + source: Source.bilivideo, }); }); } catch (error: any) { @@ -201,7 +201,9 @@ const extractResponseJson = (json: any, field: string) => { case FieldEnum.AudioInfo: return {}; default: - throw new Error(`invalid field type: ${field} to parse JSON response from ${json}`); + throw new Error( + `invalid field type: ${field} to parse JSON response from ${json}` + ); } }; diff --git a/src/utils/mediafetch/local.ts b/src/utils/mediafetch/local.ts index 17b500c2..cd6cd84d 100644 --- a/src/utils/mediafetch/local.ts +++ b/src/utils/mediafetch/local.ts @@ -13,7 +13,7 @@ import { Platform, NativeModules } from 'react-native'; import RNFetchBlob from 'react-native-blob-util'; import { probeMetadata, cacheAlbumArt } from '@utils/ffmpeg/ffmpeg'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { regexFetchProps } from './generic'; import SongTS from '@objects/Song'; import logger from '../Logger'; @@ -33,7 +33,7 @@ const songFetch = async ( const uniqMediaFiles = mediaFiles.filter(v => !favlist.includes(v.realPath)); return uniqMediaFiles.map(v => SongTS({ - cid: `${SOURCE.local}-${v.realPath}`, + cid: `${Source.local}-${v.realPath}`, bvid: `file://${v.realPath}`, name: v.title, nameRaw: v.title, @@ -44,7 +44,7 @@ const songFetch = async ( page: 0, duration: v.duration / 1000, album: v.album, - source: SOURCE.local, + source: Source.local, }) ); // TODO: no longer needs FFProbe @@ -61,7 +61,7 @@ const songFetch = async ( logger.warn(v); } return SongTS({ - cid: `${SOURCE.local}-${v.realPath}`, + cid: `${Source.local}-${v.realPath}`, bvid: `file://${v.realPath}`, name: probedMetadata.tags?.title || v.fileName, nameRaw: probedMetadata.tags?.title || v.fileName, @@ -72,7 +72,7 @@ const songFetch = async ( page: 0, duration: Number(probedMetadata.duration) || 0, album: probedMetadata.tags?.album || '', - source: SOURCE.local, + source: Source.local, }); }) ); diff --git a/src/utils/mediafetch/steriatk.ts b/src/utils/mediafetch/steriatk.ts index c396e1c8..0efe00e8 100644 --- a/src/utils/mediafetch/steriatk.ts +++ b/src/utils/mediafetch/steriatk.ts @@ -8,7 +8,7 @@ * steps to refactor: * each site needs a fetch to parse regex extracted, a videoinfo fetcher and a song fetcher. */ -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; import { regexFetchProps } from './generic'; import { fetchAwaitPaginatedAPI } from './paginatedfetch'; import SongTS from '@objects/Song'; @@ -43,7 +43,7 @@ const paginatedFetch = ({ page: 0, duration: 0, album: videoinfo.name, - source: SOURCE.steriatk, + source: Source.steriatk, }) ), progressEmitter, diff --git a/src/utils/mediafetch/ytbchannel.ts b/src/utils/mediafetch/ytbchannel.ts index 39530b1a..e5f33bd1 100644 --- a/src/utils/mediafetch/ytbchannel.ts +++ b/src/utils/mediafetch/ytbchannel.ts @@ -4,7 +4,7 @@ import { get_playlist } from 'libmuse'; import { regexFetchProps } from './generic'; import { CIDPREFIX } from './ytbvideo'; import SongTS from '@objects/Song'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const musePlaylistItemToNoxSong = (val: any, data: any) => { try { @@ -21,7 +21,7 @@ const musePlaylistItemToNoxSong = (val: any, data: any) => { page: 1, duration: val.duration_seconds, album: data.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }); } catch { diff --git a/src/utils/mediafetch/ytbmixlist.ts b/src/utils/mediafetch/ytbmixlist.ts index dc2ebf2b..47e331d2 100644 --- a/src/utils/mediafetch/ytbmixlist.ts +++ b/src/utils/mediafetch/ytbmixlist.ts @@ -2,7 +2,7 @@ import { regexFetchProps } from './generic'; import { CIDPREFIX } from './ytbvideo'; import SongTS from '@objects/Song'; import { timestampToSeconds } from '../Utils'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const fetchYTPlaylist = async ( playlistId: string, @@ -46,7 +46,7 @@ const fetchYTPlaylist = async ( ), album: data.contents.twoColumnWatchNextResults.playlist.playlist.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }), ]) diff --git a/src/utils/mediafetch/ytbplaylist.ts b/src/utils/mediafetch/ytbplaylist.ts index 10727d1a..26f101a6 100644 --- a/src/utils/mediafetch/ytbplaylist.ts +++ b/src/utils/mediafetch/ytbplaylist.ts @@ -5,7 +5,7 @@ import { regexFetchProps } from './generic'; import { fetchAudioInfo, CIDPREFIX } from './ytbvideo'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const musePlaylistItemToNoxSong = (val: any, data: any) => { try { @@ -21,7 +21,7 @@ const musePlaylistItemToNoxSong = (val: any, data: any) => { page: 1, duration: val.duration_seconds, album: data.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }); } catch { @@ -76,7 +76,7 @@ const fastYTPlaylistSongResolve = (val: any, data: any) => { page: Number(val.playlistVideoRenderer.index.simpleText), duration: Number(val.playlistVideoRenderer.lengthSeconds), album: data.metadata.playlistMetadataRenderer.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }); } catch (e) { diff --git a/src/utils/mediafetch/ytbsearch.ts b/src/utils/mediafetch/ytbsearch.ts index fd3b92e1..1ffc9cf6 100644 --- a/src/utils/mediafetch/ytbsearch.ts +++ b/src/utils/mediafetch/ytbsearch.ts @@ -3,7 +3,7 @@ import { search } from 'libmuse'; import { CIDPREFIX } from './ytbvideo'; import SongTS from '@objects/Song'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; const musePlaylistItemToNoxSong = (val: any, data: any) => { try { @@ -19,7 +19,7 @@ const musePlaylistItemToNoxSong = (val: any, data: any) => { page: 1, duration: val.duration_seconds, album: data.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }); } catch { diff --git a/src/utils/mediafetch/ytbvideo.ts b/src/utils/mediafetch/ytbvideo.ts index ce94d762..18ed606a 100644 --- a/src/utils/mediafetch/ytbvideo.ts +++ b/src/utils/mediafetch/ytbvideo.ts @@ -15,7 +15,7 @@ import { biliApiLimiter } from './throttle'; import SongTS from '@objects/Song'; import { logger } from '../Logger'; -import { SOURCE } from '@enums/MediaFetch'; +import { Source } from '@enums/MediaFetch'; export const CIDPREFIX = 'youtube-'; @@ -181,7 +181,7 @@ const fetchAudioInfoRaw = async (sid: string) => { ) : 0, album: videoDetails.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }), ]; @@ -242,7 +242,7 @@ const suggest = async (song: NoxMedia.Song, filterMW = (v: T[]) => v[0]) => { page: 1, duration: Number(suggestSong.length_seconds), album: suggestSong.title, - source: SOURCE.ytbvideo, + source: Source.ytbvideo, metadataOnLoad: true, }) ); diff --git a/src/utils/playlistOperations.ts b/src/utils/playlistOperations.ts index 44019e75..0bcb92b8 100644 --- a/src/utils/playlistOperations.ts +++ b/src/utils/playlistOperations.ts @@ -1,4 +1,4 @@ -import { SORT_OPTIONS } from '@enums/Playlist'; +import { SortOptions } from '@enums/Playlist'; export const updatePlaylistSongs = ( playlist: NoxMedia.Playlist, @@ -17,11 +17,11 @@ export const updatePlaylistSongs = ( export const sortPlaylist = ( playlist: NoxMedia.Playlist, - sort: SORT_OPTIONS = SORT_OPTIONS.PREVIOUS_ORDER, + sort: SortOptions = SortOptions.PreviousOrder, ascend = false ): NoxMedia.Playlist => { playlist.sort = sort; - if (SORT_OPTIONS.PREVIOUS_ORDER === sort) { + if (SortOptions.PreviousOrder === sort) { // first get the largest order number in the songlist: let largestOrder = 0; let songsWithoutOrder = 1; @@ -56,7 +56,7 @@ export const sortPlaylist = ( (song, index) => (song.order = songListLength - index) ); switch (sort) { - case SORT_OPTIONS.TITLE: + case SortOptions.Title: return { ...playlist, songList: playlist.songList.sort((a, b) => @@ -65,7 +65,7 @@ export const sortPlaylist = ( : b.parsedName.localeCompare(a.parsedName) ), }; - case SORT_OPTIONS.ARTIST: + case SortOptions.Artist: return { ...playlist, songList: playlist.songList.sort((a, b) => @@ -74,7 +74,7 @@ export const sortPlaylist = ( : b.singer.localeCompare(a.singer) ), }; - case SORT_OPTIONS.ALBUM: + case SortOptions.Album: return { ...playlist, songList: playlist.songList.sort((a, b) => diff --git a/src/utils/re.ts b/src/utils/re.ts index fcd8de20..d24ab4ef 100644 --- a/src/utils/re.ts +++ b/src/utils/re.ts @@ -1,12 +1,12 @@ -import { REOPERATIONTYPE } from '@enums/Utils'; +import { ReOperationType } from '@enums/Utils'; import { SearchRegex } from '@enums/Playlist'; const operation2RegExtractor = (operation: NoxRegExt.Operation) => { const regExps = operation[1]?.map(val => new RegExp(val)); switch (operation[0]) { - case REOPERATIONTYPE.extractWith: + case ReOperationType.ExtractWith: return (val: string) => extractWith(val, regExps); - case REOPERATIONTYPE.extractParenthesis: + case ReOperationType.ExtractParenthesis: return (val: string) => extractParenthesis(val); default: return (val: string) => val; diff --git a/yarn.lock b/yarn.lock index 7598ff3f..35d72a00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3303,6 +3303,11 @@ dependencies: invariant "^2.2.4" +"@react-native-masked-view/masked-view@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@react-native-masked-view/masked-view/-/masked-view-0.3.1.tgz#5bd76f17004a6ccbcec03856893777ee91f23d29" + integrity sha512-uVm8U6nwFIlUd1iDIB5cS+lDadApKR+l8k4k84d9hn+GN4lzAIJhUZ9syYX7c022MxNgAlbxoFLt0pqKoyaAGg== + "@react-native-windows/cli@0.73.2": version "0.73.2" resolved "https://registry.yarnpkg.com/@react-native-windows/cli/-/cli-0.73.2.tgz#e169e77f84f526d7e310590c5d77de2d83558653" @@ -4419,10 +4424,10 @@ dependencies: undici-types "~5.26.4" -"@types/node@^20.12.5": - version "20.12.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.5.tgz#74c4f31ab17955d0b5808cdc8fd2839526ad00b3" - integrity sha512-BD+BjQ9LS/D8ST9p5uqBxghlN+S42iuNxjsUGjeZobe/ciXzk2qb1B6IXc6AnRLS+yFJRpN2IPEHMzwspfDJNw== +"@types/node@^20.12.7": + version "20.12.7" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.7.tgz#04080362fa3dd6c5822061aa3124f5c152cff384" + integrity sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg== dependencies: undici-types "~5.26.4" @@ -4493,10 +4498,10 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^18.2.74": - version "18.2.74" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.74.tgz#2d52eb80e4e7c4ea8812c89181d6d590b53f958c" - integrity sha512-9AEqNZZyBx8OdZpxzQlaFEVCSFUM2YXJH46yPOiOpm078k6ZLOCcuAzGum/zK8YBwY+dbahVNbHrbgrAwIRlqw== +"@types/react@^18.2.75": + version "18.2.75" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.75.tgz#45d18f384939306d35312def1bf532eb38a68562" + integrity sha512-+DNnF7yc5y0bHkBTiLKqXFe+L4B3nvOphiMY3tuA5X10esmjqk7smyBZzbGTy2vsiy/Bnzj8yFIBL8xhRacoOg== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -7711,10 +7716,10 @@ expo-modules-autolinking@1.10.3: find-up "^5.0.0" fs-extra "^9.1.0" -expo-modules-core@1.11.12: - version "1.11.12" - resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.11.12.tgz#d5c7b3ed7ab57d4fb6885a0d8e10287dcf1ffe5f" - integrity sha512-/e8g4kis0pFLer7C0PLyx98AfmztIM6gU9jLkYnB1pU9JAfQf904XEi3bmszO7uoteBQwSL6FLp1m3TePKhDaA== +expo-modules-core@1.11.13: + version "1.11.13" + resolved "https://registry.yarnpkg.com/expo-modules-core/-/expo-modules-core-1.11.13.tgz#a8e63ad844e966dce78dea40b50839af6c3bc518" + integrity sha512-2H5qrGUvmLzmJNPDOnovH1Pfk5H/S/V0BifBmOQyDc9aUh9LaDwkqnChZGIXv8ZHDW8JRlUW0QqyWxTggkbw1A== dependencies: invariant "^2.2.4" @@ -7723,10 +7728,10 @@ expo-secure-store@~12.8.1: resolved "https://registry.yarnpkg.com/expo-secure-store/-/expo-secure-store-12.8.1.tgz#369a570702fa1dc0c49ea41a5ab18aca2a986d38" integrity sha512-Ju3jmkHby4w7rIzdYAt9kQyQ7HhHJ0qRaiQOInknhOLIltftHjEgF4I1UmzKc7P5RCfGNmVbEH729Pncp/sHXQ== -expo@^50.0.14: - version "50.0.14" - resolved "https://registry.yarnpkg.com/expo/-/expo-50.0.14.tgz#ddcae86aa0ba8d1be3da9ad1bdda23fa539dc97d" - integrity sha512-yLPdxCMVAbmeEIpzzyAuJ79wvr6ToDDtQmuLDMAgWtjqP8x3CGddXxUe07PpKEQgzwJabdHvCLP5Bv94wMFIjQ== +expo@^50.0.15: + version "50.0.15" + resolved "https://registry.yarnpkg.com/expo/-/expo-50.0.15.tgz#18c5c3ee0125fd42fe828b6791410eed68f7e74a" + integrity sha512-tsyRmMHjA8lPlM7AsqH1smSH8hzmn1+x/vsP+xgbKYJTGtYccdY/wsm6P84VJWeK5peWSVqrWNos+YuPqXKLSQ== dependencies: "@babel/runtime" "^7.20.0" "@expo/cli" "0.17.8" @@ -7740,7 +7745,7 @@ expo@^50.0.14: expo-font "~11.10.3" expo-keep-awake "~12.8.2" expo-modules-autolinking "1.10.3" - expo-modules-core "1.11.12" + expo-modules-core "1.11.13" fbemitter "^3.0.0" whatwg-url-without-unicode "8.0.0-3" @@ -8744,10 +8749,10 @@ hyphenate-style-name@^1.0.3: resolved "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d" integrity sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ== -i18next@^23.11.0: - version "23.11.0" - resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.11.0.tgz#3aaa38e887350db573af91eabddd71ab9fcd9ea8" - integrity sha512-VwFtlgy2LDbY0Qs6VfekIm6mv5/JmSJrtBf4aszl7Vby8+GcBlri0/7dkMZXmzTfiBMPUPBOmYCdQK7K4emkGQ== +i18next@^23.11.1: + version "23.11.1" + resolved "https://registry.yarnpkg.com/i18next/-/i18next-23.11.1.tgz#8e384b6ad7d6ba70c40cb86e020438251a5ff8b1" + integrity sha512-mXw4A24BiPZKRsbb9ewgSvjYd6fxFCNwJyfK6nYfSTIAX2GkCWcb598m3DFkDZmqADatvuASrKo6qwORz3VwTQ== dependencies: "@babel/runtime" "^7.23.2" @@ -12075,7 +12080,7 @@ react-native-flipper@^0.164.0: resolved "https://registry.yarnpkg.com/react-native-flipper/-/react-native-flipper-0.164.0.tgz#64f6269a86a13a72e30f53ba9f5281d2073a7697" integrity sha512-iJhIe3rqx6okuzBp4AJsTa2b8VRAOGzoLRFx/4HGbaGvu8AurZjz8TTQkhJsRma8dsHN2b6KKZPvGGW3wdWzvA== -react-native-gesture-handler@^2.16.0: +react-native-gesture-handler@2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.16.0.tgz#45a00b5988e74ebc58f130c8d1443319c8e678db" integrity sha512-1hFkx7RIfeJSyTQQ0Nkv4icFVZ5+XjQkd47OgZMBFzoB7ecL+nFSz8KLi3OCWOhq+nbHpSPlSG5VF3CQNCJpWA== @@ -12093,9 +12098,11 @@ react-native-get-random-values@^1.11.0: dependencies: fast-base64-decode "^1.0.0" -"react-native-lyric@git+https://github.com/lovegaoshi/react-native-lyric.git": +"react-native-lyric@git+https://github.com/lovegaoshi/react-native-lyric.git#dev": version "1.0.1" - resolved "git+https://github.com/lovegaoshi/react-native-lyric.git#a1f32b2e615db77b603b4fb98579d7a7e20ca663" + resolved "git+https://github.com/lovegaoshi/react-native-lyric.git#46ff2b5ec7a5cb979d3e350361c45ac16a708ab8" + dependencies: + "@react-native-masked-view/masked-view" "^0.3.1" react-native-pager-view@^6.3.0: version "6.3.0" @@ -12143,10 +12150,10 @@ react-native-safe-area-context@^4.9.0: resolved "https://registry.npmjs.org/react-native-safe-area-context/-/react-native-safe-area-context-4.9.0.tgz#21a570ca3594cb4259ba65f93befaa60d91bcbd0" integrity sha512-/OJD9Pb8IURyvn+1tWTszWPJqsbZ4hyHBU9P0xhOmk7h5owSuqL0zkfagU0pg7Vh0G2NKQkaPpUKUMMCUMDh/w== -react-native-screens@3.30.1: - version "3.30.1" - resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.30.1.tgz#254f5cbbeed649492da112756f85ecae3ccf313e" - integrity sha512-/muEvjocCtFb+j5J3YmLvB25+f4rIU8hnnxgGTkXcAf2omPBY8uhPjJaaFUlvj64VEoEzJcRpugbXWsjfPPIFg== +react-native-screens@3.29.0: + version "3.29.0" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.29.0.tgz#1dee0326defbc1d4ef4e68287abb32a8e6b76b29" + integrity sha512-yB1GoAMamFAcYf4ku94uBPn0/ani9QG7NdI98beJ5cet2YFESYYzuEIuU+kt+CNRcO8qqKeugxlfgAa3HyTqlg== dependencies: react-freeze "^1.0.0" warn-once "^0.1.0" @@ -13452,7 +13459,16 @@ string-natural-compare@^3.0.1: resolved "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -13526,7 +13542,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -13540,6 +13556,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -14055,10 +14078,10 @@ typed-array-length@^1.0.5: is-typed-array "^1.1.13" possible-typed-array-names "^1.0.0" -typescript@5.4.4: - version "5.4.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.4.tgz#eb2471e7b0a5f1377523700a21669dce30c2d952" - integrity sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw== +typescript@5.4.5: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== typescript@^3.7.5: version "3.9.10" @@ -14442,7 +14465,7 @@ wonka@^6.3.2: resolved "https://registry.npmjs.org/wonka/-/wonka-6.3.4.tgz#76eb9316e3d67d7febf4945202b5bdb2db534594" integrity sha512-CjpbqNtBGNAeyNS/9W6q3kSkKE52+FjIj7AkFlLr11s/VWGUu6a2CdYSdGxocIhIVjaW/zchesBQUKPVU69Cqg== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -14460,6 +14483,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"