mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
refactor(editor): remove global types in config (#10143)
Closes: [BS-2554](https://linear.app/affine-design/issue/BS-2554/remove-global-types-in-block-config)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { ConfigExtensionFactory } from '@blocksuite/block-std';
|
||||
|
||||
import type { ToolbarMoreMenuConfig } from './types';
|
||||
|
||||
export const ToolbarMoreMenuConfigExtension = ConfigExtensionFactory<
|
||||
Partial<ToolbarMoreMenuConfig>
|
||||
>('affine-toolbar-more-menu');
|
||||
@@ -8,6 +8,7 @@ import { EditorToolbarSeparator } from './separator.js';
|
||||
import { EditorToolbar } from './toolbar.js';
|
||||
import { Tooltip } from './tooltip.js';
|
||||
|
||||
export { ToolbarMoreMenuConfigExtension } from './config.js';
|
||||
export { EditorIconButton } from './icon-button.js';
|
||||
export {
|
||||
EditorMenuAction,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { ifDefined } from 'lit/directives/if-defined.js';
|
||||
import { join } from 'lit/directives/join.js';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
|
||||
import { ToolbarMoreMenuConfigExtension } from './config.js';
|
||||
import type { MenuContext } from './menu-context.js';
|
||||
import type {
|
||||
FatMenuItems,
|
||||
@@ -112,10 +113,6 @@ export function renderToolbarSeparator() {
|
||||
export function getMoreMenuConfig(std: BlockStdScope): ToolbarMoreMenuConfig {
|
||||
return {
|
||||
configure: <T extends MenuContext>(groups: MenuItemGroup<T>[]) => groups,
|
||||
...(
|
||||
std.getConfig('affine:page' as BlockSuite.ConfigKeys) as null | {
|
||||
toolbarMoreMenu: Partial<ToolbarMoreMenuConfig>;
|
||||
}
|
||||
)?.toolbarMoreMenu,
|
||||
...std.getOptional(ToolbarMoreMenuConfigExtension.identifier),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user