@ckeditor/ckeditor5-enter
Advanced tools
Comparing version 10.0.0 to 10.1.0
Changelog | ||
========= | ||
## [10.1.0](https://github.com/ckeditor/ckeditor5-enter/compare/v10.0.0...v10.1.0) (2018-06-21) | ||
### Features | ||
* Introduced the `ShiftEnter` plugin (support for inserting soft breaks by pressing <kbd>Shift</kbd>+<kbd>Enter</kbd>). This plugin will also be added to the `Essentials` plugin which is available in all official builds, so soft break support will automatically be present in all builds now. Closes [#2](https://github.com/ckeditor/ckeditor5-enter/issues/2). ([0181bbf](https://github.com/ckeditor/ckeditor5-enter/commit/0181bbf)) | ||
Huge thanks to [Alex Eckermann](https://github.com/alexeckermann) for this contribution! | ||
## [10.0.0](https://github.com/ckeditor/ckeditor5-enter/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25) | ||
@@ -5,0 +14,0 @@ |
{ | ||
"name": "@ckeditor/ckeditor5-enter", | ||
"version": "10.0.0", | ||
"version": "10.1.0", | ||
"description": "Enter feature for CKEditor 5.", | ||
@@ -12,12 +12,13 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^10.0.0", | ||
"@ckeditor/ckeditor5-engine": "^10.0.0", | ||
"@ckeditor/ckeditor5-utils": "^10.0.0" | ||
"@ckeditor/ckeditor5-core": "^10.1.0", | ||
"@ckeditor/ckeditor5-engine": "^10.1.0", | ||
"@ckeditor/ckeditor5-utils": "^10.1.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^10.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^10.0.0", | ||
"@ckeditor/ckeditor5-heading": "^10.0.0", | ||
"@ckeditor/ckeditor5-typing": "^10.0.0", | ||
"@ckeditor/ckeditor5-undo": "^10.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^10.0.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^10.0.1", | ||
"@ckeditor/ckeditor5-heading": "^10.0.1", | ||
"@ckeditor/ckeditor5-paragraph": "^10.0.1", | ||
"@ckeditor/ckeditor5-typing": "^10.0.1", | ||
"@ckeditor/ckeditor5-undo": "^10.0.1", | ||
"eslint": "^4.15.0", | ||
@@ -24,0 +25,0 @@ "eslint-config-ckeditor5": "^1.0.7", |
@@ -7,3 +7,3 @@ CKEditor 5 Enter feature | ||
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-enter.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-enter) | ||
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://www.browserstack.com/automate/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0) | ||
[![BrowserStack Status](https://automate.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://automate.browserstack.com/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-enter/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-enter?branch=master) | ||
@@ -14,3 +14,3 @@ <br> | ||
This package implements the <kbd>Enter</kbd> key support for CKEditor 5. | ||
This package implements the <kbd>Enter</kbd> and <kbd>Shift</kbd>+<kbd>Enter</kbd> (soft break) support for CKEditor 5. | ||
@@ -17,0 +17,0 @@ ## Documentation |
@@ -15,4 +15,6 @@ /** | ||
/** | ||
* The Enter feature. Handles the <kbd>Enter</kbd> and <kbd>Shift + Enter</kbd> keys in the editor. | ||
* This plugin handles the <kbd>Enter</kbd> key (hard line break) in the editor. | ||
* | ||
* See also the {@link module:enter/shiftenter~ShiftEnter} plugin. | ||
* | ||
* @extends module:core/plugin~Plugin | ||
@@ -37,4 +39,8 @@ */ | ||
// TODO We may use the keystroke handler for that. | ||
this.listenTo( viewDocument, 'enter', ( evt, data ) => { | ||
// The soft enter key is handled by the ShiftEnter plugin. | ||
if ( data.isSoft ) { | ||
return; | ||
} | ||
editor.execute( 'enter' ); | ||
@@ -41,0 +47,0 @@ data.preventDefault(); |
@@ -23,11 +23,13 @@ /** | ||
const document = this.document; | ||
const doc = this.document; | ||
document.on( 'keydown', ( evt, data ) => { | ||
doc.on( 'keydown', ( evt, data ) => { | ||
if ( this.isEnabled && data.keyCode == keyCodes.enter ) { | ||
// Save the event object to check later if it was stopped or not. | ||
let event; | ||
document.once( 'enter', evt => ( event = evt ), { priority: 'highest' } ); | ||
doc.once( 'enter', evt => ( event = evt ), { priority: 'highest' } ); | ||
document.fire( 'enter', new DomEventData( document, data.domEvent ) ); | ||
doc.fire( 'enter', new DomEventData( doc, data.domEvent, { | ||
isSoft: data.shiftKey | ||
} ) ); | ||
@@ -53,6 +55,8 @@ // Stop `keydown` event if `enter` event was stopped. | ||
* Note: This event is fired by the {@link module:enter/enterobserver~EnterObserver observer} | ||
* (usually registered by the {@link module:enter/enter~Enter Enter feature}). | ||
* (usually registered by the {@link module:enter/enter~Enter Enter feature} and | ||
* {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature}). | ||
* | ||
* @event module:engine/view/document~Document#event:enter | ||
* @param {module:engine/view/observer/domeventdata~DomEventData} data | ||
* @param {Boolean} data.isSoft Whether it's a soft enter (<kbd>Shift</kbd>+<kbd>Enter</kbd>) or hard enter (<kbd>Enter</kbd>). | ||
*/ |
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
20815
9
355
10