feat: add support for right-side composer sidebar and update related types
This commit is contained in:
@@ -48,6 +48,7 @@ function resetStore() {
|
||||
'email-footer': [],
|
||||
'composer-toolbar': [],
|
||||
'composer-sidebar': [],
|
||||
'composer-sidebar-right': [],
|
||||
'sidebar-widget': [],
|
||||
'email-detail-sidebar': [],
|
||||
'settings-section': [],
|
||||
|
||||
+2
-1
@@ -612,7 +612,8 @@ export function createPluginAPI(plugin: InstalledPlugin): PluginAPI {
|
||||
|
||||
registerComposerSidebar: (widget: SidebarWidget) => {
|
||||
requirePermission(plugin, 'ui:composer-sidebar');
|
||||
return registerSlot(plugin.id, 'composer-sidebar', widget.render as React.ComponentType<Record<string, unknown>>, widget.order ?? 100);
|
||||
const slot = widget.side === 'right' ? 'composer-sidebar-right' : 'composer-sidebar';
|
||||
return registerSlot(plugin.id, slot, widget.render as React.ComponentType<Record<string, unknown>>, widget.order ?? 100);
|
||||
},
|
||||
|
||||
registerDetailSidebar: (widget: SidebarWidget) => {
|
||||
|
||||
@@ -110,6 +110,7 @@ export type SlotName =
|
||||
| 'email-footer'
|
||||
| 'composer-toolbar'
|
||||
| 'composer-sidebar'
|
||||
| 'composer-sidebar-right'
|
||||
| 'sidebar-widget'
|
||||
| 'email-detail-sidebar'
|
||||
| 'settings-section'
|
||||
@@ -159,6 +160,12 @@ export interface SidebarWidget {
|
||||
label: string;
|
||||
render: React.ComponentType;
|
||||
order?: number;
|
||||
/**
|
||||
* For composer sidebars, choose which side of the New Message dialog the
|
||||
* panel renders on. Defaults to `'left'` for backwards compatibility.
|
||||
* Ignored by other sidebar slots.
|
||||
*/
|
||||
side?: 'left' | 'right';
|
||||
}
|
||||
|
||||
export interface ContextMenuItem {
|
||||
|
||||
Reference in New Issue
Block a user