@@ -27,7 +27,7 @@ public struct EditorConfiguration {
27
27
/// Authorization header
28
28
public let authHeader : String
29
29
/// Raw block editor settings from the WordPress REST API
30
- public let editorSettings : EditorSettings
30
+ public let editorSettings : String
31
31
/// Locale used for translations
32
32
public let locale : String
33
33
/// Endpoint for loading editor assets, used when enabling `shouldUsePlugins`
@@ -50,7 +50,7 @@ public struct EditorConfiguration {
50
50
siteApiNamespace: [ String ] ,
51
51
namespaceExcludedPaths: [ String ] ,
52
52
authHeader: String ,
53
- editorSettings: EditorSettings ,
53
+ editorSettings: String ,
54
54
locale: String ,
55
55
editorAssetsEndpoint: URL ? = nil ,
56
56
cookies: [ HTTPCookie ] = [ ]
@@ -101,12 +101,6 @@ public struct EditorConfiguration {
101
101
content. addingPercentEncoding ( withAllowedCharacters: . alphanumerics) !
102
102
}
103
103
104
- var editorSettingsJSON : String {
105
- // `editorSettings` values are always `encodable` so this should never fail
106
- let jsonData = try ! JSONSerialization . data ( withJSONObject: editorSettings, options: [ ] )
107
- return String ( data: jsonData, encoding: . utf8) ?? " undefined "
108
- }
109
-
110
104
public static let `default` = EditorConfigurationBuilder ( ) . build ( )
111
105
}
112
106
@@ -123,7 +117,7 @@ public struct EditorConfigurationBuilder {
123
117
private var siteApiNamespace : [ String ]
124
118
private var namespaceExcludedPaths : [ String ]
125
119
private var authHeader : String
126
- private var editorSettings : EditorSettings
120
+ private var editorSettings : String
127
121
private var locale : String
128
122
private var editorAssetsEndpoint : URL ?
129
123
@@ -140,7 +134,7 @@ public struct EditorConfigurationBuilder {
140
134
siteApiNamespace: [ String ] = [ ] ,
141
135
namespaceExcludedPaths: [ String ] = [ ] ,
142
136
authHeader: String = " " ,
143
- editorSettings: EditorSettings = [ : ] ,
137
+ editorSettings: String = " undefined " ,
144
138
locale: String = " en " ,
145
139
editorAssetsEndpoint: URL ? = nil
146
140
) {
@@ -233,7 +227,7 @@ public struct EditorConfigurationBuilder {
233
227
return copy
234
228
}
235
229
236
- public func setEditorSettings( _ editorSettings: EditorSettings ) -> EditorConfigurationBuilder {
230
+ public func setEditorSettings( _ editorSettings: String ) -> EditorConfigurationBuilder {
237
231
var copy = self
238
232
copy. editorSettings = editorSettings
239
233
return copy
0 commit comments