@ckeditor/ckeditor5-engine
Advanced tools
Comparing version 19.0.0 to 19.0.1
{ | ||
"name": "@ckeditor/ckeditor5-engine", | ||
"version": "19.0.0", | ||
"version": "19.0.1", | ||
"description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.", | ||
@@ -24,27 +24,21 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-utils": "^19.0.0", | ||
"@ckeditor/ckeditor5-utils": "^19.0.1", | ||
"lodash-es": "^4.17.10" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^19.0.0", | ||
"@ckeditor/ckeditor5-block-quote": "^19.0.0", | ||
"@ckeditor/ckeditor5-core": "^19.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^19.0.0", | ||
"@ckeditor/ckeditor5-enter": "^19.0.0", | ||
"@ckeditor/ckeditor5-essentials": "^19.0.0", | ||
"@ckeditor/ckeditor5-heading": "^19.0.0", | ||
"@ckeditor/ckeditor5-link": "^19.0.0", | ||
"@ckeditor/ckeditor5-list": "^19.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^19.0.0", | ||
"@ckeditor/ckeditor5-table": "^19.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^19.0.0", | ||
"@ckeditor/ckeditor5-typing": "^19.0.0", | ||
"@ckeditor/ckeditor5-undo": "^19.0.0", | ||
"@ckeditor/ckeditor5-widget": "^19.0.0", | ||
"eslint": "^5.5.0", | ||
"eslint-config-ckeditor5": "^2.0.0", | ||
"husky": "^1.3.1", | ||
"lint-staged": "^7.0.0", | ||
"stylelint": "^11.1.1", | ||
"stylelint-config-ckeditor5": "^1.0.0" | ||
"@ckeditor/ckeditor5-basic-styles": "^19.0.1", | ||
"@ckeditor/ckeditor5-block-quote": "^19.0.1", | ||
"@ckeditor/ckeditor5-core": "^19.0.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^19.0.1", | ||
"@ckeditor/ckeditor5-enter": "^19.0.1", | ||
"@ckeditor/ckeditor5-essentials": "^19.0.1", | ||
"@ckeditor/ckeditor5-heading": "^19.0.1", | ||
"@ckeditor/ckeditor5-link": "^19.0.1", | ||
"@ckeditor/ckeditor5-list": "^19.0.1", | ||
"@ckeditor/ckeditor5-paragraph": "^19.1.0", | ||
"@ckeditor/ckeditor5-table": "^19.1.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^19.1.0", | ||
"@ckeditor/ckeditor5-typing": "^19.0.1", | ||
"@ckeditor/ckeditor5-undo": "^19.0.1", | ||
"@ckeditor/ckeditor5-widget": "^19.1.0" | ||
}, | ||
@@ -61,3 +55,4 @@ "engines": { | ||
"type": "git", | ||
"url": "https://github.com/ckeditor/ckeditor5-engine.git" | ||
"url": "https://github.com/ckeditor/ckeditor5.git", | ||
"directory": "packages/ckeditor5-engine" | ||
}, | ||
@@ -68,24 +63,3 @@ "files": [ | ||
"theme" | ||
], | ||
"scripts": { | ||
"lint": "eslint --quiet '**/*.js'", | ||
"stylelint": "stylelint --quiet --allow-empty-input 'theme/**/*.css' 'docs/**/*.css'" | ||
}, | ||
"lint-staged": { | ||
"**/*.js": [ | ||
"eslint --quiet" | ||
], | ||
"**/*.css": [ | ||
"stylelint --quiet --allow-empty-input" | ||
] | ||
}, | ||
"eslintIgnore": [ | ||
"src/lib/**", | ||
"packages/**" | ||
], | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "lint-staged" | ||
} | ||
} | ||
] | ||
} |
@@ -5,5 +5,2 @@ CKEditor 5 editing engine | ||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-engine.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-engine) | ||
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-engine.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-engine) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-engine/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-engine?branch=master) | ||
<br> | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-engine/status.svg)](https://david-dm.org/ckeditor/ckeditor5-engine) | ||
@@ -10,0 +7,0 @@ [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-engine/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-engine?type=dev) |
@@ -373,9 +373,24 @@ /** | ||
* | ||
* If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` | ||
* it will be moved to the target position (where the document selection should be moved after the insertion). | ||
* If you want the document selection to be moved to the inserted content, use the | ||
* {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting | ||
* the content: | ||
* | ||
* editor.model.change( writer => { | ||
* // Insert text replacing the given selection instance. | ||
* const paragraph = writer.createElement( 'paragraph' ); | ||
* | ||
* // Insert an empty paragraph at the beginning of the root. | ||
* editor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) ); | ||
* | ||
* // Move the document selection to the inserted paragraph. | ||
* writer.setSelection( paragraph, 'in' ); | ||
* } ); | ||
* | ||
* If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`, | ||
* the new content will be inserted at the passed selection (instead of document selection): | ||
* | ||
* editor.model.change( writer => { | ||
* // Create a selection in a paragraph that will be used as a place of insertion. | ||
* const selection = writer.createSelection( paragraph, 'in' ); | ||
* | ||
* // Insert the new text at the created selection. | ||
* editor.model.insertContent( writer.createText( 'x' ), selection ); | ||
@@ -382,0 +397,0 @@ * |
@@ -156,4 +156,9 @@ /** | ||
/** | ||
* Returns all registered items. | ||
* Returns data of all registered items. | ||
* | ||
* This method should normally be used for reflection purposes (e.g. defining a clone of a certain element, | ||
* checking a list of all block elements, etc). | ||
* Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`}) | ||
* in other cases. | ||
* | ||
* @returns {Object.<String,module:engine/model/schema~SchemaCompiledItemDefinition>} | ||
@@ -172,2 +177,7 @@ */ | ||
* | ||
* This method should normally be used for reflection purposes (e.g. defining a clone of a certain element, | ||
* checking a list of all block elements, etc). | ||
* Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`}) | ||
* in other cases. | ||
* | ||
* @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item | ||
@@ -215,2 +225,5 @@ * @returns {module:engine/model/schema~SchemaCompiledItemDefinition} | ||
* | ||
* See the {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the "Schema" deep dive} | ||
* guide for more details. | ||
* | ||
* @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item | ||
@@ -225,6 +238,10 @@ */ | ||
/** | ||
* Returns `true` if the given item is defined to be | ||
* a limit element by {@link module:engine/model/schema~SchemaItemDefinition}'s `isLimit` or `isObject` property | ||
* (all objects are also limits). | ||
* Returns `true` if the given item should be treated as a limit element. | ||
* | ||
* It considers the item to be a limit element if its | ||
* {@link module:engine/model/schema~SchemaItemDefinition}'s | ||
* {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or | ||
* {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property | ||
* were set to `true`. | ||
* | ||
* schema.isLimit( 'paragraph' ); // -> false | ||
@@ -235,2 +252,5 @@ * schema.isLimit( '$root' ); // -> true | ||
* | ||
* See the {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the "Schema" deep dive} | ||
* guide for more details. | ||
* | ||
* @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item | ||
@@ -249,5 +269,9 @@ */ | ||
/** | ||
* Returns `true` if the given item is defined to be | ||
* an object element by {@link module:engine/model/schema~SchemaItemDefinition}'s `isObject` property. | ||
* Returns `true` if the given item is should be treated as an object element. | ||
* | ||
* It considers the item to be an object element if its | ||
* {@link module:engine/model/schema~SchemaItemDefinition}'s | ||
* {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property | ||
* were set to `true`. | ||
* | ||
* schema.isObject( 'paragraph' ); // -> false | ||
@@ -259,2 +283,5 @@ * schema.isObject( 'image' ); // -> true | ||
* | ||
* See the {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the "Schema" deep dive} | ||
* guide for more details. | ||
* | ||
* @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item | ||
@@ -278,2 +305,5 @@ */ | ||
* | ||
* See the {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the "Schema" deep dive} | ||
* guide for more details. | ||
* | ||
* @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item | ||
@@ -723,4 +753,4 @@ */ | ||
* | ||
* @params {module:engine/model/position~Position} position Position from searching will start. | ||
* @params {module:engine/model/node~Node|String} node Node for which allowed parent should be found or its name. | ||
* @param {module:engine/model/position~Position} position Position from searching will start. | ||
* @param {module:engine/model/node~Node|String} node Node for which allowed parent should be found or its name. | ||
* @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found. | ||
@@ -976,3 +1006,3 @@ */ | ||
* const context = args[ 0 ]; | ||
* const atributeName = args[ 1 ]; | ||
* const attributeName = args[ 1 ]; | ||
* | ||
@@ -993,3 +1023,3 @@ * if ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) { | ||
* const context = args[ 0 ]; | ||
* const atributeName = args[ 1 ]; | ||
* const attributeName = args[ 1 ]; | ||
* | ||
@@ -1013,29 +1043,31 @@ * if ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) { | ||
* | ||
* * `allowIn` – A string or an array of strings. Defines in which other items this item will be allowed. | ||
* * `allowAttributes` – A string or an array of strings. Defines allowed attributes of the given item. | ||
* * `allowContentOf` – A string or an array of strings. Inherits "allowed children" from other items. | ||
* * `allowWhere` – A string or an array of strings. Inherits "allowed in" from other items. | ||
* * `allowAttributesOf` – A string or an array of strings. Inherits attributes from other items. | ||
* * `inheritTypesFrom` – A string or an array of strings. Inherits `is*` properties of other items. | ||
* * `inheritAllFrom` – A string. A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`. | ||
* * Additionally, you can define the following `is*` properties: `isBlock`, `isLimit`, `isObject`, `isInline`. Read about them below. | ||
* * {@link ~SchemaItemDefinition#allowIn `allowIn`} – Defines in which other items this item will be allowed. | ||
* * {@link ~SchemaItemDefinition#allowAttributes `allowAttributes`} – Defines allowed attributes of the given item. | ||
* * {@link ~SchemaItemDefinition#allowContentOf `allowContentOf`} – Inherits "allowed children" from other items. | ||
* * {@link ~SchemaItemDefinition#allowWhere `allowWhere`} – Inherits "allowed in" from other items. | ||
* * {@link ~SchemaItemDefinition#allowAttributesOf `allowAttributesOf`} – Inherits attributes from other items. | ||
* * {@link ~SchemaItemDefinition#inheritTypesFrom `inheritTypesFrom`} – Inherits `is*` properties of other items. | ||
* * {@link ~SchemaItemDefinition#inheritAllFrom `inheritAllFrom`} – | ||
* A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`. | ||
* | ||
* # The is* properties | ||
* # The `is*` properties | ||
* | ||
* There are 3 commonly used `is*` properties. Their role is to assign additional semantics to schema items. | ||
* There are a couple commonly used `is*` properties. Their role is to assign additional semantics to schema items. | ||
* You can define more properties but you will also need to implement support for them in the existing editor features. | ||
* | ||
* * `isBlock` – Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks | ||
* like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block | ||
* should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`. | ||
* Most block type items will inherit from `$block` (through `inheritAllFrom`). | ||
* * `isLimit` – It can be understood as whether this element should not be split by <kbd>Enter</kbd>. | ||
* Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside | ||
* a limit element are limited to its content. **Note:** All objects (`isObject`) are treated as limit elements, too. | ||
* * `isObject` – Whether an item is "self-contained" and should be treated as a whole. Examples of object elements: | ||
* `image`, `table`, `video`, etc. **Note:** An object is also a limit, so | ||
* * {@link ~SchemaItemDefinition#isBlock `isBlock`} – Whether this item is paragraph-like. | ||
* Generally speaking, content is usually made out of blocks like paragraphs, list items, images, headings, etc. | ||
* * {@link ~SchemaItemDefinition#isInline `isInline`} – Whether an item is "text-like" and should be treated as an inline node. | ||
* Examples of inline elements: `$text`, `softBreak` (`<br>`), etc. | ||
* * {@link ~SchemaItemDefinition#isLimit `isLimit`} – It can be understood as whether this element | ||
* should not be split by <kbd>Enter</kbd>. Examples of limit elements: `$root`, table cell, image caption, etc. | ||
* In other words, all actions that happen inside a limit element are limited to its content. | ||
* All objects are treated as limit elements, too. | ||
* * {@link ~SchemaItemDefinition#isObject `isObject`} – Whether an item is "self-contained" and should be treated as a whole. | ||
* Examples of object elements: `image`, `table`, `video`, etc. An object is also a limit, so | ||
* {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically. | ||
* * `isInline` – Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements: | ||
* `$text`, `softBreak` (`<br>`), etc. | ||
* | ||
* Read more about the meaning of these types in the | ||
* {@glink framework/guides/deep-dive/schema#defining-additional-semantics Dedicated section of the "Schema" deep dive} guide. | ||
* | ||
* # Generic items | ||
@@ -1062,3 +1094,3 @@ * | ||
* By inheriting from the generic items you can define new items which will get extended by other editor features. | ||
* Read more about generic types in the {@glink framework/guides/deep-dive/schema Defining schema} guide. | ||
* Read more about generic types in the {@glink framework/guides/deep-dive/schema Schema deep dive} guide. | ||
* | ||
@@ -1123,6 +1155,48 @@ * # Example definitions | ||
* * Keep your model clean. Limit it to the actual data and store information in a normalized way. | ||
* * Remember about definining the `is*` properties. They do not affect the allowed structures, but they can | ||
* * Remember about defining the `is*` properties. They do not affect the allowed structures, but they can | ||
* affect how the editor features treat your elements. | ||
* | ||
* @typedef {Object} module:engine/model/schema~SchemaItemDefinition | ||
* | ||
* @property {String|Array.<String>} allowIn Defines in which other items this item will be allowed. | ||
* @property {String|Array.<String>} allowAttributes Defines allowed attributes of the given item. | ||
* @property {String|Array.<String>} allowContentOf Inherits "allowed children" from other items. | ||
* @property {String|Array.<String>} allowWhere Inherits "allowed in" from other items. | ||
* @property {String|Array.<String>} allowAttributesOf Inherits attributes from other items. | ||
* @property {String|Array.<String>} inheritTypesFrom Inherits `is*` properties of other items. | ||
* @property {String} inheritAllFrom A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`. | ||
* | ||
* @property {Boolean} isBlock | ||
* Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks | ||
* like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block | ||
* should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`. | ||
* Most block type items will inherit from `$block` (through `inheritAllFrom`). | ||
* | ||
* Read more about the block elements in the | ||
* {@glink framework/guides/deep-dive/schema#block-elements Block elements} section of the "Schema" deep dive} guide. | ||
* | ||
* @property {Boolean} isInline | ||
* Whether an item is "text-like" and should be treated as an inline node. Examples of inline elements: | ||
* `$text`, `softBreak` (`<br>`), etc. | ||
* | ||
* Read more about the inline elements in the | ||
* {@glink framework/guides/deep-dive/schema#inline-elements Inline elements} section of the "Schema" deep dive} guide. | ||
* | ||
* @property {Boolean} isLimit | ||
* It can be understood as whether this element should not be split by <kbd>Enter</kbd>. | ||
* Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside | ||
* a limit element are limited to its content. | ||
* | ||
* Read more about the limit elements in the | ||
* {@glink framework/guides/deep-dive/schema#limit-elements Limit elements} section of the "Schema" deep dive} guide. | ||
* | ||
* @property {Boolean} isObject | ||
* Whether an item is "self-contained" and should be treated as a whole. Examples of object elements: | ||
* `image`, `table`, `video`, etc. | ||
* | ||
* **Note:** An object is also a limit, so | ||
* {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically. | ||
* | ||
* Read more about the object elements in the | ||
* {@glink framework/guides/deep-dive/schema#object-elements Object elements} section of the "Schema" deep dive} guide. | ||
*/ | ||
@@ -1136,3 +1210,3 @@ | ||
* {@link module:engine/model/schema~SchemaItemDefinition} format. | ||
* Later on, they are compiled to `SchemaCompiledItemDefition` so when you use e.g. | ||
* Later on, they are compiled to `SchemaCompiledItemDefinition` so when you use e.g. | ||
* the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version. | ||
@@ -1375,3 +1449,3 @@ * | ||
* But sometimes you want to check whether a text at a given position might've had some attribute, | ||
* in which case you can create a context by mising an array of elements with a `'$text'` string: | ||
* in which case you can create a context by missing an array of elements with a `'$text'` string: | ||
* | ||
@@ -1378,0 +1452,0 @@ * // Check in [ rootElement, paragraphElement, textNode ]. |
@@ -111,3 +111,3 @@ /** | ||
* Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection | ||
* by dragging the mouse, the anchor is where the user pressed the mouse button (the beggining of the selection). | ||
* by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection). | ||
* | ||
@@ -867,3 +867,3 @@ * Anchor and {@link #focus} define the direction of the selection, which is important | ||
// | ||
// @param {module:engine/model/elmenent~Element} block Block to check. | ||
// @param {module:engine/model/element~Element} block Block to check. | ||
// @param {module:engine/model/range~Range} range Range to check. | ||
@@ -870,0 +870,0 @@ function isTopBlockInRange( block, range ) { |
@@ -581,3 +581,3 @@ /** | ||
// Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during | ||
// comparision with the expected DOM. We don't need to check child nodes, because if child node was reinserted, | ||
// comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted, | ||
// it was moved to DOM tree out of the removed node. | ||
@@ -584,0 +584,0 @@ for ( const node of nodesToUnbind ) { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1713066
15
38677
31