mirror of https://github.com/logseq/logseq
improve(plugin): add openExternalLink api
parent
cd9fc67f30
commit
ac5d4b4508
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@logseq/libs",
|
||||
"version": "0.0.1-alpha.20",
|
||||
"version": "0.0.1-alpha.21",
|
||||
"description": "Logseq SDK libraries",
|
||||
"main": "dist/lsplugin.user.js",
|
||||
"typings": "index.d.ts",
|
||||
|
|
|
@ -170,6 +170,7 @@ export interface IAppProxy {
|
|||
// native
|
||||
relaunch: () => Promise<void>
|
||||
quit: () => Promise<void>
|
||||
openExternalLink: (url: string) => Promise<void>
|
||||
|
||||
// graph
|
||||
getCurrentGraph: () => Promise<AppGraphInfo | null>
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
(fn []
|
||||
(when-let [repo (state/get-current-repo)]
|
||||
(when-not (= config/local-repo repo)
|
||||
(bean/->js {:url repo
|
||||
(bean/->js {:url repo
|
||||
:name (util/node-path.basename repo)
|
||||
:path (config/get-repo-dir repo)})))))
|
||||
|
||||
|
@ -162,6 +162,11 @@
|
|||
(fn []
|
||||
(ipc/ipc "quitApp")))
|
||||
|
||||
(def ^:export open_external_link
|
||||
(fn [url]
|
||||
(when (re-find #"https?://" url)
|
||||
(js/apis.openExternal url))))
|
||||
|
||||
(def ^:export push_state
|
||||
(fn [^js k ^js params]
|
||||
(rfe/push-state
|
||||
|
|
Loading…
Reference in New Issue