@ckeditor/ckeditor5-paragraph 41.3.0-alpha.4 → 41.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -5
- package/dist/content-index.css +0 -4
- package/dist/editor-index.css +0 -4
- package/dist/index.css +0 -4
- package/dist/types/augmentation.d.ts +0 -18
- package/dist/types/index.d.ts +0 -16
- package/dist/types/insertparagraphcommand.d.ts +0 -49
- package/dist/types/paragraph.d.ts +0 -65
- package/dist/types/paragraphbuttonui.d.ts +0 -40
- package/dist/types/paragraphcommand.d.ts +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-paragraph",
|
|
3
|
-
"version": "41.3.0
|
|
3
|
+
"version": "41.3.0",
|
|
4
4
|
"description": "Paragraph feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-core": "41.3.0
|
|
17
|
-
"@ckeditor/ckeditor5-ui": "41.3.0
|
|
18
|
-
"@ckeditor/ckeditor5-utils": "41.3.0
|
|
16
|
+
"@ckeditor/ckeditor5-core": "41.3.0",
|
|
17
|
+
"@ckeditor/ckeditor5-ui": "41.3.0",
|
|
18
|
+
"@ckeditor/ckeditor5-utils": "41.3.0"
|
|
19
19
|
},
|
|
20
20
|
"author": "CKSource (http://cksource.com/)",
|
|
21
21
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"directory": "packages/ckeditor5-paragraph"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
|
-
"dist",
|
|
31
30
|
"lang",
|
|
32
31
|
"src/**/*.js",
|
|
33
32
|
"src/**/*.d.ts",
|
package/dist/content-index.css
DELETED
package/dist/editor-index.css
DELETED
package/dist/index.css
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
import type { Paragraph, ParagraphCommand, InsertParagraphCommand } from './index.js';
|
|
10
|
-
declare module '@ckeditor/ckeditor5-core' {
|
|
11
|
-
interface CommandsMap {
|
|
12
|
-
insertParagraph: InsertParagraphCommand;
|
|
13
|
-
paragraph: ParagraphCommand;
|
|
14
|
-
}
|
|
15
|
-
interface PluginsMap {
|
|
16
|
-
[Paragraph.pluginName]: Paragraph;
|
|
17
|
-
}
|
|
18
|
-
}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module paragraph
|
|
11
|
-
*/
|
|
12
|
-
export { default as Paragraph } from './paragraph.js';
|
|
13
|
-
export { default as ParagraphButtonUI } from './paragraphbuttonui.js';
|
|
14
|
-
export type { default as ParagraphCommand } from './paragraphcommand.js';
|
|
15
|
-
export type { default as InsertParagraphCommand } from './insertparagraphcommand.js';
|
|
16
|
-
import './augmentation.js';
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module paragraph/insertparagraphcommand
|
|
11
|
-
*/
|
|
12
|
-
import { Command, type Editor } from '@ckeditor/ckeditor5-core';
|
|
13
|
-
import type { Position } from '@ckeditor/ckeditor5-engine';
|
|
14
|
-
/**
|
|
15
|
-
* The insert paragraph command. It inserts a new paragraph at a specific
|
|
16
|
-
* {@link module:engine/model/position~Position document position}.
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* // Insert a new paragraph before an element in the document.
|
|
20
|
-
* editor.execute( 'insertParagraph', {
|
|
21
|
-
* position: editor.model.createPositionBefore( element )
|
|
22
|
-
* } );
|
|
23
|
-
* ```
|
|
24
|
-
*
|
|
25
|
-
* If a paragraph is disallowed in the context of the specific position, the command
|
|
26
|
-
* will attempt to split position ancestors to find a place where it is possible
|
|
27
|
-
* to insert a paragraph.
|
|
28
|
-
*
|
|
29
|
-
* **Note**: This command moves the selection to the inserted paragraph.
|
|
30
|
-
*/
|
|
31
|
-
export default class InsertParagraphCommand extends Command {
|
|
32
|
-
constructor(editor: Editor);
|
|
33
|
-
/**
|
|
34
|
-
* Executes the command.
|
|
35
|
-
*
|
|
36
|
-
* @param options Options for the executed command.
|
|
37
|
-
* @param options.position The model position at which the new paragraph will be inserted.
|
|
38
|
-
* @param options.attributes Attributes keys and values to set on a inserted paragraph.
|
|
39
|
-
* @fires execute
|
|
40
|
-
*/
|
|
41
|
-
execute(options: {
|
|
42
|
-
position: Position;
|
|
43
|
-
attributes?: Record<string, unknown>;
|
|
44
|
-
}): void;
|
|
45
|
-
/**
|
|
46
|
-
* Returns the best position to insert a new paragraph.
|
|
47
|
-
*/
|
|
48
|
-
private _findPositionToInsertParagraph;
|
|
49
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
10
|
-
/**
|
|
11
|
-
* The paragraph feature for the editor.
|
|
12
|
-
*
|
|
13
|
-
* It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.
|
|
14
|
-
*
|
|
15
|
-
* It also brings two editors commands:
|
|
16
|
-
*
|
|
17
|
-
* * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all
|
|
18
|
-
* blocks in the model selection into paragraphs.
|
|
19
|
-
* * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command
|
|
20
|
-
* that inserts a new paragraph at a specified location in the model.
|
|
21
|
-
*/
|
|
22
|
-
export default class Paragraph extends Plugin {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get pluginName(): "Paragraph";
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
init(): void;
|
|
31
|
-
/**
|
|
32
|
-
* A list of element names which should be treated by the autoparagraphing algorithms as
|
|
33
|
-
* paragraph-like. This means that e.g. the following content:
|
|
34
|
-
*
|
|
35
|
-
* ```html
|
|
36
|
-
* <h1>Foo</h1>
|
|
37
|
-
* <table>
|
|
38
|
-
* <tr>
|
|
39
|
-
* <td>X</td>
|
|
40
|
-
* <td>
|
|
41
|
-
* <ul>
|
|
42
|
-
* <li>Y</li>
|
|
43
|
-
* <li>Z</li>
|
|
44
|
-
* </ul>
|
|
45
|
-
* </td>
|
|
46
|
-
* </tr>
|
|
47
|
-
* </table>
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.
|
|
51
|
-
* Hence, if none of the features is going to convert those elements the above content will be automatically handled
|
|
52
|
-
* by the paragraph feature and converted to:
|
|
53
|
-
*
|
|
54
|
-
* ```html
|
|
55
|
-
* <p>Foo</p>
|
|
56
|
-
* <p>X</p>
|
|
57
|
-
* <p>Y</p>
|
|
58
|
-
* <p>Z</p>
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements
|
|
62
|
-
* have a priority upon conversion.
|
|
63
|
-
*/
|
|
64
|
-
static paragraphLikeElements: Set<string>;
|
|
65
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module paragraph/paragraphbuttonui
|
|
11
|
-
*/
|
|
12
|
-
import { Plugin } from '@ckeditor/ckeditor5-core';
|
|
13
|
-
import Paragraph from './paragraph.js';
|
|
14
|
-
/**
|
|
15
|
-
* This plugin defines the `'paragraph'` button. It can be used together with
|
|
16
|
-
* {@link module:heading/headingbuttonsui~HeadingButtonsUI} to replace the standard heading dropdown.
|
|
17
|
-
*
|
|
18
|
-
* This plugin is not loaded automatically by the {@link module:paragraph/paragraph~Paragraph} plugin. It must
|
|
19
|
-
* be added manually.
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* ClassicEditor
|
|
23
|
-
* .create( {
|
|
24
|
-
* plugins: [ ..., Heading, Paragraph, HeadingButtonsUI, ParagraphButtonUI ]
|
|
25
|
-
* toolbar: [ 'paragraph', 'heading1', 'heading2', 'heading3' ]
|
|
26
|
-
* } )
|
|
27
|
-
* .then( ... )
|
|
28
|
-
* .catch( ... );
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export default class ParagraphButtonUI extends Plugin {
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
static get requires(): readonly [typeof Paragraph];
|
|
36
|
-
/**
|
|
37
|
-
* @inheritDoc
|
|
38
|
-
*/
|
|
39
|
-
init(): void;
|
|
40
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module paragraph/paragraphcommand
|
|
11
|
-
*/
|
|
12
|
-
import { Command, type Editor } from '@ckeditor/ckeditor5-core';
|
|
13
|
-
import type { Selection, DocumentSelection } from '@ckeditor/ckeditor5-engine';
|
|
14
|
-
/**
|
|
15
|
-
* The paragraph command.
|
|
16
|
-
*/
|
|
17
|
-
export default class ParagraphCommand extends Command {
|
|
18
|
-
constructor(editor: Editor);
|
|
19
|
-
/**
|
|
20
|
-
* The value of the command. Indicates whether the selection start is placed in a paragraph.
|
|
21
|
-
*
|
|
22
|
-
* @readonly
|
|
23
|
-
* @observable
|
|
24
|
-
*/
|
|
25
|
-
value: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
refresh(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection
|
|
32
|
-
* will be turned to paragraphs.
|
|
33
|
-
*
|
|
34
|
-
* @fires execute
|
|
35
|
-
* @param options Options for the executed command.
|
|
36
|
-
* @param options.selection The selection that the command should be applied to. By default,
|
|
37
|
-
* if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.
|
|
38
|
-
*/
|
|
39
|
-
execute(options?: {
|
|
40
|
-
selection?: Selection | DocumentSelection;
|
|
41
|
-
}): void;
|
|
42
|
-
}
|