mirror of https://github.com/logseq/logseq
fix(plugin): exported api namespace
parent
a54dc6d732
commit
158c7645e3
|
@ -32,3 +32,4 @@ resources/electron.js
|
||||||
.clj-kondo/
|
.clj-kondo/
|
||||||
.lsp/
|
.lsp/
|
||||||
/libs/dist/
|
/libs/dist/
|
||||||
|
charlie/
|
||||||
|
|
|
@ -94,6 +94,7 @@
|
||||||
[:strong svg/settings-sm]
|
[:strong svg/settings-sm]
|
||||||
[:ul.menu-list
|
[:ul.menu-list
|
||||||
[:li {:on-click #(if usf (js/apis.openPath usf))} "Open settings"]
|
[:li {:on-click #(if usf (js/apis.openPath usf))} "Open settings"]
|
||||||
|
[:li {:on-click #(js/apis.openPath url)} "Open plugin root"]
|
||||||
[:li {:on-click
|
[:li {:on-click
|
||||||
#(let [confirm-fn
|
#(let [confirm-fn
|
||||||
(ui/make-confirm-modal
|
(ui/make-confirm-modal
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
transition: none;
|
transition: none;
|
||||||
opacity: .2;
|
opacity: .2;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: var(--ls-z-index-level-2);
|
||||||
|
|
||||||
.menu-list {
|
.menu-list {
|
||||||
@apply shadow-md rounded-sm absolute hidden list-none overflow-hidden m-0 p-0;
|
@apply shadow-md rounded-sm absolute hidden list-none overflow-hidden m-0 p-0;
|
||||||
|
@ -90,7 +91,7 @@
|
||||||
|
|
||||||
> li {
|
> li {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 3px;
|
padding: 5px;
|
||||||
transition: background-color .2s;
|
transition: background-color .2s;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
|
|
|
@ -16,6 +16,12 @@
|
||||||
(and (util/electron?)
|
(and (util/electron?)
|
||||||
(= (storage/get "developer-mode") "true")))
|
(= (storage/get "developer-mode") "true")))
|
||||||
|
|
||||||
|
(defn invoke-exported-api
|
||||||
|
[type & args]
|
||||||
|
(try
|
||||||
|
(apply js-invoke js/logseq.api type args)
|
||||||
|
(catch js/Error e (js/console.error e))))
|
||||||
|
|
||||||
;; state handlers
|
;; state handlers
|
||||||
(defn register-plugin
|
(defn register-plugin
|
||||||
[pl]
|
[pl]
|
||||||
|
@ -61,7 +67,7 @@
|
||||||
(defn open-readme!
|
(defn open-readme!
|
||||||
[url display]
|
[url display]
|
||||||
(when url
|
(when url
|
||||||
(-> (p/let [content (js/api.load_plugin_readme url)]
|
(-> (p/let [content (invoke-exported-api "load_plugin_readme" url)]
|
||||||
(state/set-state! :plugin/active-readme content)
|
(state/set-state! :plugin/active-readme content)
|
||||||
(state/set-modal! display))
|
(state/set-modal! display))
|
||||||
(p/catch #(notifications/show! "No README file." :warn)))))
|
(p/catch #(notifications/show! "No README file." :warn)))))
|
||||||
|
|
Loading…
Reference in New Issue