Skip to content

Commit c449c45

Browse files
committed
Revert "Add Configuration Builder (and tests) (#146)"
This reverts commit 601a9a8.
1 parent ec8639d commit c449c45

12 files changed

+63
-684
lines changed

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ lint-js: npm-dependencies
4747
test-js: npm-dependencies
4848
npm run test -- run
4949

50-
lint-swift:
51-
swift package plugin swiftlint
52-
5350
local-android-library: build
5451
echo "--- :android: Building Library"
5552
./android/gradlew -p ./android :gutenberg:publishToMavenLocal -exclude-task prepareToPublishToS3

ios/Demo-iOS/Sources/ContentView.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ struct ContentView: View {
6666
private extension EditorConfiguration {
6767

6868
static var template: Self {
69-
#warning("1. Update the siteURL and authHeader values below")
69+
var configuration = EditorConfiguration.default
70+
71+
#warning("1. Update the property values below")
7072
#warning("2. Install the Jetpack plugin to the site")
71-
let siteUrl: String = "https://modify-me.com"
72-
let authHeader: String = "Insert the Authorization header value here"
73-
let siteApiRoot: String = "\(siteUrl)/wp-json/"
73+
configuration.siteURL = "https://modify-me.com"
74+
configuration.authHeader = "Insert the Authorization header value here"
7475

75-
let configuration = EditorConfigurationBuilder()
76-
.setSiteUrl(siteUrl)
77-
.setAuthHeader(authHeader)
78-
.setSiteApiRoot(siteApiRoot)
79-
.setEditorAssetsEndpoint(URL(string: siteApiRoot)!.appendingPathComponent("wpcom/v2/editor-assets"))
80-
.setShouldUsePlugins(true)
76+
// DO NOT CHANGE the properties below
77+
configuration.siteApiRoot = "\(configuration.siteURL)/wp-json/"
78+
configuration.editorAssetsEndpoint = URL(string: configuration.siteApiRoot)!.appendingPathComponent("wpcom/v2/editor-assets")
79+
// The `plugins: true` is necessary for the editor to use 'remote.html'
80+
configuration.plugins = true
8181

82-
return configuration.build()
82+
return configuration
8383
}
8484

8585
}

ios/Sources/GutenbergKit/Sources/Cache/EditorAssetsLibrary.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@ struct EditorAssetsMainifest: Codable {
245245
for script in try document.select("script[src]") {
246246
if let src = try? script.attr("src") {
247247
let link = Self.resolveAssetLink(src, defaultScheme: defaultScheme)
248-
#if canImport(UIKit)
249248
let newLink = CachedAssetSchemeHandler.cachedURL(forWebLink: link) ?? link
250-
#else
251-
let newLink = link
252-
#endif
253249
try script.attr("src", newLink)
254250
}
255251
}
@@ -272,11 +268,7 @@ struct EditorAssetsMainifest: Codable {
272268
for stylesheet in try document.select(#"link[rel="stylesheet"][href]"#) {
273269
if let href = try? stylesheet.attr("href") {
274270
let link = Self.resolveAssetLink(href, defaultScheme: defaultScheme)
275-
#if canImport(UIKit)
276271
let newLink = CachedAssetSchemeHandler.cachedURL(forWebLink: link) ?? link
277-
#else
278-
let newLink = link
279-
#endif
280272
try stylesheet.attr("href", newLink)
281273
}
282274
}

ios/Sources/GutenbergKit/Sources/EditorBlockPicker.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import SwiftUI
22

3-
#if canImport(UIKit)
43
// TODO: Add search
54
// TODO: Group these properly
65
struct EditorBlockPicker: View {
@@ -218,4 +217,3 @@ struct EditorBlockPickerSection: Identifiable {
218217
let name: String
219218
let blockTypes: [EditorBlockType]
220219
}
221-
#endif

0 commit comments

Comments
 (0)