Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gutenberg: Update to v1.17.0 #12917

Merged
merged 37 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
abae4b1
Update gutenberg ref to test gutenberg release 1.17.0
hypest Nov 11, 2019
914ee82
Update Gutenberg mobile ref
hypest Nov 11, 2019
83e2798
Update Gutenberg mobile ref
hypest Nov 11, 2019
1b72389
Update Podfile.lock
hypest Nov 11, 2019
0d57c18
Update release notes
hypest Nov 12, 2019
04f7ec5
Update Gutenberg ref
hypest Nov 12, 2019
62b64ff
Merge remote-tracking branch 'origin/develop' into gutenberg/release-…
Tug Nov 12, 2019
5d50bd3
Update en.lproj/Localizable.strings
Tug Nov 12, 2019
a49c055
Update Aztec-Editor to 1.12
mchowning Nov 12, 2019
7beba6f
Update gutenberg ref
mchowning Nov 12, 2019
54220a1
Update GB pod reference.
SergioEstevao Nov 12, 2019
9f870e2
Set Pre and Quote color in Aztec to adapt to ligh/dark mode.
SergioEstevao Nov 12, 2019
2a8f666
Update Aztec to version 1.12.0
SergioEstevao Nov 13, 2019
5035dfa
Update Release Notes.
SergioEstevao Nov 13, 2019
0e7a8ca
Update share extension editor quote and pre colors.
SergioEstevao Nov 13, 2019
09a6c25
Update GB reference to release 1.17.0 branch
SergioEstevao Nov 13, 2019
c3f0b1d
Merge pull request #12934 from wordpress-mobile/gutenberg/enable_pref…
SergioEstevao Nov 13, 2019
559ff3a
[Gutenberg] Adding files app source to media picker
etoledom Nov 6, 2019
79c0d83
[Gutenberg] Adding FilesApp media picker
etoledom Nov 6, 2019
f354260
[Gutenberg] Rename filesAppMediaSource
etoledom Nov 6, 2019
9595897
Update gutenberg ref
etoledom Nov 8, 2019
f996fc0
Update release notes
etoledom Nov 8, 2019
1c1feca
Update colors for pre and quote.
SergioEstevao Nov 14, 2019
c343c7a
Merge branch 'gutenberg/release-1.17.0' into update_aztec_editor
SergioEstevao Nov 14, 2019
34f8e6e
Update gutenberg ref
etoledom Nov 14, 2019
a0868ad
Update Gutenberg ref
hypest Nov 14, 2019
0f046c3
Update gutenberg ref
etoledom Nov 14, 2019
c58f019
Merge pull request #12883 from wordpress-mobile/gutenberg/other-apps-…
etoledom Nov 14, 2019
88aafd2
Update Gutenberg ref
hypest Nov 14, 2019
9b02736
Merge branch 'gutenberg/release-1.17.0' into update_aztec_editor
hypest Nov 14, 2019
e32e88d
Update Gutenberg ref
hypest Nov 14, 2019
a2e6327
Merge pull request #12929 from wordpress-mobile/update_aztec_editor
hypest Nov 14, 2019
ca7dc44
Update Gutenberg ref
hypest Nov 14, 2019
48a37a2
Update Gutenberg ref
hypest Nov 15, 2019
a10befc
Update Gutenberg ref
hypest Nov 15, 2019
8b9cf4a
Merge branch 'develop' into gutenberg/release-1.17.0
hypest Nov 15, 2019
143f4cb
Update gutenberg ref to official v1.17.0 release tag.
cameronvoell Nov 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def aztec
## pod 'WordPress-Editor-iOS', :git => 'https://github.com/wordpress-mobile/AztecEditor-iOS.git', :commit => '81e1e1bb1cb209004d66bba75338595cc9aab147'
## 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.11.0'
pod 'WordPress-Editor-iOS', '~> 1.12.0'
end

def wordpress_ui
Expand Down Expand Up @@ -140,7 +140,7 @@ target 'WordPress' do
## Gutenberg (React Native)
## =====================
##
gutenberg :commit => 'bdbe882b1071cbfdd67fc3a5314e5d1de37cb04b'
gutenberg :commit => '9c19f9ca53d2123f0bbdca47c466c8f8e6cff991'

## Third party libraries
## =====================
Expand Down
142 changes: 71 additions & 71 deletions Podfile.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
-----
* Updated the mobile apps blog address to a non-retired blog.
* Block editor: Added option to insert images from "Free Photo Library".
* Block editor: Fix issue where the keyboard would not capitalize sentences correctly on some cases
* Block editor: Add alignment to paragraph blocks
* Fixed a bug that made comment moderation fail on the first attempt for self-hosted sites.
* Block editor: Added support for the preformatted block.
* Stats Today widget: updated design and enabled expanding.

* Block editor: Added option to insert images from "Free Photo Library" and "Other Apps".

13.6
-----
* Fixed a bug that was not submiting posts for review
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ class AztecPostViewController: UIViewController, PostEditor {
textView.textAttachmentDelegate = self

textView.backgroundColor = Colors.aztecBackground
textView.blockquoteBackgroundColor = UIColor(light: textView.blockquoteBackgroundColor, dark: .neutral(.shade5))
textView.blockquoteBackgroundColor = .neutral(.shade5)
textView.blockquoteBorderColor = .listIcon
textView.preBackgroundColor = .neutral(.shade5)

textView.linkTextAttributes = linkAttributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class GutenbergViewController: UIViewController, PostEditor {
private lazy var stockPhotos: GutenbergStockPhotos = {
return GutenbergStockPhotos(gutenberg: gutenberg, mediaInserter: mediaInserterHelper)
}()
private lazy var filesAppMediaPicker: GutenbergFilesAppMediaSource = {
return GutenbergFilesAppMediaSource(gutenberg: gutenberg, mediaInserter: mediaInserterHelper)
}()

// MARK: - Aztec

Expand Down Expand Up @@ -360,6 +363,8 @@ extension GutenbergViewController: GutenbergBridgeDelegate {
gutenbergDidRequestMediaFromCameraPicker(filter: flags, with: callback)
case .stockPhotos:
stockPhotos.presentPicker(origin: self, post: post, multipleSelection: allowMultipleSelection, callback: callback)
case .filesApp:
filesAppMediaPicker.presentPicker(origin: self, filters: filter, multipleSelection: allowMultipleSelection, callback: callback)
default: break
}
}
Expand Down Expand Up @@ -563,10 +568,10 @@ extension GutenbergViewController: GutenbergBridgeDataSource {
}

func gutenbergMediaSources() -> [Gutenberg.MediaSource] {
if post.blog.supports(.stockPhotos) {
return [.stockPhotos]
}
return []
return [
post.blog.supports(.stockPhotos) ? .stockPhotos : nil,
.filesApp,
].compactMap { $0 }
}
}

Expand Down Expand Up @@ -665,6 +670,7 @@ extension GutenbergViewController: PostEditorNavigationBarManagerDelegate {

extension Gutenberg.MediaSource {
static let stockPhotos = Gutenberg.MediaSource(id: "wpios-stock-photo-library", label: .freePhotosLibrary, types: [.image])
static let filesApp = Gutenberg.MediaSource(id: "wpios-files-app", label: .files, types: [.image, .video, .audio, .other])
}

private extension GutenbergViewController {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import Gutenberg
import MobileCoreServices

class GutenbergFilesAppMediaSource: NSObject {
private var mediaPickerCallback: MediaPickerDidPickMediaCallback?
private let mediaInserter: GutenbergMediaInserterHelper
private unowned var gutenberg: Gutenberg

init(gutenberg: Gutenberg, mediaInserter: GutenbergMediaInserterHelper) {
self.mediaInserter = mediaInserter
self.gutenberg = gutenberg
}

func presentPicker(origin: UIViewController, filters: [Gutenberg.MediaType], multipleSelection: Bool, callback: @escaping MediaPickerDidPickMediaCallback) {
let uttypeFilters = filters.compactMap { $0.typeIdentifier }
mediaPickerCallback = callback
let docPicker = UIDocumentPickerViewController(documentTypes: uttypeFilters, in: .import)
docPicker.delegate = self
docPicker.allowsMultipleSelection = multipleSelection
WPStyleGuide.configureDocumentPickerNavBarAppearance()
origin.present(docPicker, animated: true)
}
}

extension GutenbergFilesAppMediaSource: UIDocumentPickerDelegate {
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
defer {
mediaPickerCallback = nil
}
if let documentURL = urls.first {
insertOnBlock(with: documentURL)
} else {
mediaPickerCallback?(nil)
}
}

func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
WPStyleGuide.configureNavigationAppearance()
mediaPickerCallback?(nil)
mediaPickerCallback = nil
}

/// Adds the given image object to the requesting Image Block
/// - Parameter asset: Stock Media object to add.
func insertOnBlock(with url: URL) {
WPStyleGuide.configureNavigationAppearance()
guard let callback = mediaPickerCallback else {
return assertionFailure("Image picked without callback")
}

let media = self.mediaInserter.insert(exportableAsset: url as NSURL, source: .otherApps)
let mediaUploadID = media.gutenbergUploadID
callback([MediaInfo(id: mediaUploadID, url: url.absoluteString, type: media.mediaTypeString)])
}
}

extension Gutenberg.MediaType {
var typeIdentifier: String? {
switch self {
case .image:
return String(kUTTypeImage)
case .video:
return String(kUTTypeMovie)
case .audio:
return String(kUTTypeAudio)
case .other:
return nil
}
}
}
Binary file modified WordPress/Resources/en.lproj/Localizable.strings
Binary file not shown.
4 changes: 4 additions & 0 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@
7E3E7A6620E44F200075D159 /* HeaderContentGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E3E7A6520E44F200075D159 /* HeaderContentGroup.swift */; };
7E3E9B702177C9DC00FD5797 /* GutenbergViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E3E9B6F2177C9DC00FD5797 /* GutenbergViewController.swift */; };
7E407121237163B8003627FA /* GutenbergStockPhotos.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E407120237163B8003627FA /* GutenbergStockPhotos.swift */; };
7E40713A2372AD54003627FA /* GutenbergFilesAppMediaSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E4071392372AD54003627FA /* GutenbergFilesAppMediaSource.swift */; };
7E4123B920F4097B00DF8486 /* FormattableContentFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E4123AC20F4097900DF8486 /* FormattableContentFactory.swift */; };
7E4123BA20F4097B00DF8486 /* FormattableContentGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E4123AD20F4097900DF8486 /* FormattableContentGroup.swift */; };
7E4123BC20F4097B00DF8486 /* DefaultFormattableContentAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E4123AF20F4097A00DF8486 /* DefaultFormattableContentAction.swift */; };
Expand Down Expand Up @@ -3041,6 +3042,7 @@
7E3E7A6520E44F200075D159 /* HeaderContentGroup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderContentGroup.swift; sourceTree = "<group>"; };
7E3E9B6F2177C9DC00FD5797 /* GutenbergViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergViewController.swift; sourceTree = "<group>"; };
7E407120237163B8003627FA /* GutenbergStockPhotos.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergStockPhotos.swift; sourceTree = "<group>"; };
7E4071392372AD54003627FA /* GutenbergFilesAppMediaSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GutenbergFilesAppMediaSource.swift; sourceTree = "<group>"; };
7E4123AC20F4097900DF8486 /* FormattableContentFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormattableContentFactory.swift; sourceTree = "<group>"; };
7E4123AD20F4097900DF8486 /* FormattableContentGroup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormattableContentGroup.swift; sourceTree = "<group>"; };
7E4123AF20F4097A00DF8486 /* DefaultFormattableContentAction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DefaultFormattableContentAction.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6451,6 +6453,7 @@
isa = PBXGroup;
children = (
7E407120237163B8003627FA /* GutenbergStockPhotos.swift */,
7E4071392372AD54003627FA /* GutenbergFilesAppMediaSource.swift */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -10923,6 +10926,7 @@
08216FD51CDBF96000304BA7 /* MenuItemTypeViewController.m in Sources */,
B526DC291B1E47FC002A8C5F /* WPStyleGuide+WebView.m in Sources */,
82FC61271FA8ADAD00A1757E /* WPStyleGuide+Activity.swift in Sources */,
7E40713A2372AD54003627FA /* GutenbergFilesAppMediaSource.swift in Sources */,
B532D4EC199D4357006E4DF6 /* NoteBlockTextTableViewCell.swift in Sources */,
B52F8CD81B43260C00D36025 /* NotificationSettingStreamsViewController.swift in Sources */,
E1AB5A071E0BF17500574B4E /* Array.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class ShareExtensionEditorViewController: ShareExtensionAbstractViewController {
textView.backgroundColor = ShareColors.aztecBackground
textView.textColor = .text
textView.tintColor = ShareColors.aztecCursorColor
textView.blockquoteBackgroundColor = UIColor(light: textView.blockquoteBackgroundColor, dark: .neutral(.shade5))
textView.blockquoteBackgroundColor = .neutral(.shade5)
textView.blockquoteBorderColor = .listIcon
textView.preBackgroundColor = .neutral(.shade5)
textView.linkTextAttributes = linkAttributes
textView.textAlignment = .natural

Expand Down