# UI Extension Points Plugins can extend existing Console/UC UI via `extensionPoints` in `definePlugin()`. ## ExtensionPoint Keys ### Editor ```ts "editor:create": () => EditorProvider[] | Promise; "default:editor:extension:create": () => AnyExtension[] | Promise; ``` ### Dashboard ```ts "console:dashboard:widgets:create": () => DashboardWidgetDefinition[] | Promise; "console:dashboard:widgets:internal:quick-action:item:create": () => DashboardWidgetQuickActionItem[] | Promise; ``` ### Attachment Selector ```ts "attachment:selector:create": () => AttachmentSelectProvider[] | Promise; ``` ### Comment Subject Ref ```ts "comment:subject-ref:create": () => CommentSubjectRefProvider[]; ``` ### List Item Operations Add action buttons to list items: ```ts "post:list-item:operation:create": (post: Ref) => OperationItem[]; "single-page:list-item:operation:create": (singlePage: Ref) => OperationItem[]; "comment:list-item:operation:create": (comment: Ref) => OperationItem[]; "reply:list-item:operation:create": (reply: Ref) => OperationItem[]; "plugin:list-item:operation:create": (plugin: Ref) => OperationItem[]; "backup:list-item:operation:create": (backup: Ref) => OperationItem[]; "attachment:list-item:operation:create": (attachment: Ref) => OperationItem[]; "theme:list-item:operation:create": (theme: Ref) => OperationItem[]; ``` ### List Item Fields Add columns to list tables: ```ts "plugin:list-item:field:create": (plugin: Ref) => EntityFieldItem[]; "post:list-item:field:create": (post: Ref) => EntityFieldItem[]; "single-page:list-item:field:create": (singlePage: Ref) => EntityFieldItem[]; ``` ### Tabs ```ts "plugin:self:tabs:create": () => PluginTab[] | Promise; "backup:tabs:create": () => BackupTab[] | Promise; "plugin:installation:tabs:create": () => PluginInstallationTab[] | Promise; "theme:list:tabs:create": () => ThemeListTab[] | Promise; "user:detail:tabs:create": () => UserTab[] | Promise; "uc:user:profile:tabs:create": () => UserProfileTab[] | Promise; ``` ## Example: Adding a Post List Operation ```ts import { definePlugin } from "@halo-dev/ui-shared"; import { VButton } from "@halo-dev/components"; import { h } from "vue"; export default definePlugin({ extensionPoints: { "post:list-item:operation:create": (post) => [ { priority: 10, component: h( VButton, { size: "sm", onClick: () => { console.log("Action on post:", post.value.metadata.name); }, }, () => "My Action", ), }, ], }, }); ``` ## Example: Registering a Dashboard Widget ```ts import { definePlugin } from "@halo-dev/ui-shared"; import MyWidget from "./components/MyWidget.vue"; export default definePlugin({ extensionPoints: { "console:dashboard:widgets:create": () => [ { id: "my-plugin-widget", name: "My Widget", component: MyWidget, priority: 10, permissions: [], }, ], }, }); ```