1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Lexical: Added more icons, made reflective text/bg color buttons

This commit is contained in:
Dan Brown
2024-06-23 15:50:41 +01:00
parent a07092b7e6
commit 5546b8ff43
10 changed files with 79 additions and 19 deletions

View File

@@ -1,7 +1,6 @@
import {BaseSelection} from "lexical";
import {EditorUiContext, EditorUiElement, EditorUiStateUpdate} from "./core";
import {el} from "../../helpers";
import {context} from "esbuild";
export interface EditorBasicButtonDefinition {
label: string;
@@ -20,9 +19,22 @@ export class EditorButton extends EditorUiElement {
protected completedSetup: boolean = false;
protected disabled: boolean = false;
constructor(definition: EditorButtonDefinition) {
constructor(definition: EditorButtonDefinition|EditorBasicButtonDefinition) {
super();
this.definition = definition;
if ((definition as EditorButtonDefinition).action !== undefined) {
this.definition = definition as EditorButtonDefinition;
} else {
this.definition = {
...definition,
action() {
return false;
},
isActive: () => {
return false;
}
};
}
}
setContext(context: EditorUiContext) {