@ckeditor/ckeditor5-paragraph 33.0.0 → 34.0.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/README.md CHANGED
@@ -3,7 +3,8 @@ CKEditor 5 paragraph feature
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-paragraph.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-paragraph)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
- [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
6
+ [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
7
+ ![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-paragraph)
7
8
 
8
9
  This package implements paragraph support for CKEditor 5.
9
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-paragraph",
3
- "version": "33.0.0",
3
+ "version": "34.0.0",
4
4
  "description": "Paragraph feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,20 +12,20 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "^33.0.0",
16
- "@ckeditor/ckeditor5-ui": "^33.0.0",
17
- "@ckeditor/ckeditor5-utils": "^33.0.0"
15
+ "@ckeditor/ckeditor5-core": "^34.0.0",
16
+ "@ckeditor/ckeditor5-ui": "^34.0.0",
17
+ "@ckeditor/ckeditor5-utils": "^34.0.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@ckeditor/ckeditor5-basic-styles": "^33.0.0",
21
- "@ckeditor/ckeditor5-clipboard": "^33.0.0",
22
- "@ckeditor/ckeditor5-editor-classic": "^33.0.0",
23
- "@ckeditor/ckeditor5-engine": "^33.0.0",
24
- "@ckeditor/ckeditor5-enter": "^33.0.0",
25
- "@ckeditor/ckeditor5-heading": "^33.0.0",
26
- "@ckeditor/ckeditor5-link": "^33.0.0",
27
- "@ckeditor/ckeditor5-typing": "^33.0.0",
28
- "@ckeditor/ckeditor5-undo": "^33.0.0"
20
+ "@ckeditor/ckeditor5-basic-styles": "^34.0.0",
21
+ "@ckeditor/ckeditor5-clipboard": "^34.0.0",
22
+ "@ckeditor/ckeditor5-editor-classic": "^34.0.0",
23
+ "@ckeditor/ckeditor5-engine": "^34.0.0",
24
+ "@ckeditor/ckeditor5-enter": "^34.0.0",
25
+ "@ckeditor/ckeditor5-heading": "^34.0.0",
26
+ "@ckeditor/ckeditor5-link": "^34.0.0",
27
+ "@ckeditor/ckeditor5-typing": "^34.0.0",
28
+ "@ckeditor/ckeditor5-undo": "^34.0.0"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=14.0.0",
@@ -33,15 +33,22 @@ export default class InsertParagraphCommand extends Command {
33
33
  * @param {Object} options Options for the executed command.
34
34
  * @param {module:engine/model/position~Position} options.position The model position at which
35
35
  * the new paragraph will be inserted.
36
+ * @param {Object} attributes Attributes keys and values to set on a inserted paragraph
36
37
  * @fires execute
37
38
  */
38
39
  execute( options ) {
39
40
  const model = this.editor.model;
41
+ const attributes = options.attributes;
42
+
40
43
  let position = options.position;
41
44
 
42
45
  model.change( writer => {
43
46
  const paragraph = writer.createElement( 'paragraph' );
44
47
 
48
+ if ( attributes ) {
49
+ model.schema.setAllowedAttributes( paragraph, attributes, writer );
50
+ }
51
+
45
52
  if ( !model.schema.checkChild( position.parent, paragraph ) ) {
46
53
  const allowedParent = model.schema.findAllowedParent( position, paragraph );
47
54