mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Lexical: Added button icon system
With a bunch of default icons
This commit is contained in:
@ -9,11 +9,13 @@ import {LexicalElementNodeCreator, LexicalNodeMatcher} from "./nodes";
|
||||
import {$getNearestBlockElementAncestorOrThrow} from "@lexical/utils";
|
||||
import {$setBlocksType} from "@lexical/selection";
|
||||
|
||||
export function el(tag: string, attrs: Record<string, string> = {}, children: (string|HTMLElement)[] = []): HTMLElement {
|
||||
export function el(tag: string, attrs: Record<string, string|null> = {}, children: (string|HTMLElement)[] = []): HTMLElement {
|
||||
const el = document.createElement(tag);
|
||||
const attrKeys = Object.keys(attrs);
|
||||
for (const attr of attrKeys) {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
if (attrs[attr] !== null) {
|
||||
el.setAttribute(attr, attrs[attr] as string);
|
||||
}
|
||||
}
|
||||
|
||||
for (const child of children) {
|
||||
|
Reference in New Issue
Block a user