Feat/moveable plugin UI container (#3045)

* improve(plugin): add container for main ui frame

* feat(plugin): support draggable & resizable UI container for main ui

* feat: support fork sub layout container

* improve(plugin): add editor selection api

* improve(plugin): click outside configure for float container

* improve(plugin): api of journal for create-page

* improve(plugin): api of open-in-right-sidebar

* improve(plugin): add full screen api

* improve(plugin): api of register-palette-command

* improve(plugin): add apis
This commit is contained in:
Charlie
2021-11-15 16:57:20 +08:00
committed by GitHub
parent 5605170cf9
commit 72c038e6fe
22 changed files with 7909 additions and 105 deletions

View File

@@ -188,6 +188,15 @@
[pid]
(swap! state/state md/dissoc-in [:plugin/installed-commands (keyword pid)]))
(defn simple-cmd->palette-cmd
[pid {:keys [key label type desc] :as cmd} action]
(let [palette-cmd {:id (keyword (str "plugin." pid "/" key))
:desc (or desc label)
:action (fn []
(state/pub-event!
[:exec-plugin-cmd {:type type :key key :pid pid :cmd cmd :action action}]))}]
palette-cmd))
(defn register-plugin-simple-command
;; action => [:action-key :event-key]
[pid {:keys [key label type] :as cmd} action]
@@ -340,7 +349,7 @@
clear-commands! (fn [pid]
;; commands
(unregister-plugin-slash-command pid)
(unregister-plugin-simple-command pid)
(invoke-exported-api "unregister_plugin_simple_command" pid)
(unregister-plugin-ui-items pid))
_ (doto js/LSPluginCore