diff --git a/Podfile b/Podfile index 2fd0892cb150..606e96c30f8d 100644 --- a/Podfile +++ b/Podfile @@ -29,7 +29,7 @@ def aztec ## pod 'WordPress-Editor-iOS', :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :commit => 'ba8524aba1332550efb05cad583a85ed3511beb5' ## pod 'WordPress-Editor-iOS', :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :tag => '1.5.0.beta.1' ## pod 'WordPress-Editor-iOS', :path => '../AztecEditor-iOS' - pod 'WordPress-Editor-iOS', '~> 1.19.0' + pod 'WordPress-Editor-iOS', '~> 1.19.1' end def wordpress_ui @@ -147,7 +147,7 @@ target 'WordPress' do ## Gutenberg (React Native) ## ===================== ## - gutenberg :tag => 'v1.28.0' + gutenberg :commit => '1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7' ## Third party libraries ## ===================== diff --git a/Podfile.lock b/Podfile.lock index cd5737f6dd82..dc0029f64a0e 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -363,7 +363,7 @@ PODS: - React - RNTAztecView (1.28.0): - React-Core - - WordPress-Aztec-iOS (~> 1.19.0) + - WordPress-Aztec-iOS (~> 1.19.1) - Sentry (4.5.0): - Sentry/Core (= 4.5.0) - Sentry/Core (4.5.0) @@ -429,15 +429,15 @@ DEPENDENCIES: - Charts (~> 3.2.2) - CocoaLumberjack (= 3.5.2) - Down (~> 0.6.6) - - FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/FBLazyVector.podspec.json`) - - FBReactNativeSpec (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/FBReactNativeSpec.podspec.json`) - - Folly (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json`) + - FBLazyVector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/FBLazyVector.podspec.json`) + - FBReactNativeSpec (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/FBReactNativeSpec.podspec.json`) + - Folly (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json`) - FormatterKit/TimeIntervalFormatter (= 1.8.2) - FSInteractiveMap (from `https://github.com/wordpress-mobile/FSInteractiveMap.git`, tag `0.2.0`) - Gifu (= 3.2.0) - - glog (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/glog.podspec.json`) + - glog (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/glog.podspec.json`) - Gridicons (~> 1.0.1) - - Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, tag `v1.28.0`) + - Gutenberg (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7`) - JTAppleCalendar (~> 8.0.2) - MediaEditor (~> 1.1.0) - MRProgress (= 0.8.3) @@ -447,45 +447,45 @@ DEPENDENCIES: - OCMock (= 3.4.3) - OHHTTPStubs (= 6.1.0) - OHHTTPStubs/Swift (= 6.1.0) - - RCTRequired (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RCTRequired.podspec.json`) - - RCTTypeSafety (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RCTTypeSafety.podspec.json`) + - RCTRequired (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RCTRequired.podspec.json`) + - RCTTypeSafety (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RCTTypeSafety.podspec.json`) - Reachability (= 3.2) - - React (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json`) - - React-Core (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-Core.podspec.json`) - - React-CoreModules (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-CoreModules.podspec.json`) - - React-cxxreact (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-cxxreact.podspec.json`) - - React-jsi (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsi.podspec.json`) - - React-jsiexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsiexecutor.podspec.json`) - - React-jsinspector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsinspector.podspec.json`) - - react-native-keyboard-aware-scroll-view (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json`) - - react-native-linear-gradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-linear-gradient.podspec.json`) - - react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json`) - - react-native-slider (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-slider.podspec.json`) - - react-native-video (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-video.podspec.json`) - - React-RCTActionSheet (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTActionSheet.podspec.json`) - - React-RCTAnimation (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTAnimation.podspec.json`) - - React-RCTBlob (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTBlob.podspec.json`) - - React-RCTImage (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTImage.podspec.json`) - - React-RCTLinking (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTLinking.podspec.json`) - - React-RCTNetwork (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTNetwork.podspec.json`) - - React-RCTSettings (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTSettings.podspec.json`) - - React-RCTText (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTText.podspec.json`) - - React-RCTVibration (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTVibration.podspec.json`) - - ReactCommon (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/ReactCommon.podspec.json`) - - ReactNativeDarkMode (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/ReactNativeDarkMode.podspec.json`) - - RNSVG (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RNSVG.podspec.json`) - - RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, tag `v1.28.0`) + - React (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json`) + - React-Core (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-Core.podspec.json`) + - React-CoreModules (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-CoreModules.podspec.json`) + - React-cxxreact (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-cxxreact.podspec.json`) + - React-jsi (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsi.podspec.json`) + - React-jsiexecutor (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsiexecutor.podspec.json`) + - React-jsinspector (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsinspector.podspec.json`) + - react-native-keyboard-aware-scroll-view (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json`) + - react-native-linear-gradient (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-linear-gradient.podspec.json`) + - react-native-safe-area (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json`) + - react-native-slider (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-slider.podspec.json`) + - react-native-video (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-video.podspec.json`) + - React-RCTActionSheet (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTActionSheet.podspec.json`) + - React-RCTAnimation (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTAnimation.podspec.json`) + - React-RCTBlob (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTBlob.podspec.json`) + - React-RCTImage (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTImage.podspec.json`) + - React-RCTLinking (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTLinking.podspec.json`) + - React-RCTNetwork (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTNetwork.podspec.json`) + - React-RCTSettings (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTSettings.podspec.json`) + - React-RCTText (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTText.podspec.json`) + - React-RCTVibration (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTVibration.podspec.json`) + - ReactCommon (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/ReactCommon.podspec.json`) + - ReactNativeDarkMode (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/ReactNativeDarkMode.podspec.json`) + - RNSVG (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RNSVG.podspec.json`) + - RNTAztecView (from `http://github.com/wordpress-mobile/gutenberg-mobile/`, commit `1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7`) - SimulatorStatusMagic - Starscream (= 3.0.6) - SVProgressHUD (= 2.2.5) - - WordPress-Editor-iOS (~> 1.19.0) + - WordPress-Editor-iOS (~> 1.19.1) - WordPressAuthenticator (~> 1.16.1) - WordPressKit (~> 4.8.0) - WordPressMocks (~> 0.0.8) - WordPressShared (~> 1.8.16) - WordPressUI (~> 1.7.0) - WPMediaPicker (~> 1.6.1) - - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/Yoga.podspec.json`) + - Yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/Yoga.podspec.json`) - ZendeskSupportSDK (= 5.0.0) - ZIPFoundation (~> 0.9.8) @@ -545,87 +545,87 @@ SPEC REPOS: EXTERNAL SOURCES: FBLazyVector: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/FBLazyVector.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/FBLazyVector.podspec.json FBReactNativeSpec: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/FBReactNativeSpec.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/FBReactNativeSpec.podspec.json Folly: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/Folly.podspec.json FSInteractiveMap: :git: https://github.com/wordpress-mobile/FSInteractiveMap.git :tag: 0.2.0 glog: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/glog.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/glog.podspec.json Gutenberg: + :commit: 1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7 :git: http://github.com/wordpress-mobile/gutenberg-mobile/ - :tag: v1.28.0 RCTRequired: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RCTRequired.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RCTRequired.podspec.json RCTTypeSafety: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RCTTypeSafety.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RCTTypeSafety.podspec.json React: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React.podspec.json React-Core: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-Core.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-Core.podspec.json React-CoreModules: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-CoreModules.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-CoreModules.podspec.json React-cxxreact: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-cxxreact.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-cxxreact.podspec.json React-jsi: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsi.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsi.podspec.json React-jsiexecutor: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsiexecutor.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsiexecutor.podspec.json React-jsinspector: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-jsinspector.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-jsinspector.podspec.json react-native-keyboard-aware-scroll-view: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-keyboard-aware-scroll-view.podspec.json react-native-linear-gradient: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-linear-gradient.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-linear-gradient.podspec.json react-native-safe-area: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-safe-area.podspec.json react-native-slider: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-slider.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-slider.podspec.json react-native-video: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/react-native-video.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/react-native-video.podspec.json React-RCTActionSheet: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTActionSheet.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTActionSheet.podspec.json React-RCTAnimation: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTAnimation.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTAnimation.podspec.json React-RCTBlob: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTBlob.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTBlob.podspec.json React-RCTImage: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTImage.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTImage.podspec.json React-RCTLinking: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTLinking.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTLinking.podspec.json React-RCTNetwork: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTNetwork.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTNetwork.podspec.json React-RCTSettings: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTSettings.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTSettings.podspec.json React-RCTText: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTText.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTText.podspec.json React-RCTVibration: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/React-RCTVibration.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/React-RCTVibration.podspec.json ReactCommon: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/ReactCommon.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/ReactCommon.podspec.json ReactNativeDarkMode: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/ReactNativeDarkMode.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/ReactNativeDarkMode.podspec.json RNSVG: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/RNSVG.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/RNSVG.podspec.json RNTAztecView: + :commit: 1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7 :git: http://github.com/wordpress-mobile/gutenberg-mobile/ - :tag: v1.28.0 Yoga: - :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.28.0/react-native-gutenberg-bridge/third-party-podspecs/Yoga.podspec.json + :podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7/react-native-gutenberg-bridge/third-party-podspecs/Yoga.podspec.json CHECKOUT OPTIONS: FSInteractiveMap: :git: https://github.com/wordpress-mobile/FSInteractiveMap.git :tag: 0.2.0 Gutenberg: + :commit: 1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7 :git: http://github.com/wordpress-mobile/gutenberg-mobile/ - :tag: v1.28.0 RNTAztecView: + :commit: 1f5ee28cfd84a9a7fd962f0d63f560baeb777ba7 :git: http://github.com/wordpress-mobile/gutenberg-mobile/ - :tag: v1.28.0 SPEC CHECKSUMS: 1PasswordExtension: f97cc80ae58053c331b2b6dc8843ba7103b33794 @@ -687,7 +687,7 @@ SPEC CHECKSUMS: ReactCommon: 48926fc48fcd7c8a629860049ffba9c23b4005dc ReactNativeDarkMode: f61376360c5d983907e5c316e8e1c853a8c2f348 RNSVG: 68a534a5db06dcbdaebfd5079349191598caef7b - RNTAztecView: c8face301ee453aab24e9e10615353134cca505b + RNTAztecView: 86f6b2820ee97d02f69d9eb28659cf76bd70e910 Sentry: ab6c209f23700d1460691dbc90e19ed0a05d496b SimulatorStatusMagic: 28d4a9d1a500ac7cea0b2b5a43c1c6ddb40ba56c Sodium: 63c0ca312a932e6da481689537d4b35568841bdc @@ -714,6 +714,6 @@ SPEC CHECKSUMS: ZendeskSupportSDK: a87ab1e4badace92c75eb11dc77ede1e995b2adc ZIPFoundation: 249fa8890597086cd536bb2df5c9804d84e122b0 -PODFILE CHECKSUM: 517e198a1c1730462634dd1f9d75de9b60a57d0b +PODFILE CHECKSUM: c7cd4e5f6e2a96a7ff3631ef6704512b53f9e88a COCOAPODS: 1.8.4 diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d1a59f15a963..6c1c88981f1b 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -25,6 +25,8 @@ 14.8 ----- +* Block Editor: Mentions insertion are now available for WP.com and Jetpack sites. + * Block editor: Prefill caption for image blocks when available on the Media library * Block editor: New block: Buttons. From now you’ll be able to add the individual Button block only inside the Buttons block * Block editor: Fix bug where whitespaces at start of text blocks were being removed diff --git a/WordPress/Classes/Categories/WPStyleGuide+Suggestions.m b/WordPress/Classes/Categories/WPStyleGuide+Suggestions.m index 656c5374fc0b..41591cca125d 100644 --- a/WordPress/Classes/Categories/WPStyleGuide+Suggestions.m +++ b/WordPress/Classes/Categories/WPStyleGuide+Suggestions.m @@ -3,8 +3,18 @@ @implementation WPStyleGuide (Suggestions) + (UIColor *)suggestionsHeaderSmoke -{ - return [UIColor colorWithRed:0. green:0. blue:0. alpha:0.3]; +{ + if (@available(iOS 13.0, *)) { + return [UIColor colorWithDynamicProvider:^(UITraitCollection *traitCollection) { + if (traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { + return [UIColor colorWithRed:0. green:0. blue:0. alpha:0.7]; + } else { + return [UIColor colorWithRed:0. green:0. blue:0. alpha:0.3]; + } + }]; + } else { + return [UIColor colorWithRed:0. green:0. blue:0. alpha:0.3]; + } } + (UIColor *)suggestionsSeparatorSmoke diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergMentionsViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergMentionsViewController.swift new file mode 100644 index 000000000000..0e1996a5d8bb --- /dev/null +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergMentionsViewController.swift @@ -0,0 +1,184 @@ +import Foundation +import UIKit + +public class GutenbergMentionsViewController: UIViewController { + + static let mentionTriggerText = String("@") + + public lazy var backgroundView: UIView = { + let view = UIView(frame: .zero) + view.backgroundColor = .listForeground + view.translatesAutoresizingMaskIntoConstraints = false + return view + }() + + public lazy var separatorView: UIView = { + let view = UIView(frame: .zero) + view.backgroundColor = UIColor.divider + view.translatesAutoresizingMaskIntoConstraints = false + view.backgroundColor = UIColor(light: UIColor.colorFromHex("e9eff3"), dark: UIColor.colorFromHex("2e2e2e")) + return view + }() + + public lazy var searchView: UITextField = { + let textField = UITextField(frame: CGRect.zero) + textField.placeholder = NSLocalizedString("Search users...", comment: "Placeholder message when showing mentions search field") + textField.text = Self.mentionTriggerText + textField.clearButtonMode = .whileEditing + textField.translatesAutoresizingMaskIntoConstraints = false + textField.delegate = self + textField.textColor = .text + return textField + }() + + public lazy var suggestionsView: SuggestionsTableView = { + let suggestionsView = SuggestionsTableView() + suggestionsView.animateWithKeyboard = false + suggestionsView.enabled = true + suggestionsView.showLoading = true + suggestionsView.showSuggestions(forWord: Self.mentionTriggerText) + suggestionsView.suggestionsDelegate = self + suggestionsView.translatesAutoresizingMaskIntoConstraints = false + suggestionsView.siteID = siteID + suggestionsView.useTransparentHeader = false + return suggestionsView + }() + + private let siteID: NSNumber + public var onCompletion: ((Result) -> Void)? + + public init(siteID: NSNumber) { + self.siteID = siteID + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override public func viewDidLoad() { + view.translatesAutoresizingMaskIntoConstraints = false + view.backgroundColor = .clear + + let toolbarSize = CGFloat(44) + + view.addSubview(backgroundView) + NSLayoutConstraint.activate([ + backgroundView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + backgroundView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + backgroundView.bottomAnchor.constraint(equalTo: view.safeBottomAnchor), + backgroundView.heightAnchor.constraint(equalToConstant: toolbarSize) + ]) + + let margin = CGFloat(10) + view.addSubview(searchView) + searchView.becomeFirstResponder() + NSLayoutConstraint.activate([ + searchView.leadingAnchor.constraint(equalTo: view.safeLeadingAnchor, constant: margin), + searchView.trailingAnchor.constraint(equalTo: view.safeTrailingAnchor, constant: -margin), + searchView.bottomAnchor.constraint(equalTo: view.safeBottomAnchor), + searchView.heightAnchor.constraint(equalToConstant: toolbarSize) + ]) + + view.addSubview(suggestionsView) + NSLayoutConstraint.activate([ + suggestionsView.leadingAnchor.constraint(equalTo: view.safeLeadingAnchor, constant: 0), + suggestionsView.trailingAnchor.constraint(equalTo: view.safeTrailingAnchor, constant: 0), + suggestionsView.bottomAnchor.constraint(equalTo: searchView.topAnchor), + suggestionsView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + ]) + + view.addSubview(separatorView) + NSLayoutConstraint.activate([ + separatorView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + separatorView.trailingAnchor.constraint(equalTo: view.trailingAnchor), + separatorView.bottomAnchor.constraint(equalTo: backgroundView.topAnchor), + separatorView.heightAnchor.constraint(equalToConstant: 1.0) + ]) + + view.setNeedsUpdateConstraints() + } + + override public func viewDidAppear(_ animated: Bool) { + suggestionsView.showSuggestions(forWord: Self.mentionTriggerText) + } +} + +extension GutenbergMentionsViewController: UITextFieldDelegate { + + public func textFieldShouldClear(_ textField: UITextField) -> Bool { + onCompletion?(.failure(buildErrorForCancelation())) + return true + } + + public func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { + guard let nsString = textField.text as NSString? else { + return true + } + let searchWord = nsString.replacingCharacters(in: range, with: string) + if searchWord.hasPrefix(Self.mentionTriggerText) { + suggestionsView.showSuggestions(forWord: searchWord) + } else { + // We are dispatching this async to allow this delegate to finish and process the keypress before executing the cancelation. + DispatchQueue.main.async { + self.onCompletion?(.failure(self.buildErrorForCancelation())) + } + } + return true + } + + public func textFieldShouldReturn(_ textField: UITextField) -> Bool { + if suggestionsView.numberOfSuggestions() == 1 { + suggestionsView.selectSuggestion(atPosition: 0) + } + return true + } +} + +extension GutenbergMentionsViewController: SuggestionsTableViewDelegate { + + public func suggestionsTableView(_ suggestionsTableView: SuggestionsTableView, didSelectSuggestion suggestion: String?, forSearchText text: String) { + if let suggestion = suggestion { + onCompletion?(.success(suggestion)) + } + } + + public func suggestionsTableView(_ suggestionsTableView: SuggestionsTableView, didChangeTableBounds bounds: CGRect) { + + } + + public func suggestionsTableViewMaxDisplayedRows(_ suggestionsTableView: SuggestionsTableView) -> Int { + return 7 + } + + public func suggestionsTableViewDidTapHeader(_ suggestionsTableView: SuggestionsTableView) { + onCompletion?(.failure(buildErrorForCancelation())) + } +} + +extension GutenbergMentionsViewController { + + enum MentionError: CustomNSError { + case canceled + case notAvailable + + static var errorDomain: String = "MentionErrorDomain" + + var errorCode: Int { + switch self { + case .canceled: + return 1 + case .notAvailable: + return 2 + } + } + + var errorUserInfo: [String: Any] { + return [:] + } + } + + private func buildErrorForCancelation() -> NSError { + return MentionError.canceled as NSError + } +} diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index d19c1540b998..8bde8bab64ac 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -254,6 +254,7 @@ class GutenbergViewController: UIViewController, PostEditor { } deinit { + tearDownKeyboardObservers() removeObservers(fromPost: post) gutenberg.invalidate() attachmentDelegate.cancelAllPendingMediaRequests() @@ -263,6 +264,7 @@ class GutenbergViewController: UIViewController, PostEditor { override func viewDidLoad() { super.viewDidLoad() + setupKeyboardObservers() WPFontManager.loadNotoFontFamily() createRevisionOfPost(loadAutosaveRevision: loadAutosaveRevision) setupGutenbergView() @@ -280,6 +282,36 @@ class GutenbergViewController: UIViewController, PostEditor { // MARK: - Functions + private var keyboardShowObserver: Any? + private var keyboardHideObserver: Any? + private var keyboardFrame = CGRect.zero + private var mentionsBottomConstraint: NSLayoutConstraint? + private var previousFirstResponder: UIView? + + private func setupKeyboardObservers() { + keyboardShowObserver = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { (notification) in + if let keyboardRect = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect { + self.keyboardFrame = keyboardRect + self.updateConstraintsToAvoidKeyboard(frame: keyboardRect) + } + } + keyboardHideObserver = NotificationCenter.default.addObserver(forName: UIResponder.keyboardDidShowNotification, object: nil, queue: .main) { (notification) in + if let keyboardRect = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect { + self.keyboardFrame = keyboardRect + self.updateConstraintsToAvoidKeyboard(frame: keyboardRect) + } + } + } + + private func tearDownKeyboardObservers() { + if let keyboardShowObserver = keyboardShowObserver { + NotificationCenter.default.removeObserver(keyboardShowObserver) + } + if let keyboardHideObserver = keyboardHideObserver { + NotificationCenter.default.removeObserver(keyboardHideObserver) + } + } + private func configureNavigationBar() { navigationController?.navigationBar.isTranslucent = false navigationController?.navigationBar.accessibilityIdentifier = "Gutenberg Editor Navigation Bar" @@ -614,6 +646,65 @@ extension GutenbergViewController: GutenbergBridgeDelegate { controller.modalPresentationStyle = .overCurrentContext self.present(controller, animated: true) } + + func updateConstraintsToAvoidKeyboard(frame: CGRect) { + keyboardFrame = frame + let minimumKeyboardHeight = CGFloat(50) + guard let mentionsBottomConstraint = mentionsBottomConstraint else { + return + } + + // There are cases where the keyboard is not visible, but the system instead of returning zero, returns a low number, for example: 0, 3, 69. + // So in those scenarios, we just need to take in account the safe area and ignore the keyboard all together. + if keyboardFrame.height < minimumKeyboardHeight { + mentionsBottomConstraint.constant = -self.view.safeAreaInsets.bottom + } + else { + mentionsBottomConstraint.constant = -self.keyboardFrame.height + } + } + + func gutenbergDidRequestMention(callback: @escaping (Swift.Result) -> Void) { + DispatchQueue.main.async(execute: { [weak self] in + self?.mentionShow(callback: callback) + }) + } +} + +// MARK: - Mention implementation + +extension GutenbergViewController { + + private func mentionShow(callback: @escaping (Swift.Result) -> Void) { + guard let siteID = post.blog.dotComID else { + callback(.failure(GutenbergMentionsViewController.MentionError.notAvailable as NSError)) + return + } + + previousFirstResponder = view.findFirstResponder() + let mentionsController = GutenbergMentionsViewController(siteID: siteID) + mentionsController.onCompletion = { (result) in + callback(result) + mentionsController.view.removeFromSuperview() + mentionsController.removeFromParent() + if let previousFirstResponder = self.previousFirstResponder { + previousFirstResponder.becomeFirstResponder() + } + } + addChild(mentionsController) + view.addSubview(mentionsController.view) + let mentionsBottomConstraint = mentionsController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0) + NSLayoutConstraint.activate([ + mentionsController.view.leadingAnchor.constraint(equalTo: view.safeLeadingAnchor, constant: 0), + mentionsController.view.trailingAnchor.constraint(equalTo: view.safeTrailingAnchor, constant: 0), + mentionsBottomConstraint, + mentionsController.view.topAnchor.constraint(equalTo: view.safeTopAnchor) + ]) + self.mentionsBottomConstraint = mentionsBottomConstraint + updateConstraintsToAvoidKeyboard(frame: keyboardFrame) + mentionsController.didMove(toParent: self) + } + } // MARK: - GutenbergBridgeDataSource @@ -650,6 +741,12 @@ extension GutenbergViewController: GutenbergBridgeDataSource { .filesApp, ].compactMap { $0 } } + + func gutenbergCapabilities() -> [String: Bool]? { + return [ + "mentions": post.blog.isAccessibleThroughWPCom() + ] + } } // MARK: - PostEditorStateContextDelegate diff --git a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.h b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.h index 028e66bac8eb..036249762061 100644 --- a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.h +++ b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.h @@ -7,6 +7,8 @@ @property (nonatomic, nullable, weak) id suggestionsDelegate; @property (nonatomic, nullable, strong) NSNumber *siteID; @property (nonatomic) BOOL useTransparentHeader; +@property (nonatomic) BOOL animateWithKeyboard; +@property (nonatomic) BOOL showLoading; - (nonnull instancetype)init; @@ -27,6 +29,14 @@ - (BOOL)showSuggestionsForWord:(nonnull NSString *)word; - (void)hideSuggestions; + +/// Tells the number of suggestions available for the current search +- (NSInteger)numberOfSuggestions; + +/// Select the suggestion at a certain position and triggers the selection delegate +/// @param position the index to select +- (void)selectSuggestionAtPosition:(NSInteger)position; + @end @protocol SuggestionsTableViewDelegate @@ -53,4 +63,9 @@ */ - (NSInteger)suggestionsTableViewMaxDisplayedRows:(nonnull SuggestionsTableView *)suggestionsTableView; +/// This method is called every the header view above the suggestion is tapped. +/// @param suggestionsTableView the suggestion view. +- (void)suggestionsTableViewDidTapHeader:(nonnull SuggestionsTableView *)suggestionsTableView; + + @end diff --git a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.m b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.m index c232a6c76dd7..b09e2ca47c10 100644 --- a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.m +++ b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableView.m @@ -32,6 +32,8 @@ - (instancetype)init _enabled = YES; _searchResults = [[NSMutableArray alloc] init]; _useTransparentHeader = NO; + _animateWithKeyboard = YES; + _showLoading = NO; [self setupHeaderView]; [self setupTableView]; [self setupConstraints]; @@ -53,8 +55,10 @@ - (void)updateHeaderStyles { if (_useTransparentHeader) { [self.headerView setBackgroundColor: [UIColor clearColor]]; + [self.separatorView setBackgroundColor: [WPStyleGuide suggestionsSeparatorSmoke]]; } else { [self.headerView setBackgroundColor: [WPStyleGuide suggestionsHeaderSmoke]]; + [self.separatorView setBackgroundColor: [UIColor clearColor]]; } } @@ -63,6 +67,7 @@ - (void)setupHeaderView { _headerView = [[UIView alloc] init]; [_headerView setTranslatesAutoresizingMaskIntoConstraints:NO]; + [_headerView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapHeader)] ]; [self addSubview:_headerView]; _separatorView = [[UIView alloc] init]; @@ -153,7 +158,8 @@ - (void)layoutSubviews { [super layoutSubviews]; NSUInteger suggestionCount = self.searchResults.count; - [self setHidden:(0 == suggestionCount)]; + BOOL showTable = (self.showLoading && self.suggestions == nil) || (suggestionCount > 0); + [self setHidden:!showTable]; if ([self.suggestionsDelegate respondsToSelector:@selector(suggestionsTableView:didChangeTableBounds:)]) { [self.suggestionsDelegate suggestionsTableView:self didChangeTableBounds:self.tableView.bounds]; } @@ -174,8 +180,10 @@ - (void)updateConstraints maxRows = 1; } - if (self.searchResults.count > maxRows) { - self.heightConstraint.constant = maxRows * STVRowHeight; + if (!self.suggestions) { + self.heightConstraint.constant = STVRowHeight; + } else if (self.searchResults.count > maxRows) { + self.heightConstraint.constant = ceilf((maxRows * STVRowHeight) + (STVRowHeight*0.4)); } else { self.heightConstraint.constant = self.searchResults.count * STVRowHeight; } @@ -185,6 +193,10 @@ - (void)updateConstraints - (void)keyboardDidChangeFrame:(NSNotification *)notification { + if ( !self.animateWithKeyboard ) { + return; + } + NSDictionary *info = [notification userInfo]; NSTimeInterval animationDuration = [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; @@ -209,10 +221,11 @@ - (BOOL)showSuggestionsForWord:(NSString *)word } if ([word hasPrefix:@"@"]) { - self.searchText = [word substringFromIndex:1]; - if (self.searchText.length > 0) { + self.searchText = word; + if (self.searchText.length > 1) { + NSString *searchQuery = [word substringFromIndex:1]; NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"(displayName contains[c] %@) OR (userLogin contains[c] %@)", - self.searchText, self.searchText]; + searchQuery, searchQuery]; self.searchResults = [[self.suggestions filteredArrayUsingPredicate:resultPredicate] mutableCopy]; } else { self.searchResults = [self.suggestions mutableCopy]; @@ -233,6 +246,23 @@ - (void)hideSuggestions [self showSuggestionsForWord:@""]; } +- (NSInteger)numberOfSuggestions { + return self.searchResults.count; +} + +- (void)selectSuggestionAtPosition:(NSInteger)position { + if ([self.suggestions count] == 0) { + return; + } + [self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:position inSection:0]]; +} + +- (void)didTapHeader { + if ([self.suggestionsDelegate respondsToSelector:@selector(suggestionsTableViewDidTapHeader:)]) { + [self.suggestionsDelegate suggestionsTableViewDidTapHeader:self]; + } +} + #pragma mark - UITableViewDataSource methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView @@ -262,20 +292,19 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N return cell; } - Suggestion *suggestion = [self.searchResults objectAtIndex:indexPath.row]; - + Suggestion *suggestion = [self.searchResults objectAtIndex:indexPath.row]; cell.usernameLabel.text = [NSString stringWithFormat:@"@%@", suggestion.userLogin]; cell.displayNameLabel.text = suggestion.displayName; cell.selectionStyle = UITableViewCellSelectionStyleDefault; cell.avatarImageView.image = [UIImage imageNamed:@"gravatar"]; - + cell.imageDownloadHash = suggestion.imageURL.hash; [self loadAvatarForSuggestion:suggestion success:^(UIImage *image) { if (indexPath.row >= self.searchResults.count) { return; } Suggestion *reloaded = [self.searchResults objectAtIndex:indexPath.row]; - if ([reloaded.imageURL isEqual:suggestion.imageURL] == false) { + if (cell.imageDownloadHash != reloaded.imageURL.hash) { return; } @@ -292,7 +321,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath Suggestion *suggestion = [self.searchResults objectAtIndex:indexPath.row]; [self.suggestionsDelegate suggestionsTableView:self didSelectSuggestion:suggestion.userLogin - forSearchText:self.searchText]; + forSearchText:[self.searchText substringFromIndex:1]]; } #pragma mark - Suggestion list management diff --git a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.h b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.h index a98da3db381b..c4abbe797de2 100644 --- a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.h +++ b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.h @@ -7,5 +7,6 @@ extern NSInteger const SuggestionsTableViewCellAvatarSize; @property (nonatomic, strong) UILabel *usernameLabel; @property (nonatomic, strong) UILabel *displayNameLabel; @property (nonatomic, strong) UIImageView *avatarImageView; +@property (nonatomic, assign) NSUInteger imageDownloadHash; @end diff --git a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.m b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.m index d7712abf054a..51821c9a4a8d 100644 --- a/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.m +++ b/WordPress/Classes/ViewRelated/Suggestions/SuggestionsTableViewCell.m @@ -2,7 +2,7 @@ #import #import "WordPress-Swift.h" -NSInteger const SuggestionsTableViewCellAvatarSize = 23; +NSInteger const SuggestionsTableViewCellAvatarSize = 24; @implementation SuggestionsTableViewCell @@ -14,15 +14,21 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr [self setupDisplayNameLabel]; [self setupAvatarImageView]; [self setupConstraints]; + self.backgroundColor = [UIColor murielListForeground]; } return self; } +- (void)prepareForReuse { + [super prepareForReuse]; + self.imageDownloadHash = 0; +} + - (void)setupUsernameLabel { _usernameLabel = [[UILabel alloc] init]; [_usernameLabel setTextColor:[UIColor murielPrimary]]; - [_usernameLabel setFont:[WPFontManager systemRegularFontOfSize:14.0]]; + [_usernameLabel setFont:[WPFontManager systemRegularFontOfSize:17.0]]; [_usernameLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; [self.contentView addSubview:_usernameLabel]; } @@ -30,7 +36,7 @@ - (void)setupUsernameLabel - (void)setupDisplayNameLabel { _displayNameLabel = [[UILabel alloc] init]; - [_displayNameLabel setTextColor:[WPStyleGuide allTAllShadeGrey]]; + [_displayNameLabel setTextColor:[UIColor murielTextSubtle]]; [_displayNameLabel setFont:[WPFontManager systemRegularFontOfSize:14.0]]; [_displayNameLabel setTranslatesAutoresizingMaskIntoConstraints:NO]; _displayNameLabel.textAlignment = NSTextAlignmentRight; diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 88d0c373bc7e..3cd513baa1a6 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -2211,6 +2211,8 @@ FF37F90922385CA000AFA3DB /* RELEASE-NOTES.txt in Resources */ = {isa = PBXBuildFile; fileRef = FF37F90822385C9F00AFA3DB /* RELEASE-NOTES.txt */; }; FF4258501BA092EE00580C68 /* RelatedPostsSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */; }; FF4C069F206560E500E0B2BC /* MediaThumbnailCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4C069E206560E500E0B2BC /* MediaThumbnailCoordinator.swift */; }; + FF4DEAD62448FFC900ACA032 /* GutenbergMentionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4DEAD52448FFC900ACA032 /* GutenbergMentionsViewController.swift */; }; + FF4DEAD8244B56E300ACA032 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF4DEAD7244B56E200ACA032 /* CoreServices.framework */; }; FF5371631FDFF64F00619A3F /* MediaService.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF5371621FDFF64F00619A3F /* MediaService.swift */; }; FF54D4641D6F3FA900A0DC4D /* GutenbergSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF54D4631D6F3FA900A0DC4D /* GutenbergSettings.swift */; }; FF619DD51C75246900903B65 /* CLPlacemark+Formatting.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF619DD41C75246900903B65 /* CLPlacemark+Formatting.swift */; }; @@ -4831,6 +4833,8 @@ FF42584E1BA092EE00580C68 /* RelatedPostsSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RelatedPostsSettingsViewController.h; sourceTree = ""; }; FF42584F1BA092EE00580C68 /* RelatedPostsSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RelatedPostsSettingsViewController.m; sourceTree = ""; }; FF4C069E206560E500E0B2BC /* MediaThumbnailCoordinator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaThumbnailCoordinator.swift; sourceTree = ""; }; + FF4DEAD52448FFC900ACA032 /* GutenbergMentionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergMentionsViewController.swift; sourceTree = ""; }; + FF4DEAD7244B56E200ACA032 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; FF5371621FDFF64F00619A3F /* MediaService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaService.swift; sourceTree = ""; }; FF54D4631D6F3FA900A0DC4D /* GutenbergSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GutenbergSettings.swift; sourceTree = ""; }; FF619DD41C75246900903B65 /* CLPlacemark+Formatting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "CLPlacemark+Formatting.swift"; sourceTree = ""; }; @@ -4927,6 +4931,7 @@ FD21397F13128C5300099582 /* libiconv.dylib in Frameworks */, E19DF741141F7BDD000002F3 /* libz.dylib in Frameworks */, 1D36FCB53C05724865D41F7A /* Pods_WordPress.framework in Frameworks */, + FF4DEAD8244B56E300ACA032 /* CoreServices.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5597,6 +5602,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + FF4DEAD7244B56E200ACA032 /* CoreServices.framework */, 9884B145236225230021D8E9 /* WordPressUI.framework */, 9884B143236224F80021D8E9 /* WordPressUI.framework */, 98E58A432361019300E5534B /* Pods_WordPressTodayWidget.framework */, @@ -7172,6 +7178,7 @@ 912347182213484300BD9F97 /* GutenbergViewController+InformativeDialog.swift */, 912347752216E27200BD9F97 /* GutenbergViewController+Localization.swift */, FFC02B82222687BF00E64FDE /* GutenbergImageLoader.swift */, + FF4DEAD52448FFC900ACA032 /* GutenbergMentionsViewController.swift */, 7E407122237163C3003627FA /* Utils */, ); path = Gutenberg; @@ -12281,6 +12288,7 @@ B54346961C6A707D0010B3AD /* LanguageViewController.swift in Sources */, 43D74AD020F906EE004AD934 /* InlineEditableNameValueCell.swift in Sources */, 4089C51122371B120031CE78 /* TodayStatsRecordValue+CoreDataProperties.swift in Sources */, + FF4DEAD62448FFC900ACA032 /* GutenbergMentionsViewController.swift in Sources */, F928EDA3226140620030D451 /* WPCrashLoggingProvider.swift in Sources */, D8A3A5B3206A49BF00992576 /* StockPhotosMedia.swift in Sources */, 176BB87F20D0068500751DCE /* FancyAlertViewController+SavedPosts.swift in Sources */,