Skip to content

wordpress-mobile/GutenbergKit

Repository files navigation

GutenbergKit

A proof of concept Gutenberg editor for native iOS apps built using web technologies.

Screenshot 2024-07-01 at 10 30 11 AM

Development

Before getting started, you'll need the Node dependencies to be checked out locally, which you can get by running make build.

React App

The ReactJS app is embedded in the native GutenbergKit module.

To launch the app in the browser, run:

make dev-server

GutenbergKit

A Swift package with native wrappers for the Gutenberg editor.

Demo

A host app that can be used to test the changes made to the editor quickly.

By default, the demo app uses a production build of the React app included in the GutenbergKit package. During development, make sure to run the React app and pass the localhost URL as an environment variable of the demo app.

Screenshot 2024-07-01 at 10 46 19 PM

If you are using SwiftUI previews, make sure to point them to the localhost programatically:

#Preview {
    NavigationStack {
//        EditorView()
        EditorView(editorURL: URL(string: "http://localhost:5173/")!)
    }
}

Production

To build the React app for production and incorporate the changes in the GutenbergKit Swift module, run:

make build

Once it's done, the Swift package is ready to be published.