Skip to content

Commit

Permalink
Merge pull request #417 from wordpress-mobile/rnmobile/refactor/galle…
Browse files Browse the repository at this point in the history
…ry-as-nested-image-blocks-editor-settings_v2

[Gutenberg] Pass the Gallery v2 Flag over from the editor
  • Loading branch information
Antonis Lilis authored Sep 2, 2021
2 parents b622fd0 + fb9d7dc commit 53c3013
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion WordPressKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'WordPressKit'
s.version = '4.41.0-beta.2'
s.version = '4.41.0-beta.3'

s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
s.description = <<-DESC
Expand Down
3 changes: 3 additions & 0 deletions WordPressKit/RemoteBlockEditorSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import Foundation
public class RemoteBlockEditorSettings: Codable {
enum CodingKeys: String, CodingKey {
case isFSETheme = "__unstableEnableFullSiteEditingBlocks"
case galleryWithImageBlocks = "__unstableGalleryWithImageBlocks"
case rawStyles = "__experimentalStyles"
case rawFeatures = "__experimentalFeatures"
case colors
case gradients
}

public let isFSETheme: Bool
public let galleryWithImageBlocks: Bool
public let rawStyles: String?
public let rawFeatures: String?
public let colors: [[String: String]]?
Expand All @@ -34,6 +36,7 @@ public class RemoteBlockEditorSettings: Codable {
required public init(from decoder: Decoder) throws {
let map = try decoder.container(keyedBy: CodingKeys.self)
self.isFSETheme = (try? map.decode(Bool.self, forKey: .isFSETheme)) ?? false
self.galleryWithImageBlocks = (try? map.decode(Bool.self, forKey: .galleryWithImageBlocks)) ?? false
self.rawStyles = RemoteBlockEditorSettings.parseToString(map, .rawStyles)
self.rawFeatures = RemoteBlockEditorSettings.parseToString(map, .rawFeatures)
self.colors = try? map.decode([[String: String]].self, forKey: .colors)
Expand Down

0 comments on commit 53c3013

Please sign in to comment.