浏览代码

improve(plugin): rename api & bump minor version

charlie 4 年之前
父节点
当前提交
153f8f3202
共有 4 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      libs/package.json
  2. 1 1
      libs/src/LSPlugin.ts
  3. 2 2
      libs/src/LSPlugin.user.ts
  4. 1 1
      src/main/frontend/components/page.cljs

+ 1 - 1
libs/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@logseq/libs",
-  "version": "0.0.1-alpha.23",
+  "version": "0.0.1-alpha.24",
   "description": "Logseq SDK libraries",
   "main": "dist/lsplugin.user.js",
   "typings": "index.d.ts",

+ 1 - 1
libs/src/LSPlugin.ts

@@ -188,7 +188,7 @@ export interface IAppProxy {
     opts: { key: string, template: string }
   ) => boolean
 
-  registerPagebarMenuItem: (
+  registerPageMenuItem: (
     tag: string,
     action: (e: IHookEvent & { page: string }) => void
   ) => unknown

+ 2 - 2
libs/src/LSPlugin.user.ts

@@ -70,7 +70,7 @@ const app: Partial<IAppProxy> = {
     return false
   },
 
-  registerPagebarMenuItem (
+  registerPageMenuItem (
     this: LSPluginUser,
     tag: string,
     action: (e: IHookEvent & { page: string }) => void
@@ -81,7 +81,7 @@ const app: Partial<IAppProxy> = {
 
     const key = tag + '_' + this.baseInfo.id
     const label = tag
-    const type = 'pagebar-menu-item'
+    const type = 'page-menu-item'
 
     registerSimpleCommand.call(this,
       type, {

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -352,7 +352,7 @@
                                                     (state/close-modal!))}})
 
                                      (when plugin-handler/lsp-enabled?
-                                       (for [[_ {:keys [key label] :as cmd} action pid] (state/get-plugins-commands-with-type :pagebar-menu-item)]
+                                       (for [[_ {:keys [key label] :as cmd} action pid] (state/get-plugins-commands-with-type :page-menu-item)]
                                          {:title label
                                           :options {:on-click #(commands/exec-plugin-simple-command!
                                                                  pid (assoc cmd :page (state/get-current-page)) action)}}))