mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 07:05:10 +00:00
Merge branch 'master' into feat/db
This commit is contained in:
@@ -25,12 +25,13 @@
|
||||
(defn- normalize-keyword-for-json
|
||||
[input]
|
||||
(when input
|
||||
(walk/postwalk
|
||||
(fn [a]
|
||||
(cond
|
||||
(keyword? a) (csk/->camelCase (name a))
|
||||
(uuid? a) (str a)
|
||||
:else a)) input)))
|
||||
(let [f (fn [[k v]] (if (keyword? k) [(csk/->camelCase (name k)) v] [k v]))]
|
||||
(walk/postwalk
|
||||
(fn [x]
|
||||
(cond
|
||||
(map? x) (into {} (map f x))
|
||||
(uuid? x) (str x)
|
||||
:else x)) input))))
|
||||
|
||||
(defn invoke-exported-api
|
||||
[type & args]
|
||||
@@ -297,7 +298,8 @@
|
||||
[pid key keybinding]
|
||||
(let [id (keyword (str "plugin." pid "/" key))
|
||||
binding (:binding keybinding)
|
||||
binding (some->> (if (string? binding) [binding] (seq binding))
|
||||
binding (some->> (if (string? binding) [binding] (vec binding))
|
||||
(remove string/blank?)
|
||||
(map shortcut-utils/undecorate-binding))
|
||||
binding (if util/mac?
|
||||
(or (:mac keybinding) binding) binding)
|
||||
@@ -495,7 +497,7 @@
|
||||
payload)
|
||||
(if (keyword? plugin-id) (name plugin-id) plugin-id))
|
||||
(catch :default e
|
||||
(js/console.error "[Hook Plugin Err]" e)))))
|
||||
(log/error :invoke-hook-exception e)))))
|
||||
|
||||
(defn hook-plugin-app
|
||||
([type payload] (hook-plugin-app type payload nil))
|
||||
|
||||
Reference in New Issue
Block a user