Skip to content
Branch: master
Go to file
Code

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Respo Cirru Editor

Reimplement Cirru Editor in Respo.

Demo http://repo.cirru.org/respo-cirru-editor/

Support several basic shortcuts from Clacit Editor.

Usage

Clojars Project

[cirru/editor "0.3.0-a2"]

Import comp-editor like this:

[cirru-editor.comp.editor :refer [comp-editor]]
[cirru-editor.util.dom :refer [focus!]]

Arguments of comp-editor:

(defn on-update! [snapshot dispatch!]
  (dispatch! :update snapshot))

(defn on-command [snapshot dispatch! e])

(defn schema {:snaphot {:tree []
                        :focus []
                        :clipboard []}})

; states comes from Respo@4.x states management
(defn render [states snapshot]
  (fn [cursor]
    (div {:style {}}
      (comp-editor states snapshot on-update! on-command))))

focus! is a side-effect. You have to make sure it's called only editor is changed. Respo does not provide a didMount hook, you have to handle it globally on you own. Take src/cirru_editor/main.cljs for example.

Develop

https://github.com/mvc-works/calcit-workflow

License

MIT

You can’t perform that action at this time.