소스 검색

improve(plugin): support register ui on page bar

charlie 4 년 전
부모
커밋
7b39494aa8
4개의 변경된 파일15개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 1
      resources/js/lsplugin.core.js
  2. 6 0
      src/main/frontend/components/page.cljs
  3. 1 1
      src/main/frontend/components/plugins.cljs
  4. 8 0
      src/main/frontend/components/plugins.css

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1
resources/js/lsplugin.core.js


+ 6 - 0
src/main/frontend/components/page.cljs

@@ -6,6 +6,7 @@
             [frontend.handler.page :as page-handler]
             [frontend.handler.page :as page-handler]
             [frontend.handler.ui :as ui-handler]
             [frontend.handler.ui :as ui-handler]
             [frontend.handler.common :as common-handler]
             [frontend.handler.common :as common-handler]
+            [frontend.handler.plugin :as plugin-handler]
             [frontend.handler.route :as route-handler]
             [frontend.handler.route :as route-handler]
             [frontend.handler.graph :as graph-handler]
             [frontend.handler.graph :as graph-handler]
             [frontend.handler.notification :as notification]
             [frontend.handler.notification :as notification]
@@ -365,7 +366,12 @@
                                     (flatten)
                                     (flatten)
                                     (remove nil?)))]
                                     (remove nil?)))]
                    [:div.flex.flex-row
                    [:div.flex.flex-row
+
                     (plugins/hook-ui-slot :page-head-actions-slotted nil)
                     (plugins/hook-ui-slot :page-head-actions-slotted nil)
+
+                    (when plugin-handler/lsp-enabled?
+                      (plugins/hook-ui-items :pagebar))
+
                     [:a.opacity-60.hover:opacity-100.page-op.mr-1
                     [:a.opacity-60.hover:opacity-100.page-op.mr-1
                      {:title "Search in current page"
                      {:title "Search in current page"
                       :on-click #(route-handler/go-to-search! :page)}
                       :on-click #(route-handler/go-to-search! :page)}

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

@@ -196,7 +196,7 @@
 (rum/defcs hook-ui-items < rum/reactive
 (rum/defcs hook-ui-items < rum/reactive
   "type
   "type
       - :toolbar
       - :toolbar
-      - :page
+      - :pagebar
    "
    "
   [state type]
   [state type]
   (when (state/sub [:plugin/installed-ui-items])
   (when (state/sub [:plugin/installed-ui-items])

+ 8 - 0
src/main/frontend/components/plugins.css

@@ -189,6 +189,14 @@
       @apply px-2 opacity-50 hover:opacity-100 transition-opacity;
       @apply px-2 opacity-50 hover:opacity-100 transition-opacity;
     }
     }
   }
   }
+
+  &[data-type=pagebar] {
+    @apply flex items-start pl-2;
+
+    > .injected-ui-item-pagebar {
+      @apply pr-3 opacity-30 hover:opacity-100 transition-opacity;
+    }
+  }
 }
 }
 
 
 body {
 body {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.