8
0
Просмотр исходного кода

Introduced the Essentials plugin.

Kamil Piechaczek 7 лет назад
Родитель
Сommit
ae3015138f

+ 33 - 0
packages/ckeditor5-enter/src/essentials.js

@@ -0,0 +1,33 @@
+/**
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module enter/essentials
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+import Enter from './enter';
+import ShiftEnter from './shiftenter';
+
+/**
+ * The Essentials feature. Handles the <kbd>Enter</kbd> and <kbd>Shift + Enter</kbd> keys in the editor.
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class Essentials extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get requires() {
+		return [ Enter, ShiftEnter ];
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'Essentials';
+	}
+}

+ 18 - 0
packages/ckeditor5-enter/tests/essentials.js

@@ -0,0 +1,18 @@
+/**
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import Essentials from '../src/essentials';
+import Enter from '../src/enter';
+import ShiftEnter from '../src/shiftenter';
+
+describe( 'Essentials Feature', () => {
+	it( 'should require Enter and ShiftEnter', () => {
+		expect( Essentials.requires ).to.deep.equal( [ Enter, ShiftEnter ] );
+	} );
+
+	it( 'should be named', () => {
+		expect( Essentials.pluginName ).to.equal( 'Essentials' );
+	} );
+} );