mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(editor): edgeless note toolbar config extension (#10719)
This commit is contained in:
@@ -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?:
|
||||
|
||||
@@ -56,6 +56,10 @@ abstract class ToolbarContextBase {
|
||||
return this.std.store;
|
||||
}
|
||||
|
||||
get history() {
|
||||
return this.store.history;
|
||||
}
|
||||
|
||||
get view() {
|
||||
return this.std.view;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user