From c6449f34e56f6f219325c1a17f07ee65843df3e8 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Thu, 23 Oct 2025 16:36:17 +0200 Subject: [PATCH 1/6] Added missing Delete key handlers --- .../commands/mergeBlocks/mergeBlocks.ts | 23 +++ .../KeyboardShortcutsExtension.ts | 168 ++++++++++++++---- 2 files changed, 154 insertions(+), 37 deletions(-) diff --git a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts index 50f8aa346c..4877e549a1 100644 --- a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +++ b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts @@ -50,6 +50,27 @@ export const getPrevBlockInfo = (doc: Node, beforePos: number) => { return prevBlockInfo; }; +/** + * Returns the block info from the sibling block after (below) the given block, + * or undefined if the given block is the last sibling. + */ +export const getNextBlockInfo = (doc: Node, beforePos: number) => { + const $pos = doc.resolve(beforePos); + + const indexInParent = $pos.index(); + + if (indexInParent === $pos.node().childCount - 1) { + return undefined; + } + + const nextBlockBeforePos = $pos.posAtIndex(indexInParent + 1); + + const nextBlockInfo = getBlockInfoFromResolvedPos( + doc.resolve(nextBlockBeforePos), + ); + return nextBlockInfo; +}; + /** * If a block has children like this: * A @@ -88,6 +109,7 @@ const mergeBlocks = ( prevBlockInfo: BlockInfo, nextBlockInfo: BlockInfo, ) => { + debugger; // Un-nests all children of the next block. if (!nextBlockInfo.isBlockContainer) { throw new Error( @@ -143,6 +165,7 @@ export const mergeBlocksCommand = state: EditorState; dispatch: ((args?: any) => any) | undefined; }) => { + debugger; const $pos = state.doc.resolve(posBetweenBlocks); const nextBlockInfo = getBlockInfoFromResolvedPos($pos); diff --git a/packages/core/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts b/packages/core/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts index 94230143db..d48df900d6 100644 --- a/packages/core/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +++ b/packages/core/src/extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts @@ -4,6 +4,7 @@ import { TextSelection } from "prosemirror-state"; import { ReplaceAroundStep } from "prosemirror-transform"; import { getBottomNestedBlockInfo, + getNextBlockInfo, getParentBlockInfo, getPrevBlockInfo, mergeBlocksCommand, @@ -296,20 +297,13 @@ export const KeyboardShortcutsExtension = Extension.create<{ } else if ( prevBlockInfo.blockContent.node.type.spec.content === "" ) { - const nonEditableBlockContentStartPos = - prevBlockInfo.blockContent.afterPos - - prevBlockInfo.blockContent.node.nodeSize; - chainedCommands = chainedCommands.setNodeSelection( - nonEditableBlockContentStartPos, + prevBlockInfo.blockContent.beforePos, ); } else { - const blockContentStartPos = - prevBlockInfo.blockContent.afterPos - - prevBlockInfo.blockContent.node.nodeSize; - - chainedCommands = - chainedCommands.setTextSelection(blockContentStartPos); + chainedCommands = chainedCommands.setTextSelection( + prevBlockInfo.blockContent.afterPos - 1, + ); } return chainedCommands @@ -383,7 +377,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ ]); const handleDelete = () => - this.editor.commands.first(({ commands }) => [ + this.editor.commands.first(({ chain, commands }) => [ // Deletes the selection if it's not empty. () => commands.deleteSelection(), // Merges block with the next one (at the same nesting level or lower), @@ -391,42 +385,142 @@ export const KeyboardShortcutsExtension = Extension.create<{ // end of the block. () => commands.command(({ state }) => { - // TODO: Change this to not rely on offsets & schema assumptions const blockInfo = getBlockInfoFromSelection(state); if (!blockInfo.isBlockContainer) { return false; } - const { - bnBlock: blockContainer, - blockContent, - childContainer, - } = blockInfo; + const { bnBlock: blockContainer, blockContent } = blockInfo; - const { depth } = state.doc.resolve(blockContainer.beforePos); - const blockAtDocEnd = - blockContainer.afterPos === state.doc.nodeSize - 3; const selectionAtBlockEnd = state.selection.from === blockContent.afterPos - 1; const selectionEmpty = state.selection.empty; - const hasChildBlocks = childContainer !== undefined; - if ( - !blockAtDocEnd && - selectionAtBlockEnd && - selectionEmpty && - !hasChildBlocks - ) { - let oldDepth = depth; - let newPos = blockContainer.afterPos + 1; - let newDepth = state.doc.resolve(newPos).depth; - - while (newDepth < oldDepth) { - oldDepth = newDepth; - newPos += 2; - newDepth = state.doc.resolve(newPos).depth; + const posBetweenBlocks = blockContainer.afterPos; + + if (selectionAtBlockEnd && selectionEmpty) { + return chain() + .command(mergeBlocksCommand(posBetweenBlocks)) + .scrollIntoView() + .run(); + } + + return false; + }), + // Deletes the current block if it's an empty block with inline content, + // and moves the selection to the next block. + () => + commands.command(({ state }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer) { + return false; + } + + const blockEmpty = + blockInfo.blockContent.node.childCount === 0 && + blockInfo.blockContent.node.type.spec.content === "inline*"; + + if (blockEmpty) { + const nextBlockInfo = getNextBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!nextBlockInfo || !nextBlockInfo.isBlockContainer) { + return false; + } + + let chainedCommands = chain(); + + if ( + nextBlockInfo.blockContent.node.type.spec.content === + "tableRow+" + ) { + const tableBlockStartPos = blockInfo.bnBlock.afterPos + 1; + const tableBlockContentStartPos = tableBlockStartPos + 1; + const firstRowStartPos = tableBlockContentStartPos + 1; + const firstCellStartPos = firstRowStartPos + 1; + const firstCellParagraphStartPos = firstCellStartPos + 1; + + chainedCommands = chainedCommands.setTextSelection( + firstCellParagraphStartPos, + ); + } else if ( + nextBlockInfo.blockContent.node.type.spec.content === "" + ) { + chainedCommands = chainedCommands.setNodeSelection( + nextBlockInfo.blockContent.beforePos, + ); + } else { + chainedCommands = chainedCommands.setTextSelection( + nextBlockInfo.blockContent.beforePos + 1, + ); } - return commands.command(mergeBlocksCommand(newPos - 1)); + return chainedCommands + .deleteRange({ + from: blockInfo.bnBlock.beforePos, + to: blockInfo.bnBlock.afterPos, + }) + .scrollIntoView() + .run(); + } + + return false; + }), + // Deletes next block if it contains no content and isn't a table, + // when the selection is empty and at the end of the block. Moves the + // current block into the deleted block's place. + () => + commands.command(({ state }) => { + const blockInfo = getBlockInfoFromSelection(state); + + if (!blockInfo.isBlockContainer) { + // TODO + throw new Error(`todo`); + } + + const selectionAtBlockEnd = + state.selection.from === blockInfo.blockContent.afterPos - 1; + const selectionEmpty = state.selection.empty; + + const nextBlockInfo = getNextBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!nextBlockInfo) { + return false; + } + if (!nextBlockInfo.isBlockContainer) { + // TODO + throw new Error(`todo`); + } + + if (nextBlockInfo && selectionAtBlockEnd && selectionEmpty) { + const nextBlockNotTableAndNoContent = + nextBlockInfo.blockContent.node.type.spec.content === "" || + (nextBlockInfo.blockContent.node.type.spec.content === + "inline*" && + nextBlockInfo.blockContent.node.childCount === 0); + + if (nextBlockNotTableAndNoContent) { + if (nextBlockInfo.bnBlock.node.childCount === 2) { + const childBlocks = + nextBlockInfo.bnBlock.node.lastChild!.content; + return chain() + .deleteRange({ + from: nextBlockInfo.bnBlock.beforePos, + to: nextBlockInfo.bnBlock.afterPos, + }) + .insertContentAt(blockInfo.bnBlock.afterPos, childBlocks) + .run(); + } + + return chain() + .deleteRange({ + from: nextBlockInfo.bnBlock.beforePos, + to: nextBlockInfo.bnBlock.afterPos, + }) + .run(); + } } return false; From 9787e8715b7044ee0105740d5f5d254578a09151 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Thu, 23 Oct 2025 16:47:08 +0200 Subject: [PATCH 2/6] Removed debugger statements --- .../api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts index 4877e549a1..13ced634e9 100644 --- a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +++ b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts @@ -109,7 +109,6 @@ const mergeBlocks = ( prevBlockInfo: BlockInfo, nextBlockInfo: BlockInfo, ) => { - debugger; // Un-nests all children of the next block. if (!nextBlockInfo.isBlockContainer) { throw new Error( @@ -165,7 +164,6 @@ export const mergeBlocksCommand = state: EditorState; dispatch: ((args?: any) => any) | undefined; }) => { - debugger; const $pos = state.doc.resolve(posBetweenBlocks); const nextBlockInfo = getBlockInfoFromResolvedPos($pos); From 0cd1a635bc46163028b851583709c58246f6b8eb Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Fri, 20 Feb 2026 16:11:26 +0100 Subject: [PATCH 3/6] Added additional backspace/delete handlers --- .../KeyboardShortcutsExtension.ts | 251 ++++++++++++++++-- 1 file changed, 226 insertions(+), 25 deletions(-) diff --git a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts index 89e25fee8c..2e231885c2 100644 --- a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +++ b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts @@ -11,7 +11,10 @@ import { nestBlock } from "../../../api/blockManipulation/commands/nestBlock/nes import { fixColumnList } from "../../../api/blockManipulation/commands/replaceBlocks/util/fixColumnList.js"; import { splitBlockCommand } from "../../../api/blockManipulation/commands/splitBlock/splitBlock.js"; import { updateBlockCommand } from "../../../api/blockManipulation/commands/updateBlock/updateBlock.js"; -import { getBlockInfoFromSelection } from "../../../api/getBlockInfoFromPos.js"; +import { + getBlockInfoFromResolvedPos, + getBlockInfoFromSelection, +} from "../../../api/getBlockInfoFromPos.js"; import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js"; import { FormattingToolbarExtension } from "../../FormattingToolbar/FormattingToolbar.js"; import { FilePanelExtension } from "../../FilePanel/FilePanel.js"; @@ -84,6 +87,18 @@ export const KeyboardShortcutsExtension = Extension.create<{ } const { bnBlock: blockContainer, blockContent } = blockInfo; + const prevBlockInfo = getPrevBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if ( + !prevBlockInfo || + !prevBlockInfo.isBlockContainer || + prevBlockInfo.blockContent.node.type.spec.content !== "inline*" + ) { + return false; + } + const selectionAtBlockStart = state.selection.from === blockContent.beforePos + 1; const selectionEmpty = state.selection.empty; @@ -99,9 +114,46 @@ export const KeyboardShortcutsExtension = Extension.create<{ return false; }), + // If the previous block is a columnList, moves the current block to + // the end of the last column in it. + () => + commands.command(({ state, tr, dispatch }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer) { + return false; + } + + const prevBlockInfo = getPrevBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!prevBlockInfo || prevBlockInfo.isBlockContainer) { + return false; + } + + if (dispatch) { + const columnAfterPos = prevBlockInfo.bnBlock.afterPos - 1; + const $blockAfterPos = tr.doc.resolve(columnAfterPos - 1); + + tr.delete( + blockInfo.bnBlock.beforePos, + blockInfo.bnBlock.afterPos, + ); + tr.insert($blockAfterPos.pos, blockInfo.bnBlock.node); + tr.setSelection( + TextSelection.near(tr.doc.resolve($blockAfterPos.pos + 1)), + ); + + return true; + } + + return false; + }), + // If the block is the first in a column, moves it to the end of the + // previous column. If there is no previous column, moves it above the + // columnList. () => commands.command(({ state, tr, dispatch }) => { - // when at the start of a first block in a column const blockInfo = getBlockInfoFromSelection(state); if (!blockInfo.isBlockContainer) { return false; @@ -117,7 +169,6 @@ export const KeyboardShortcutsExtension = Extension.create<{ const prevBlock = $pos.nodeBefore; if (prevBlock) { - // should be no previous block return false; } @@ -131,31 +182,22 @@ export const KeyboardShortcutsExtension = Extension.create<{ const columnListPos = $columnPos.before(); if (dispatch) { - const fragment = tr.doc.slice( - blockInfo.bnBlock.beforePos, - blockInfo.bnBlock.afterPos, - ).content; - tr.delete( blockInfo.bnBlock.beforePos, blockInfo.bnBlock.afterPos, ); + fixColumnList(tr, columnListPos); - if ($columnPos.index() === 0) { - // Fix `columnList` and insert the block before it. - fixColumnList(tr, columnListPos); - tr.insert(columnListPos, fragment); + if ($columnPos.pos === columnListPos + 1) { + tr.insert(columnListPos, blockInfo.bnBlock.node); tr.setSelection( TextSelection.near(tr.doc.resolve(columnListPos)), ); } else { - // Insert the block at the end of the first column and fix - // `columnList`. - tr.insert($columnPos.pos - 1, fragment); + tr.insert($columnPos.pos - 1, blockInfo.bnBlock.node); tr.setSelection( - TextSelection.near(tr.doc.resolve($columnPos.pos - 1)), + TextSelection.near(tr.doc.resolve($columnPos.pos)), ); - fixColumnList(tr, columnListPos); } } @@ -239,8 +281,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ const blockInfo = getBlockInfoFromSelection(state); if (!blockInfo.isBlockContainer) { - // TODO - throw new Error(`todo`); + return false; } const selectionAtBlockStart = @@ -259,8 +300,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ ); if (!bottomBlock.isBlockContainer) { - // TODO - throw new Error(`todo`); + return false; } const prevBlockNotTableAndNoContent = @@ -294,6 +334,66 @@ export const KeyboardShortcutsExtension = Extension.create<{ this.editor.commands.first(({ chain, commands }) => [ // Deletes the selection if it's not empty. () => commands.deleteSelection(), + // Deletes the first child block into the current block, if the + // selection is empty and at the end of the current block. If both the + // parent and child blocks have inline content, the child block's + // content is appended to the parent's. + () => + commands.command(({ state }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer || !blockInfo.childContainer) { + return false; + } + const { blockContent, childContainer } = blockInfo; + + const selectionAtBlockEnd = + state.selection.from === blockContent.afterPos - 1; + const selectionEmpty = state.selection.empty; + + const firstChildBlockInfo = getBlockInfoFromResolvedPos( + state.doc.resolve(childContainer.beforePos + 1), + ); + if (!firstChildBlockInfo.isBlockContainer) { + return false; + } + + if (selectionAtBlockEnd && selectionEmpty) { + const firstChildBlockContent = + firstChildBlockInfo.bnBlock.node.firstChild!; + const firstChildBlockHasInlineContent = + firstChildBlockContent.type.spec.content === "inline*"; + const blockHasInlineContent = + blockContent.node.type.spec.content === "inline*"; + + return ( + chain() + .deleteRange( + // Deletes whole child container if there's only one child. + childContainer.node.childCount === 1 + ? { + from: childContainer.beforePos, + to: childContainer.afterPos, + } + : { + from: firstChildBlockInfo.bnBlock.beforePos, + to: firstChildBlockInfo.bnBlock.afterPos, + }, + ) + // Appends inline content from child block if possible. + .insertContentAt( + state.selection.from, + firstChildBlockHasInlineContent && blockHasInlineContent + ? firstChildBlockContent.content + : null, + ) + .setTextSelection(state.selection.from) + .scrollIntoView() + .run() + ); + } + + return false; + }), // Merges block with the next one (at the same nesting level or lower), // if one exists, the block has no children, and the selection is at the // end of the block. @@ -305,6 +405,14 @@ export const KeyboardShortcutsExtension = Extension.create<{ } const { bnBlock: blockContainer, blockContent } = blockInfo; + const nextBlockInfo = getNextBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!nextBlockInfo || !nextBlockInfo.isBlockContainer) { + return false; + } + const selectionAtBlockEnd = state.selection.from === blockContent.afterPos - 1; const selectionEmpty = state.selection.empty; @@ -320,6 +428,101 @@ export const KeyboardShortcutsExtension = Extension.create<{ return false; }), + // If the previous block is a columnList, moves the current block to + // the end of the last column in it. + () => + commands.command(({ state, tr, dispatch }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer) { + return false; + } + + const nextBlockInfo = getNextBlockInfo( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!nextBlockInfo || nextBlockInfo.isBlockContainer) { + return false; + } + + if (dispatch) { + const columnBeforePos = nextBlockInfo.bnBlock.beforePos + 1; + const $blockBeforePos = tr.doc.resolve(columnBeforePos + 1); + + tr.delete( + $blockBeforePos.pos, + $blockBeforePos.pos + $blockBeforePos.nodeAfter!.nodeSize, + ); + fixColumnList(tr, nextBlockInfo.bnBlock.beforePos); + tr.insert(blockInfo.bnBlock.afterPos, $blockBeforePos.nodeAfter!); + tr.setSelection( + TextSelection.near(tr.doc.resolve($blockBeforePos.pos)), + ); + + return true; + } + + return false; + }), + // If the block is the last in a column, moves it to the start of the + // next column. If there is no next column, moves it below the + // columnList. + () => + commands.command(({ state, tr, dispatch }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer) { + return false; + } + + const selectionAtBlockEnd = + tr.selection.from === blockInfo.blockContent.afterPos - 1; + if (!selectionAtBlockEnd) { + return false; + } + + const $pos = tr.doc.resolve(blockInfo.bnBlock.afterPos); + + const nextBlock = $pos.nodeAfter; + if (nextBlock) { + return false; + } + + const parentBlock = $pos.node(); + if (parentBlock.type.name !== "column") { + return false; + } + + const $blockEndPos = tr.doc.resolve(blockInfo.bnBlock.afterPos); + const $columnEndPos = tr.doc.resolve($blockEndPos.after()); + const columnListEndPos = $columnEndPos.after(); + + if (dispatch) { + // Position before first block in next column, or first block + // after columnList if there is no next column. + const nextBlockBeforePos = + $columnEndPos.pos === columnListEndPos - 1 + ? columnListEndPos + : $columnEndPos.pos + 1; + const nextBlockInfo = getBlockInfoFromResolvedPos( + tr.doc.resolve(nextBlockBeforePos), + ); + + tr.delete( + nextBlockInfo.bnBlock.beforePos, + nextBlockInfo.bnBlock.afterPos, + ); + fixColumnList( + tr, + columnListEndPos - $columnEndPos.node().nodeSize, + ); + tr.insert($blockEndPos.pos, nextBlockInfo.bnBlock.node); + tr.setSelection( + TextSelection.near(tr.doc.resolve(nextBlockBeforePos)), + ); + } + + return true; + }), // Deletes the current block if it's an empty block with inline content, // and moves the selection to the next block. () => @@ -388,8 +591,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ const blockInfo = getBlockInfoFromSelection(state); if (!blockInfo.isBlockContainer) { - // TODO - throw new Error(`todo`); + return false; } const selectionAtBlockEnd = @@ -404,8 +606,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ return false; } if (!nextBlockInfo.isBlockContainer) { - // TODO - throw new Error(`todo`); + return false; } if (nextBlockInfo && selectionAtBlockEnd && selectionEmpty) { From 98c5f36d3048a074cc3fa5ab3629db95d550c91a Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Fri, 20 Feb 2026 17:49:13 +0100 Subject: [PATCH 4/6] Added additional case for delete handler --- .../commands/mergeBlocks/mergeBlocks.ts | 7 +- .../KeyboardShortcutsExtension.ts | 96 ++++++++++++++++++- 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts index 13ced634e9..96b801335c 100644 --- a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +++ b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts @@ -19,8 +19,11 @@ export const getParentBlockInfo = (doc: Node, beforePos: number) => { // get start pos of parent const parentBeforePos = $pos.posAtIndex( - $pos.index($pos.depth - 1), - $pos.depth - 1, + // TODO: This works for blockContainer nodes as we need to traverse 2 + // nesting levels due to the blockGroup in between. However, that's not the + // case for columns. + $pos.index($pos.depth - 2), + $pos.depth - 2, ); const parentBlockInfo = getBlockInfoFromResolvedPos( diff --git a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts index 2e231885c2..e13696fd3b 100644 --- a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +++ b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts @@ -1,9 +1,11 @@ import { Extension } from "@tiptap/core"; - +import { Fragment, Node } from "prosemirror-model"; import { TextSelection } from "prosemirror-state"; + import { getBottomNestedBlockInfo, getNextBlockInfo, + getParentBlockInfo, getPrevBlockInfo, mergeBlocksCommand, } from "../../../api/blockManipulation/commands/mergeBlocks/mergeBlocks.js"; @@ -334,10 +336,11 @@ export const KeyboardShortcutsExtension = Extension.create<{ this.editor.commands.first(({ chain, commands }) => [ // Deletes the selection if it's not empty. () => commands.deleteSelection(), - // Deletes the first child block into the current block, if the + // Deletes the first child block and un-nests its children, if the // selection is empty and at the end of the current block. If both the // parent and child blocks have inline content, the child block's - // content is appended to the parent's. + // content is appended to the parent's. The child block's own children + // are unindented before it's deleted. () => commands.command(({ state }) => { const blockInfo = getBlockInfoFromSelection(state); @@ -359,7 +362,7 @@ export const KeyboardShortcutsExtension = Extension.create<{ if (selectionAtBlockEnd && selectionEmpty) { const firstChildBlockContent = - firstChildBlockInfo.bnBlock.node.firstChild!; + firstChildBlockInfo.blockContent.node; const firstChildBlockHasInlineContent = firstChildBlockContent.type.spec.content === "inline*"; const blockHasInlineContent = @@ -367,6 +370,12 @@ export const KeyboardShortcutsExtension = Extension.create<{ return ( chain() + // Un-nests child block's children if necessary. + .insertContentAt( + firstChildBlockInfo.bnBlock.afterPos, + firstChildBlockInfo.childContainer?.node.content || + Fragment.empty, + ) .deleteRange( // Deletes whole child container if there's only one child. childContainer.node.childCount === 1 @@ -523,6 +532,85 @@ export const KeyboardShortcutsExtension = Extension.create<{ return true; }), + // Deletes the next block at either the same or lower nesting level, if + // the selection is empty and at the end of the block. If both the + // current and next blocks have inline content, the next block's + // content is appended to the current block's. The next block's own + // children are unindented before it's deleted. + () => + commands.command(({ state }) => { + const blockInfo = getBlockInfoFromSelection(state); + if (!blockInfo.isBlockContainer) { + return false; + } + const { blockContent } = blockInfo; + + const selectionAtBlockEnd = + state.selection.from === blockContent.afterPos - 1; + const selectionEmpty = state.selection.empty; + + if (selectionAtBlockEnd && selectionEmpty) { + const getNextBlockInfoAtAnyLevel = ( + doc: Node, + beforePos: number, + ) => { + const nextBlockInfo = getNextBlockInfo(doc, beforePos); + if (nextBlockInfo) { + return nextBlockInfo; + } + + const parentBlockInfo = getParentBlockInfo(doc, beforePos); + if (!parentBlockInfo) { + return undefined; + } + + return getNextBlockInfoAtAnyLevel( + doc, + parentBlockInfo.bnBlock.beforePos, + ); + }; + + const nextBlockInfo = getNextBlockInfoAtAnyLevel( + state.doc, + blockInfo.bnBlock.beforePos, + ); + if (!nextBlockInfo || !nextBlockInfo.isBlockContainer) { + return false; + } + + const nextBlockContent = nextBlockInfo.blockContent.node; + const nextBlockHasInlineContent = + nextBlockContent.type.spec.content === "inline*"; + const blockHasInlineContent = + blockContent.node.type.spec.content === "inline*"; + + return ( + chain() + // Un-nests next block's children if necessary. + .insertContentAt( + nextBlockInfo.bnBlock.afterPos, + nextBlockInfo.childContainer?.node.content || + Fragment.empty, + ) + .deleteRange({ + from: nextBlockInfo.bnBlock.beforePos, + to: nextBlockInfo.bnBlock.afterPos, + }) + // Appends inline content from child block if possible. + .insertContentAt( + state.selection.from, + nextBlockHasInlineContent && blockHasInlineContent + ? nextBlockContent.content + : null, + ) + .setTextSelection(state.selection.from) + .scrollIntoView() + .run() + ); + } + + return false; + }), // Deletes the current block if it's an empty block with inline content, // and moves the selection to the next block. () => From cec561fe749d64254bcb1f4d9b6a1873fb4c6620 Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Mon, 23 Feb 2026 21:57:51 +0100 Subject: [PATCH 5/6] Added tests --- tests/package.json | 4 +- .../keyboardhandlers/keyboardhandlers.test.ts | 164 ++++++++++++ .../deleteEndOfBlock-json-chromium-linux.json | 48 ++++ .../deleteEndOfBlock-json-firefox-linux.json | 48 ++++ .../deleteEndOfBlock-json-webkit-linux.json | 48 ++++ .../deleteImage-json-chromium-linux.json | 48 ++++ .../deleteImage-json-firefox-linux.json | 48 ++++ .../deleteImage-json-webkit-linux.json | 48 ++++ .../deleteImageChild-json-chromium-linux.json | 48 ++++ .../deleteImageChild-json-firefox-linux.json | 48 ++++ .../deleteImageChild-json-webkit-linux.json | 48 ++++ ...leteInlineContent-json-chromium-linux.json | 48 ++++ ...eleteInlineContent-json-firefox-linux.json | 48 ++++ ...deleteInlineContent-json-webkit-linux.json | 48 ++++ ...nlineContentChild-json-chromium-linux.json | 48 ++++ ...InlineContentChild-json-firefox-linux.json | 48 ++++ ...eInlineContentChild-json-webkit-linux.json | 48 ++++ ...eMultipleChildren-json-chromium-linux.json | 75 ++++++ ...teMultipleChildren-json-firefox-linux.json | 75 ++++++ ...eteMultipleChildren-json-webkit-linux.json | 75 ++++++ ...eteNestedChildren-json-chromium-linux.json | 75 ++++++ ...leteNestedChildren-json-firefox-linux.json | 75 ++++++ ...eleteNestedChildren-json-webkit-linux.json | 75 ++++++ ...leteSelectedImage-json-chromium-linux.json | 26 ++ ...eleteSelectedImage-json-firefox-linux.json | 26 ++ ...deleteSelectedImage-json-webkit-linux.json | 26 ++ .../deleteSelection-json-chromium-linux.json | 48 ++++ .../deleteSelection-json-firefox-linux.json | 48 ++++ .../deleteSelection-json-webkit-linux.json | 48 ++++ ...eteShallowerBlock-json-chromium-linux.json | 75 ++++++ ...leteShallowerBlock-json-firefox-linux.json | 75 ++++++ ...eleteShallowerBlock-json-webkit-linux.json | 75 ++++++ ...BlockWithChildren-json-chromium-linux.json | 97 +++++++ ...rBlockWithChildren-json-firefox-linux.json | 97 +++++++ ...erBlockWithChildren-json-webkit-linux.json | 97 +++++++ .../deleteTable-json-chromium-linux.json | 48 ++++ .../deleteTable-json-firefox-linux.json | 48 ++++ .../deleteTable-json-webkit-linux.json | 48 ++++ .../deleteTableChild-json-chromium-linux.json | 48 ++++ .../deleteTableChild-json-firefox-linux.json | 48 ++++ .../deleteTableChild-json-webkit-linux.json | 48 ++++ .../multicolumn/multicolumn.test.ts | 59 +++++ ...eleteBeforeColumn-json-chromium-linux.json | 217 ++++++++++++++++ ...deleteBeforeColumn-json-firefox-linux.json | 217 ++++++++++++++++ .../deleteBeforeColumn-json-webkit-linux.json | 217 ++++++++++++++++ ...eBeforeColumnList-json-chromium-linux.json | 208 +++++++++++++++ ...teBeforeColumnList-json-firefox-linux.json | 208 +++++++++++++++ ...eteBeforeColumnList-json-webkit-linux.json | 208 +++++++++++++++ ...mnWithSingleBlock-json-chromium-linux.json | 208 +++++++++++++++ ...umnWithSingleBlock-json-firefox-linux.json | 208 +++++++++++++++ ...lumnWithSingleBlock-json-webkit-linux.json | 208 +++++++++++++++ ...teEndOfColumnList-json-chromium-linux.json | 239 ++++++++++++++++++ ...eteEndOfColumnList-json-firefox-linux.json | 239 ++++++++++++++++++ ...leteEndOfColumnList-json-webkit-linux.json | 239 ++++++++++++++++++ tests/src/utils/const.ts | 4 + 55 files changed, 5041 insertions(+), 2 deletions(-) create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-webkit-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-chromium-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-firefox-linux.json create mode 100644 tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-webkit-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-chromium-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-firefox-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-webkit-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-chromium-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-firefox-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-webkit-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-chromium-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-firefox-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-webkit-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-chromium-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-firefox-linux.json create mode 100644 tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-webkit-linux.json diff --git a/tests/package.json b/tests/package.json index 66ae8d9ef7..e45fd76c82 100644 --- a/tests/package.json +++ b/tests/package.json @@ -5,9 +5,9 @@ "scripts": { "build": "tsc", "lint": "eslint src --max-warnings 0", - "playwright": "playwright test", + "playwright": "playwright test --ui", "test": "vitest --run", - "test:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -u", + "test:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test multicolumn -u", "test-ct": "playwright test -c playwright-ct.config.ts --headed", "test-ct:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -c playwright-ct.config.ts -u", "clean": "rimraf dist" diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts index 2fb1fa10cf..a3b7b0df6f 100644 --- a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts @@ -6,6 +6,7 @@ import { } from "../../utils/const.js"; import { insertHeading, insertParagraph } from "../../utils/copypaste.js"; import { compareDocToSnapshot, focusOnEditor } from "../../utils/editor.js"; +import { executeSlashCommand } from "../../utils/slashmenu.js"; test.describe.configure({ mode: "serial" }); @@ -171,6 +172,169 @@ test.describe("Check Keyboard Handlers' Behaviour", () => { "backspacePreservesNestedBlocksEmpty.json", ); }); + test("Check Delete at the end of a block", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteEndOfBlock.json"); + }); + test("Check Delete while selection not empty", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Shift+ArrowLeft"); + await page.keyboard.press("Shift+ArrowLeft"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteSelection.json"); + }); + test("Check Delete before inline content block", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteInlineContent.json"); + }); + test("Check Delete before image block", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await executeSlashCommand(page, "image"); + await page.keyboard.press("Escape"); // Close file panel + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteImage.json"); + }); + test("Check Delete before table", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await executeSlashCommand(page, "table"); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteTable.json"); + }); + test("Check Delete selected image block", async ({ page }) => { + await focusOnEditor(page); + await executeSlashCommand(page, "image"); + await page.keyboard.press("Escape"); // Close file panel + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteSelectedImage.json"); + }); + test("Check Delete end of block with inline content child", async ({ + page, + }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteInlineContentChild.json"); + }); + test("Check Delete end of block with image child", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await executeSlashCommand(page, "image"); + await page.keyboard.press("Escape"); // Close file panel + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteImageChild.json"); + }); + test("Check Delete end of block with table child", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await executeSlashCommand(page, "table"); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteTableChild.json"); + }); + test("Check Delete end of block with multiple children", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteMultipleChildren.json"); + }); + test("Check Delete end of block with nested children", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await page.keyboard.press("Tab"); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteNestedChildren.json"); + }); + test("Check Delete before shallower block", async ({ page }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ControlOrMeta+ArrowRight"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteShallowerBlock.json"); + }); + test("Check Delete before shallower block with children", async ({ + page, + }) => { + await focusOnEditor(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + await insertParagraph(page); + await page.keyboard.press("Tab"); + await insertParagraph(page); + + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("ArrowUp"); + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteShallowerBlockWithChildren.json"); + }); test("Check heading 1 shortcut", async ({ page }) => { await focusOnEditor(page); await page.keyboard.type("Paragraph"); diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-chromium-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-firefox-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-webkit-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteEndOfBlock-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-chromium-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-firefox-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-webkit-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImage-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-chromium-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-firefox-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-webkit-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteImageChild-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-chromium-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-firefox-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-webkit-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContent-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-chromium-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-firefox-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-webkit-linux.json new file mode 100644 index 0000000000..4438e21e1b --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteInlineContentChild-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-chromium-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-chromium-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-firefox-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-firefox-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-webkit-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteMultipleChildren-json-webkit-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-chromium-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-chromium-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-firefox-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-firefox-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-webkit-linux.json new file mode 100644 index 0000000000..f72b0fbf4e --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteNestedChildren-json-webkit-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-chromium-linux.json new file mode 100644 index 0000000000..f56b777a4c --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-chromium-linux.json @@ -0,0 +1,26 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-firefox-linux.json new file mode 100644 index 0000000000..f56b777a4c --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-firefox-linux.json @@ -0,0 +1,26 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-webkit-linux.json new file mode 100644 index 0000000000..f56b777a4c --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelectedImage-json-webkit-linux.json @@ -0,0 +1,26 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-chromium-linux.json new file mode 100644 index 0000000000..700034dfb4 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragra" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-firefox-linux.json new file mode 100644 index 0000000000..700034dfb4 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragra" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-webkit-linux.json new file mode 100644 index 0000000000..700034dfb4 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteSelection-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragra" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-chromium-linux.json new file mode 100644 index 0000000000..22781307e7 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-chromium-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-firefox-linux.json new file mode 100644 index 0000000000..22781307e7 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-firefox-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-webkit-linux.json new file mode 100644 index 0000000000..22781307e7 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlock-json-webkit-linux.json @@ -0,0 +1,75 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-chromium-linux.json new file mode 100644 index 0000000000..e59aeeca33 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-chromium-linux.json @@ -0,0 +1,97 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "4" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-firefox-linux.json new file mode 100644 index 0000000000..e59aeeca33 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-firefox-linux.json @@ -0,0 +1,97 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "4" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-webkit-linux.json new file mode 100644 index 0000000000..e59aeeca33 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteShallowerBlockWithChildren-json-webkit-linux.json @@ -0,0 +1,97 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + }, + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "ParagraphParagraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "4" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-chromium-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-firefox-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-webkit-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTable-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-chromium-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-chromium-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-chromium-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-firefox-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-firefox-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-firefox-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-webkit-linux.json b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-webkit-linux.json new file mode 100644 index 0000000000..cb66bb0c92 --- /dev/null +++ b/tests/src/end-to-end/keyboardhandlers/keyboardhandlers.test.ts-snapshots/deleteTableChild-json-webkit-linux.json @@ -0,0 +1,48 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "2" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts b/tests/src/end-to-end/multicolumn/multicolumn.test.ts new file mode 100644 index 0000000000..945eafc3a0 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts @@ -0,0 +1,59 @@ +import { test } from "../../setup/setupScript.js"; +import { + BULLET_LIST_SELECTOR, + H_ONE_BLOCK_SELECTOR, + MULTI_COLUMN_URL, +} from "../../utils/const.js"; +import { compareDocToSnapshot, focusOnEditor } from "../../utils/editor.js"; + +test.describe.configure({ mode: "serial" }); + +test.beforeEach(async ({ page }) => { + await page.goto(MULTI_COLUMN_URL); +}); + +test.describe("Check Multi-Column Behaviour", () => { + test("Check Delete before column", async ({ page }) => { + await focusOnEditor(page); + + await page.click(H_ONE_BLOCK_SELECTOR); + await page.keyboard.press("ArrowRight"); + await page.keyboard.press("ArrowRight"); + await page.keyboard.press("ArrowRight"); + + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteBeforeColumn.json"); + }); + test("Check Delete before column with single block", async ({ page }) => { + await focusOnEditor(page); + + await page.locator(".bn-block-column").first().click(); + + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteBeforeColumnWithSingleBlock.json"); + }); + test("Check Delete before column list", async ({ page }) => { + await focusOnEditor(page); + + await page.locator(".bn-block-content").first().click(); + + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteBeforeColumnList.json"); + }); + test("Check Delete end of column list", async ({ page }) => { + await focusOnEditor(page); + + await page.locator(BULLET_LIST_SELECTOR).last().click(); + await page.keyboard.press("ArrowDown"); + await page.keyboard.type("Paragraph"); + await page.keyboard.press("ControlOrMeta+ArrowLeft"); + await page.keyboard.press("ArrowLeft"); + + await page.keyboard.press("Delete"); + + await compareDocToSnapshot(page, "deleteEndOfColumnList.json"); + }); +}); diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-chromium-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-chromium-linux.json new file mode 100644 index 0000000000..119bed4892 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-chromium-linux.json @@ -0,0 +1,217 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-firefox-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-firefox-linux.json new file mode 100644 index 0000000000..119bed4892 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-firefox-linux.json @@ -0,0 +1,217 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-webkit-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-webkit-linux.json new file mode 100644 index 0000000000..119bed4892 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumn-json-webkit-linux.json @@ -0,0 +1,217 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-chromium-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-chromium-linux.json new file mode 100644 index 0000000000..339cc68dbc --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-chromium-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-firefox-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-firefox-linux.json new file mode 100644 index 0000000000..339cc68dbc --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-firefox-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-webkit-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-webkit-linux.json new file mode 100644 index 0000000000..339cc68dbc --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnList-json-webkit-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-chromium-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-chromium-linux.json new file mode 100644 index 0000000000..888b0d14fd --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-chromium-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-firefox-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-firefox-linux.json new file mode 100644 index 0000000000..888b0d14fd --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-firefox-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-webkit-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-webkit-linux.json new file mode 100644 index 0000000000..888b0d14fd --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteBeforeColumnWithSingleBlock-json-webkit-linux.json @@ -0,0 +1,208 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-chromium-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-chromium-linux.json new file mode 100644 index 0000000000..e41128a4b1 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-chromium-linux.json @@ -0,0 +1,239 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "12" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-firefox-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-firefox-linux.json new file mode 100644 index 0000000000..e41128a4b1 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-firefox-linux.json @@ -0,0 +1,239 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "12" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-webkit-linux.json b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-webkit-linux.json new file mode 100644 index 0000000000..e41128a4b1 --- /dev/null +++ b/tests/src/end-to-end/multicolumn/multicolumn.test.ts-snapshots/deleteEndOfColumnList-json-webkit-linux.json @@ -0,0 +1,239 @@ +{ + "type": "doc", + "content": [ + { + "type": "blockGroup", + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "0" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Welcome to this demo!" + } + ] + } + ] + }, + { + "type": "columnList", + "attrs": { + "id": "1" + }, + "content": [ + { + "type": "column", + "attrs": { + "id": "2", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "3" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "This paragraph is in a column!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "4", + "width": 1.4 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "5" + }, + "content": [ + { + "type": "heading", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left", + "level": 1, + "isToggleable": false + }, + "content": [ + { + "type": "text", + "text": "So is this heading!" + } + ] + } + ] + } + ] + }, + { + "type": "column", + "attrs": { + "id": "6", + "width": 0.8 + }, + "content": [ + { + "type": "blockContainer", + "attrs": { + "id": "7" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "You can have multiple blocks in a column too" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "8" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 1" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "9" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 2" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "10" + }, + "content": [ + { + "type": "bulletListItem", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Block 3" + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "11" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + }, + "content": [ + { + "type": "text", + "text": "Paragraph" + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "blockContainer", + "attrs": { + "id": "12" + }, + "content": [ + { + "type": "paragraph", + "attrs": { + "backgroundColor": "default", + "textColor": "default", + "textAlignment": "left" + } + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tests/src/utils/const.ts b/tests/src/utils/const.ts index 79b21b16ee..2cdef41532 100644 --- a/tests/src/utils/const.ts +++ b/tests/src/utils/const.ts @@ -11,6 +11,10 @@ export const ARIAKIT_URL = !process.env.RUN_IN_DOCKER ? `http://localhost:${PORT}/basic/ariakit?hideMenu` : `http://host.docker.internal:${PORT}/basic/ariakit?hideMenu`; +export const MULTI_COLUMN_URL = !process.env.RUN_IN_DOCKER + ? `http://localhost:${PORT}/basic/multi-column?hideMenu` + : `http://host.docker.internal:${PORT}/basic/multi-column?hideMenu`; + export const STATIC_URL = !process.env.RUN_IN_DOCKER ? `http://localhost:${PORT}/backend/rendering-static-documents?hideMenu` : `http://host.docker.internal:${PORT}/backend/rendering-static-documents?hideMenu`; From 2eac48ff53a0e4c3e2b6dfcaae36ac77bdea4fea Mon Sep 17 00:00:00 2001 From: Matthew Lipski Date: Tue, 24 Feb 2026 12:06:56 +0100 Subject: [PATCH 6/6] Implemented PR feedback --- .../commands/mergeBlocks/mergeBlocks.ts | 19 +++++++++---------- .../KeyboardShortcutsExtension.ts | 11 +---------- tests/package.json | 4 ++-- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts index 96b801335c..2c397c153f 100644 --- a/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts +++ b/packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts @@ -10,25 +10,24 @@ import { * Returns the block info from the parent block * or undefined if we're at the root */ -export const getParentBlockInfo = (doc: Node, beforePos: number) => { +export const getParentBlockInfo = (doc: Node, beforePos: number): BlockInfo | undefined => { const $pos = doc.resolve(beforePos); + const depth = $pos.depth - 1; + const parentBeforePos = $pos.before(depth); + const parentNode = doc.resolve(parentBeforePos).nodeAfter; - if ($pos.depth <= 1) { + if (!parentNode) { return undefined; } - // get start pos of parent - const parentBeforePos = $pos.posAtIndex( - // TODO: This works for blockContainer nodes as we need to traverse 2 - // nesting levels due to the blockGroup in between. However, that's not the - // case for columns. - $pos.index($pos.depth - 2), - $pos.depth - 2, - ); + if (!parentNode.type.spec.group?.includes("bnBlock")) { + return getParentBlockInfo(doc, parentBeforePos); + } const parentBlockInfo = getBlockInfoFromResolvedPos( doc.resolve(parentBeforePos), ); + return parentBlockInfo; }; diff --git a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts index e13696fd3b..d0c7751fa0 100644 --- a/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +++ b/packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts @@ -705,7 +705,6 @@ export const KeyboardShortcutsExtension = Extension.create<{ nextBlockInfo.blockContent.node.childCount === 0); if (nextBlockNotTableAndNoContent) { - if (nextBlockInfo.bnBlock.node.childCount === 2) { const childBlocks = nextBlockInfo.bnBlock.node.lastChild!.content; return chain() @@ -713,16 +712,8 @@ export const KeyboardShortcutsExtension = Extension.create<{ from: nextBlockInfo.bnBlock.beforePos, to: nextBlockInfo.bnBlock.afterPos, }) - .insertContentAt(blockInfo.bnBlock.afterPos, childBlocks) + .insertContentAt(blockInfo.bnBlock.afterPos, nextBlockInfo.bnBlock.node.childCount === 2 ? childBlocks : null) .run(); - } - - return chain() - .deleteRange({ - from: nextBlockInfo.bnBlock.beforePos, - to: nextBlockInfo.bnBlock.afterPos, - }) - .run(); } } diff --git a/tests/package.json b/tests/package.json index e45fd76c82..66ae8d9ef7 100644 --- a/tests/package.json +++ b/tests/package.json @@ -5,9 +5,9 @@ "scripts": { "build": "tsc", "lint": "eslint src --max-warnings 0", - "playwright": "playwright test --ui", + "playwright": "playwright test", "test": "vitest --run", - "test:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test multicolumn -u", + "test:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -u", "test-ct": "playwright test -c playwright-ct.config.ts --headed", "test-ct:updateSnaps": "docker run --rm -e RUN_IN_DOCKER=true --network host -v $(pwd)/..:/work/ -w /work/tests -it mcr.microsoft.com/playwright:v1.51.1-noble npx playwright test -c playwright-ct.config.ts -u", "clean": "rimraf dist"