UNPKG

1.29 kBTypeScriptView Raw
1import { Plugin } from '@ckeditor/ckeditor5-core';
2import InsertParagraphCommand from './insertparagraphcommand';
3import ParagraphCommand from './paragraphcommand';
4
5/**
6 * The paragraph feature for the editor.
7 *
8 * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
9 *
10 * It also brings two editors commands:
11 *
12 * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
13 * blocks in the model selection into paragraphs.
14 * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
15 * that inserts a new paragraph at a specified location in the model.
16 */
17export default class Paragraph extends Plugin {
18 static readonly pluginName: 'Paragraph';
19 static paragraphLikeElements: Set<
20 'blockquote' | 'dd' | 'div' | 'dt' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'li' | 'p' | 'td' | 'th'
21 >;
22 init(): void;
23}
24
25declare module '@ckeditor/ckeditor5-core/src/plugincollection' {
26 interface Plugins {
27 Paragraph: Paragraph;
28 }
29}
30
31declare module '@ckeditor/ckeditor5-core/src/commandcollection' {
32 interface Commands {
33 paragraph: ParagraphCommand;
34 insertParagraph: InsertParagraphCommand;
35 }
36}