1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-11-29 17:03:06 +03:00

Lexical: Wired table properties, and other buttons

This commit is contained in:
Dan Brown
2024-08-10 13:14:55 +01:00
parent abbfd42a6c
commit ebf95f637a
9 changed files with 243 additions and 79 deletions

View File

@@ -1,8 +1,4 @@
import {
$createParagraphNode,
$isElementNode,
$isLineBreakNode,
$isTextNode,
DOMConversionMap,
DOMConversionOutput,
EditorConfig,
@@ -11,14 +7,11 @@ import {
} from "lexical";
import {
$createTableCellNode,
$isTableCellNode,
SerializedTableRowNode,
TableCellHeaderStates,
TableRowNode
} from "@lexical/table";
import {createStyleMapFromDomStyles, StyleMap} from "../utils/styles";
import {NodeKey} from "lexical/LexicalNode";
import {extractStyleMapFromElement, StyleMap} from "../utils/dom";
export type SerializedCustomTableRowNode = Spread<{
styles: Record<string, string>,
@@ -98,7 +91,7 @@ export function $convertTableRowElement(domNode: Node): DOMConversionOutput {
const rowNode = $createCustomTableRowNode();
if (domNode instanceof HTMLElement) {
rowNode.setStyles(createStyleMapFromDomStyles(domNode.style));
rowNode.setStyles(extractStyleMapFromElement(domNode));
}
return {node: rowNode};