Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions Modules/Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Modules/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ let package = Package(
.package(url: "https://github.com/wordpress-mobile/wpxmlrpc", from: "0.9.0"),
.package(url: "https://github.com/wordpress-mobile/NSURL-IDN", revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"),
.package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"),
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.12.1"),
.package(url: "https://github.com/wordpress-mobile/GutenbergKit", from: "0.13.0"),
// We can't use wordpress-rs branches nor commits here. Only tags work.
.package(url: "https://github.com/Automattic/wordpress-rs", revision: "alpha-20260114"),
.package(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ extension CommentGutenbergEditorViewController: GutenbergKit.EditorViewControlle
// Do nothing
}

func editorDidRequestLatestContent(_ controller: GutenbergKit.EditorViewController) -> (title: String, content: String)? {
return nil
}

func editor(_ viewController: GutenbergKit.EditorViewController, didUpdateContentWithState state: GutenbergKit.EditorState) {
editorDidUpdate.send(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ class NewGutenbergViewController: UIViewController, PostEditor, PublishingEditor

// Create configuration with post content
let postType = post is Page ? "page" : "post"
let postStatus = post.status?.rawValue ?? "draft"
let editorConfiguration = EditorConfiguration(blog: post.blog, postType: postType)
.toBuilder()
.setTitle(post.postTitle ?? "")
.setContent(post.content ?? "")
.setPostID(post.postID?.intValue)
.setPostStatus(postStatus)
.setNativeInserterEnabled(FeatureFlag.nativeBlockInserter.enabled)
.build()

Expand Down Expand Up @@ -468,6 +471,12 @@ extension NewGutenbergViewController: GutenbergKit.EditorViewControllerDelegate
setNavigationItemsEnabled(true)
}

func editorDidRequestLatestContent(_ controller: GutenbergKit.EditorViewController) -> (title: String, content: String)? {
// Return the current post title and content from Core Data.
// This is the authoritative source, updated via autosave.
return (post.postTitle ?? "", post.content ?? "")
}

private func convertMediaInfoArrayToJSONString(_ mediaInfoArray: [MediaInfo]) -> String? {
do {
let jsonData = try JSONEncoder().encode(mediaInfoArray)
Expand Down