diff --git a/Modules/Package.swift b/Modules/Package.swift index 3f8488af2154..b489cb2d1223 100644 --- a/Modules/Package.swift +++ b/Modules/Package.swift @@ -48,7 +48,7 @@ let package = Package( .package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"), // We can't use wordpress-rs branches nor commits here. Only tags work. .package(url: "https://github.com/Automattic/wordpress-rs", revision: "alpha-20241116"), - .package(url: "https://github.com/wordpress-mobile/GutenbergKit", revision: "4476d597b271778d001a26c50d74e527b54ebfef"), + .package(url: "https://github.com/wordpress-mobile/GutenbergKit", revision: "5a43a1b8ab5034e5be4b4eb93c30885cc41227b2"), .package(url: "https://github.com/Automattic/color-studio", branch: "trunk"), ], targets: XcodeSupport.targets + [ diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 8e89ce34b262..6905519375b2 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,5 +1,6 @@ 25.7 ----- +* [**] Enable history navigation (undo and redo) for the experimental editor. [#23961] 25.6 ----- diff --git a/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved b/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved index a78e150d8003..3b44f631fb7b 100644 --- a/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/WordPress.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "8a87409582dec4bc7c7f6ee5d6a6761cead545bd116f82237fc9e6a881e7c3fb", + "originHash" : "4cacb81eb20e7d20d1b25f261d9303a24f725104ed3b36743fc2707b7473a93d", "pins" : [ { "identity" : "alamofire", @@ -150,7 +150,7 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/wordpress-mobile/GutenbergKit", "state" : { - "revision" : "4476d597b271778d001a26c50d74e527b54ebfef" + "revision" : "5a43a1b8ab5034e5be4b4eb93c30885cc41227b2" } }, { diff --git a/WordPress/Classes/ViewRelated/NewGutenberg/NewGutenbergViewController.swift b/WordPress/Classes/ViewRelated/NewGutenberg/NewGutenbergViewController.swift index 94cd4a8f72c0..e0670fac4936 100644 --- a/WordPress/Classes/ViewRelated/NewGutenberg/NewGutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/NewGutenberg/NewGutenbergViewController.swift @@ -242,22 +242,8 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor } private func reloadBlogIconView() { - let blog = post.blog - -// if blog.hasIcon == true { -// let size = CGSize(width: 24, height: 24) -// navigationBarManager.siteIconView.imageView.downloadSiteIcon(for: blog, imageSize: size) -// } else if blog.isWPForTeams() { -// navigationBarManager.siteIconView.imageView.tintColor = UIColor.secondaryLabel -// navigationBarManager.siteIconView.imageView.image = UIImage.gridicon(.p2) -// } else { -// navigationBarManager.siteIconView.imageView.image = UIImage.siteIconPlaceholder -// } - - // TODO: implement - // Docs: https://wordpress.org/gutenberg-framework/docs/basic-concepts/undo-redo - navigationBarManager.undoButton.isHidden = true - navigationBarManager.redoButton.isHidden = true + let viewModel = SiteIconViewModel(blog: post.blog, size: .small) + navigationBarManager.siteIconView.imageView.setIcon(with: viewModel) } // TODO: this should not be called on viewDidLoad @@ -346,6 +332,11 @@ extension NewGutenbergViewController: GutenbergKit.EditorViewControllerDelegate } } + func editor(_ viewController: GutenbergKit.EditorViewController, didUpdateHistoryState state: GutenbergKit.EditorState) { + gutenbergDidRequestToggleRedoButton(!state.hasRedo) + gutenbergDidRequestToggleUndoButton(!state.hasUndo) + } + func editor(_ viewController: GutenbergKit.EditorViewController, performRequest: GutenbergKit.EditorNetworkRequest) async throws -> GutenbergKit.EditorNetworkResponse { throw URLError(.unknown) } @@ -619,13 +610,11 @@ extension NewGutenbergViewController: PostEditorNavigationBarManagerDelegate { } func navigationBarManager(_ manager: PostEditorNavigationBarManager, undoWasPressed sender: UIButton) { - // TODO: reimplement - // self.gutenberg.onUndoPressed() + editorViewController.undo() } func navigationBarManager(_ manager: PostEditorNavigationBarManager, redoWasPressed sender: UIButton) { - // TODO: reimplement - // self.gutenberg.onRedoPressed() + editorViewController.redo() } func navigationBarManager(_ manager: PostEditorNavigationBarManager, moreWasPressed sender: UIButton) {