Просмотр исходного кода

improve(plugin): types & apis of slot hooks

charlie 4 лет назад
Родитель
Сommit
4f0cf8a88e

+ 2 - 1
libs/src/LSPlugin.ts

@@ -182,7 +182,8 @@ export interface IAppProxy {
   // events
   onCurrentGraphChanged: IUserHook
   onThemeModeChanged: IUserHook<{ mode: 'dark' | 'light' }>
-  onBlockRendererMounted: IUserSlotHook<{ uuid: BlockUUID }>
+  onBlockRendererSlotted: IUserSlotHook<{ uuid: BlockUUID }>
+  onPageHeadActionsSlotted: IUserSlotHook
   onRouteChanged: IUserHook<{ path: string, template: string }>
   onSidebarVisibleChanged: IUserHook<{ visible: boolean }>
 }

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

@@ -365,6 +365,7 @@
                                     (flatten)
                                     (remove nil?)))]
                    [:div.flex.flex-row
+                    (plugins/hook-ui-slot :page-head-actions-slotted nil)
                     [:a.opacity-30.hover:opacity-100.page-op.mr-1
                      {:title "Search in current page"
                       :on-click #(route-handler/go-to-search! :page)}

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

@@ -183,7 +183,7 @@
 body {
   &[data-page=page] {
     .lsp-hook-ui-slot {
-      @apply flex items-center px-1 opacity-70;
+      @apply flex px-1 opacity-30 hover:opacity-50;
     }
   }
 }