refactor(editor): edgeless note toolbar config extension (#10719)

This commit is contained in:
fundon
2025-03-19 12:34:18 +00:00
parent b5406fa57a
commit e320552594
30 changed files with 1486 additions and 59 deletions

View File

@@ -20,7 +20,7 @@ type ActionBase = {
export type ToolbarAction = ActionBase & {
label?: string;
icon?: TemplateResult;
tooltip?: string;
tooltip?: string | TemplateResult;
variant?: 'destructive';
disabled?: ((cx: ToolbarContext) => boolean) | boolean;
content?:

View File

@@ -56,6 +56,10 @@ abstract class ToolbarContextBase {
return this.std.store;
}
get history() {
return this.store.history;
}
get view() {
return this.std.view;
}

View File

@@ -25,14 +25,14 @@ export function ToolbarModuleExtension(module: ToolbarModule): ExtensionType {
export class ToolbarRegistryExtension extends Extension {
flavour$ = signal<string>('affine:note');
elementsMap$ = signal<Map<string, GfxModel[]>>(new Map());
message$ = signal<{
flavour: string;
element: Element;
setFloating: (element?: Element) => void;
} | null>(null);
elementsMap$ = signal<Map<string, GfxModel[]>>(new Map());
flags = new Flags();
constructor(readonly std: BlockStdScope) {