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

RemoteBlockEditorSettings - Add gutenbergVersion #625

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions WordPressKit/RemoteBlockEditorSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class RemoteBlockEditorSettings: Codable {
case listBlockV2 = "__experimentalEnableListBlockV2"
case rawStyles = "__experimentalStyles"
case rawFeatures = "__experimentalFeatures"
case gutenbergVersion = "gutenbergVersion"
case colors
case gradients
}
Expand All @@ -18,6 +19,7 @@ public class RemoteBlockEditorSettings: Codable {
public let listBlockV2: Bool
public let rawStyles: String?
public let rawFeatures: String?
public let gutenbergVersion: String?
public let colors: [[String: String]]?
public let gradients: [[String: String]]?

Expand Down Expand Up @@ -45,6 +47,7 @@ public class RemoteBlockEditorSettings: Codable {
self.listBlockV2 = (try? map.decode(Bool.self, forKey: .listBlockV2)) ?? false
self.rawStyles = RemoteBlockEditorSettings.parseToString(map, .rawStyles)
self.rawFeatures = RemoteBlockEditorSettings.parseToString(map, .rawFeatures)
self.gutenbergVersion = (try? map.decode(String.self, forKey: .gutenbergVersion)) ?? ""
self.colors = try? map.decode([[String: String]].self, forKey: .colors)
self.gradients = try? map.decode([[String: String]].self, forKey: .gradients)
}
Expand Down