mirror of
https://github.com/logseq/logseq.git
synced 2026-04-26 07:05:10 +00:00
Enhance / Plugin APIs (#6945)
Added
1. All configurations of current graph.
App.getCurrentGraphConfigs: () => Promise<any>
2. All favorite pages list of current graph.
App.getCurrentGraphFavorites: () => Promise<Array<string> | null>
3. All recent pages list of current graph.
App.getCurrentGraphRecent: () => Promise<Array<string> | null>
4. Clear right sidebar blocks.
App.clearRightSidebarBlocks: (opts?: { close: boolean }) => void
5. Support register CodeMirror enhancer. #Experiment feature
Experiments.registerExtensionsEnhancer<T = any>(type: 'katex' | 'codemirror', enhancer: (v: T) => Promise<any>)
6. Support hooks for app search service. #Alpha stage
App.registerSearchService<T extends IPluginSearchServiceHooks>(s: T): void
7. Support focus option for App.insertBlock. Credit to [[tennox]] #PR
Fixed
1. Adjust build script to be compatible for shadow-cljs bundler.
How to set up a clojurescript project with shadow-cljs?
https://github.com/rlhk/logseq-url-plus/blob/main/doc/dev-notes.md
This commit is contained in:
@@ -329,6 +329,16 @@
|
||||
(swap! state/state medley/dissoc-in [:plugin/installed-resources pid])
|
||||
true))
|
||||
|
||||
(defn register-plugin-search-service
|
||||
[pid name opts]
|
||||
(when-let [pid (and name (keyword pid))]
|
||||
(state/install-plugin-service pid :search name opts)))
|
||||
|
||||
(defn unregister-plugin-search-services
|
||||
[pid]
|
||||
(when-let [pid (keyword pid)]
|
||||
(state/uninstall-plugin-service pid :search)))
|
||||
|
||||
(defn unregister-plugin-themes
|
||||
([pid] (unregister-plugin-themes pid true))
|
||||
([pid effect]
|
||||
@@ -564,7 +574,7 @@
|
||||
(when-not (= text "END")
|
||||
[:div.flex.align-items.justify-center.h-screen.w-full.preboot-loading
|
||||
[:span.flex.items-center.justify-center.w-60.flex-col
|
||||
[:small.scale-250.opacity-70.mb-10.animate-pulse (svg/logo false)]
|
||||
[:small.scale-250.opacity-70.mb-10.animate-pulse (svg/logo)]
|
||||
[:small.block.text-sm.relative.opacity-50 {:style {:right "-8px"}} text]]])))
|
||||
|
||||
(defn ^:large-vars/cleanup-todo init-plugins!
|
||||
@@ -586,7 +596,8 @@
|
||||
(invoke-exported-api "unregister_plugin_simple_command" pid)
|
||||
(invoke-exported-api "uninstall_plugin_hook" pid)
|
||||
(unregister-plugin-ui-items pid)
|
||||
(unregister-plugin-resources pid))
|
||||
(unregister-plugin-resources pid)
|
||||
(unregister-plugin-search-services pid))
|
||||
|
||||
_ (doto js/LSPluginCore
|
||||
(.on "registered"
|
||||
|
||||
Reference in New Issue
Block a user