mirror of
https://github.com/logseq/logseq.git
synced 2026-05-04 02:46:45 +00:00
Enhance/plugin APIs (#7555)
* feat: WIP native cli command support * Add :shell/command-whitelist option * Integrate cli to code block * Add :code-block/command-whitelist option * fix: size of icon * improve(shell): cache user shell whitelist on application configures file * improve(electron): promisify run cli command * chore(libs): update version * fix(plugin): incorrect payload of pdf highlights section hook * improve(plugin): block renderer with specific block uuid * improve(plugin): expose logger for user lib * improve(plugin): block hooks type * improve(plugin): block slot hook with specific block * improve(plugin): auto generate key for provide UI options * improve(plugin): style of injected ui container * improve(plugin): types * improve(plugin): async messaging api from host to plugin * improve(plugin): add types * improve(apis): get external plugin metadata * improve(apis): invoke external plugin impls * improve(apis): call external plugin impls for simple commands * enhance(apis): datascript query api for predicate inputs * enhance(apis): datascript query api for predicate inputs * fix(apis): redundant args of datascript query api * enhance(plugins): position of float ui container * enhance(plugins): style of setting options * enhance(plugins): layouts data for float ui * chore(plugins): update CHANGELOG.md * improve(apis): add types * chore: fix some inclusive terms * improve(apis): types * chore(plugins): update CHANGELOG.md * chore(plugins): build libs * chore: update CHANGELOG.md * chore: remove experiemental alda integration * fix(lint): remove unused methods Co-authored-by: Tienson Qin <tiensonqin@gmail.com> Co-authored-by: Andelf <andelf@gmail.com>
This commit is contained in:
@@ -934,17 +934,15 @@
|
||||
(state/set-sub-modal! installed-themes))
|
||||
|
||||
(rum/defc hook-ui-slot
|
||||
([type payload] (hook-ui-slot type payload nil))
|
||||
([type payload opts]
|
||||
([type payload] (hook-ui-slot type payload nil #(plugin-handler/hook-plugin-app type % nil)))
|
||||
([type payload opts callback]
|
||||
(let [rs (util/rand-str 8)
|
||||
id (str "slot__" rs)
|
||||
*el-ref (rum/use-ref nil)]
|
||||
|
||||
(rum/use-effect!
|
||||
(fn []
|
||||
(let [timer (js/setTimeout
|
||||
#(plugin-handler/hook-plugin-app type {:slot id :payload payload} nil)
|
||||
100)]
|
||||
(let [timer (js/setTimeout #(callback {:type type :slot id :payload payload}) 50)]
|
||||
#(js/clearTimeout timer)))
|
||||
[id])
|
||||
|
||||
@@ -962,6 +960,10 @@
|
||||
:ref *el-ref
|
||||
:on-mouse-down (fn [e] (util/stop e))})])))
|
||||
|
||||
(rum/defc hook-block-slot < rum/static
|
||||
[type block]
|
||||
(hook-ui-slot type {} nil #(plugin-handler/hook-plugin-block-slot block %)))
|
||||
|
||||
(rum/defc ui-item-renderer
|
||||
[pid type {:keys [key template prefix]}]
|
||||
(let [*el (rum/use-ref nil)
|
||||
|
||||
Reference in New Issue
Block a user