(editor: Editor, blockEntry: NodeEntry<Indent>, size: number)
| 2 | import { Indent } from './interfaces/indent' |
| 3 | |
| 4 | export const setTextIndent = (editor: Editor, blockEntry: NodeEntry<Indent>, size: number) => { |
| 5 | const [block, path] = blockEntry |
| 6 | const textIndent = block.textIndent ?? 0 |
| 7 | const lineIndent = block.lineIndent ?? 0 |
| 8 | const indent = Math.max(textIndent + size, 0) |
| 9 | if (size < 0 && textIndent === 0 && lineIndent > 0) { |
| 10 | setLineIndent(editor, [block, path], size) |
| 11 | return |
| 12 | } |
| 13 | Transforms.setNodes<Indent>(editor, { textIndent: indent }, { at: path }) |
| 14 | } |
| 15 | |
| 16 | export const setLineIndent = (editor: Editor, blockEntry: NodeEntry<Indent>, size: number) => { |
| 17 | const [block, path] = blockEntry |
no test coverage detected
searching dependent graphs…