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

Other: The `Article` plugin became a `@ckeditor/ckeditor5-core`'s test util. See #1.

BREAKING CHANGE: The `Article` plugin was removed.
Piotrek Koszuliński 8 лет назад
Родитель
Сommit
f27b988c06

+ 0 - 57
packages/ckeditor5-essentials/src/article.js

@@ -1,57 +0,0 @@
-/**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/**
- * @module presets/article
- */
-
-import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-
-import EssentialsPreset from './essentials';
-
-import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
-import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
-import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
-import Heading from '@ckeditor/ckeditor5-heading/src/heading';
-import Image from '@ckeditor/ckeditor5-image/src/image';
-import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
-import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
-import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
-import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
-import Link from '@ckeditor/ckeditor5-link/src/link';
-import List from '@ckeditor/ckeditor5-list/src/list';
-import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
-
-/**
- * Article editor preset. Represents a set of features that enables all functionalities
- * of a simple article editor.
- *
- * This preset follows [Editor Recommendations](https://github.com/ckeditor/editor-recommendations) plus
- * a couple of additions:
- *
- * * autoformatting,
- * * TODO there will be more here soon (upload).
- *
- * @extends module:core/plugin~Plugin
- */
-export default class Article extends Plugin {
-	static get requires() {
-		return [
-			EssentialsPreset,
-			Autoformat,
-			BlockQuote,
-			Bold,
-			Heading,
-			Image,
-			ImageCaption,
-			ImageStyle,
-			ImageToolbar,
-			Italic,
-			Link,
-			List,
-			Paragraph
-		];
-	}
-}

+ 0 - 113
packages/ckeditor5-essentials/tests/article.js

@@ -1,113 +0,0 @@
-/**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global document */
-
-import ArticlePreset from '../src/article';
-import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
-
-import EssentialsPreset from '../src/essentials';
-import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
-import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
-import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
-import Heading from '@ckeditor/ckeditor5-heading/src/heading';
-import Image from '@ckeditor/ckeditor5-image/src/image';
-import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
-import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
-import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
-import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
-import Link from '@ckeditor/ckeditor5-link/src/link';
-import List from '@ckeditor/ckeditor5-list/src/list';
-
-import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
-
-describe( 'Article preset', () => {
-	let editor, editorElement;
-
-	beforeEach( () => {
-		editorElement = document.createElement( 'div' );
-		document.body.appendChild( editorElement );
-
-		return ClassicTestEditor.create( editorElement, { plugins: [ ArticlePreset ] } )
-			.then( newEditor => {
-				editor = newEditor;
-			} );
-	} );
-
-	afterEach( () => {
-		editor.destroy();
-
-		editorElement.remove();
-	} );
-
-	it( 'should be loaded', () => {
-		expect( editor.plugins.get( ArticlePreset ) ).to.be.instanceOf( ArticlePreset );
-	} );
-
-	it( 'should load all its dependencies', () => {
-		expect( editor.plugins.get( EssentialsPreset ) ).to.be.instanceOf( EssentialsPreset );
-
-		expect( editor.plugins.get( Paragraph ) ).to.be.instanceOf( Paragraph );
-		expect( editor.plugins.get( Autoformat ) ).to.be.instanceOf( Autoformat );
-		expect( editor.plugins.get( Bold ) ).to.be.instanceOf( Bold );
-		expect( editor.plugins.get( Heading ) ).to.be.instanceOf( Heading );
-		expect( editor.plugins.get( Image ) ).to.be.instanceOf( Image );
-		expect( editor.plugins.get( ImageCaption ) ).to.be.instanceOf( ImageCaption );
-		expect( editor.plugins.get( ImageStyle ) ).to.be.instanceOf( ImageStyle );
-		expect( editor.plugins.get( ImageToolbar ) ).to.be.instanceOf( ImageToolbar );
-		expect( editor.plugins.get( Italic ) ).to.be.instanceOf( Italic );
-		expect( editor.plugins.get( Link ) ).to.be.instanceOf( Link );
-		expect( editor.plugins.get( List ) ).to.be.instanceOf( List );
-	} );
-
-	it( 'loads data', () => {
-		const data =
-			'<h2>Heading 1</h2>' +
-			'<p>Paragraph</p>' +
-			'<p><strong>Bold</strong> <i>Italic</i> <a href="foo">Link</a></p>' +
-			'<ul>' +
-				'<li>UL List item 1</li>' +
-				'<li>UL List item 2</li>' +
-			'</ul>' +
-			'<ol>' +
-				'<li>OL List item 1</li>' +
-				'<li>OL List item 2</li>' +
-			'</ol>' +
-			'<figure class="image image-style-side">' +
-				'<img alt="bar" src="foo">' +
-				'<figcaption>Caption</figcaption>' +
-			'</figure>' +
-			'<blockquote>' +
-				'<p>Quote</p>' +
-				'<ul><li>Quoted UL List item 1</li></ul>' +
-			'</blockquote>';
-
-		// Can't use data twice due to https://github.com/ckeditor/ckeditor5-utils/issues/128.
-		const expectedOutput =
-			'<h2>Heading 1</h2>' +
-			'<p>Paragraph</p>' +
-			'<p><strong>Bold</strong> <i>Italic</i> <a href="foo">Link</a></p>' +
-			'<ul>' +
-				'<li>UL List item 1</li>' +
-				'<li>UL List item 2</li>' +
-			'</ul>' +
-			'<ol>' +
-				'<li>OL List item 1</li>' +
-				'<li>OL List item 2</li>' +
-			'</ol>' +
-			'<figure class="image image-style-side">' +
-				'<img alt="bar" src="foo"></img>' +
-				'<figcaption>Caption</figcaption>' +
-			'</figure>' +
-			'<blockquote>' +
-				'<p>Quote</p>' +
-				'<ul><li>Quoted UL List item 1</li></ul>' +
-			'</blockquote>';
-
-		editor.setData( data );
-
-		expect( normalizeHtml( editor.getData() ) ).to.equal( expectedOutput );
-	} );
-} );

+ 0 - 25
packages/ckeditor5-essentials/tests/manual/article.html

@@ -1,25 +0,0 @@
-<div id="editor">
-	<h2>Heading 1</h2>
-	<p>Paragraph</p>
-	<p><strong>Bold</strong> <i>Italic</i> <a href="foo">Link</a></p>
-	<ul>
-		<li>UL List item 1</li>
-		<li>UL List item 2</li>
-	</ul>
-	<ol>
-		<li>OL List item 1</li>
-		<li>OL List item 2</li>
-	</ol>
-	<figure class="image image-style-side">
-		<img alt="bar" src="sample.jpg">
-		<figcaption>Caption</figcaption>
-	</figure>
-	<blockquote>
-		<p>Quote</p>
-		<ul>
-			<li>Quoted UL List item 1</li>
-			<li>Quoted UL List item 2</li>
-		</ul>
-		<p>Quote</p>
-	</blockquote>
-</div>

+ 0 - 25
packages/ckeditor5-essentials/tests/manual/article.js

@@ -1,25 +0,0 @@
-/**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* globals console, window, document */
-
-import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
-
-import ArticlePreset from '../../src/article';
-
-ClassicEditor
-	.create( document.querySelector( '#editor' ), {
-		plugins: [ ArticlePreset ],
-		toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
-		image: {
-			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
-		}
-	} )
-	.then( editor => {
-		window.editor = editor;
-	} )
-	.catch( err => {
-		console.error( err.stack );
-	} );

+ 0 - 3
packages/ckeditor5-essentials/tests/manual/article.md

@@ -1,3 +0,0 @@
-# Article preset
-
-Check whether all the available features work together.