1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Lexical: Completed out table menu elements, logic pending

This commit is contained in:
Dan Brown
2024-08-03 18:01:54 +01:00
parent a27a325af7
commit e94ad78ea7
7 changed files with 409 additions and 66 deletions

View File

@ -9,14 +9,27 @@ import {EditorTableCreator} from "./framework/blocks/table-creator";
import {EditorColorButton} from "./framework/blocks/color-button";
import {EditorOverflowContainer} from "./framework/blocks/overflow-container";
import {
cellProperties,
cellProperties, clearTableFormatting,
copyColumn,
copyRow,
cutColumn,
cutRow,
deleteColumn,
deleteRow,
deleteTable, deleteTableMenuAction, insertColumnAfter,
deleteTable,
deleteTableMenuAction,
insertColumnAfter,
insertColumnBefore,
insertRowAbove,
insertRowBelow, mergeCells, splitCell,
table
insertRowBelow,
mergeCells,
pasteColumnAfter,
pasteColumnBefore,
pasteRowAfter,
pasteRowBefore, resizeTableToContents,
rowProperties,
splitCell,
table, tableProperties
} from "./defaults/buttons/tables";
import {fullscreen, redo, source, undo} from "./defaults/buttons/controls";
import {
@ -119,11 +132,33 @@ export function getMainEditorFullToolbar(): EditorContainerUiElement {
new EditorDropdownButton({button: {...table, format: 'long'}, showOnHover: true}, [
new EditorTableCreator(),
]),
new EditorDropdownButton({button: {label: 'Cell'}}, [
new EditorDropdownButton({button: {label: 'Cell'}, direction: 'vertical', showOnHover: true}, [
new EditorButton(cellProperties),
new EditorButton(mergeCells),
new EditorButton(splitCell),
]),
new EditorDropdownButton({button: {label: 'Row'}, direction: 'vertical', showOnHover: true}, [
new EditorButton({...insertRowAbove, format: 'long'}),
new EditorButton({...insertRowBelow, format: 'long'}),
new EditorButton({...deleteRow, format: 'long'}),
new EditorButton(rowProperties),
new EditorButton(cutRow),
new EditorButton(copyRow),
new EditorButton(pasteRowBefore),
new EditorButton(pasteRowAfter),
]),
new EditorDropdownButton({button: {label: 'Column'}, direction: 'vertical', showOnHover: true}, [
new EditorButton({...insertColumnBefore, format: 'long'}),
new EditorButton({...insertColumnAfter, format: 'long'}),
new EditorButton({...deleteColumn, format: 'long'}),
new EditorButton(cutColumn),
new EditorButton(copyColumn),
new EditorButton(pasteColumnBefore),
new EditorButton(pasteColumnAfter),
]),
new EditorButton({...tableProperties, format: 'long'}),
new EditorButton(clearTableFormatting),
new EditorButton(resizeTableToContents),
new EditorButton(deleteTableMenuAction),
]),
@ -176,7 +211,7 @@ export function getCodeToolbarContent(): EditorUiElement[] {
export function getTableToolbarContent(): EditorUiElement[] {
return [
new EditorOverflowContainer(2, [
// Todo - Table properties
new EditorButton(tableProperties),
new EditorButton(deleteTable),
]),
new EditorOverflowContainer(3, [