Kaynağa Gözat

Merge branch 'master' into t/61

Kamil Piechaczek 8 yıl önce
ebeveyn
işleme
bdee420db0

+ 1 - 1
packages/ckeditor5-typing/package.json

@@ -18,7 +18,7 @@
     "@ckeditor/ckeditor5-paragraph": "^0.8.0",
     "@ckeditor/ckeditor5-undo": "^0.8.1",
     "@ckeditor/ckeditor5-presets": "^0.2.2",
-    "eslint-config-ckeditor5": "^1.0.0",
+    "eslint-config-ckeditor5": "^1.0.5",
     "gulp": "^3.9.1",
     "guppy-pre-commit": "^0.4.0"
   },

+ 1 - 1
packages/ckeditor5-typing/src/input.js

@@ -311,7 +311,7 @@ const safeKeycodes = [
 	getCode( 'arrowRight' ),
 	getCode( 'arrowDown' ),
 	getCode( 'arrowLeft' ),
-	9,  // Tab
+	9, // Tab
 	16, // Shift
 	17, // Ctrl
 	18, // Alt

+ 9 - 8
packages/ckeditor5-typing/tests/bogusbr-integration.js

@@ -22,14 +22,15 @@ describe( 'Bogus BR integration', () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Typing, Paragraph, Bold ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			domRoot = editor.editing.view.getDomRoot();
-			mutationObserver = editor.editing.view.getObserver( MutationObserver );
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Typing, Paragraph, Bold ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				domRoot = editor.editing.view.getDomRoot();
+				mutationObserver = editor.editing.view.getObserver( MutationObserver );
+			} );
 	} );
 
 	afterEach( () => {

+ 2 - 1
packages/ckeditor5-typing/tests/delete.js

@@ -11,7 +11,8 @@ describe( 'Delete feature', () => {
 	let editor, editingView;
 
 	beforeEach( () => {
-		return VirtualTestEditor.create( { plugins: [ Delete ] } )
+		return VirtualTestEditor
+			.create( { plugins: [ Delete ] } )
 			.then( newEditor => {
 				editor = newEditor;
 				editingView = editor.editing.view;

+ 7 - 1
packages/ckeditor5-typing/tests/deletecommand-integration.js

@@ -12,7 +12,13 @@ describe( 'DeleteCommand integration', () => {
 	let editor, doc;
 
 	beforeEach( () => {
-		return ModelTestEditor.create( { plugins: [ UndoEngine ], typing: { undoStep: 3 } } )
+		return ModelTestEditor
+			.create( {
+				plugins: [ UndoEngine ],
+				typing: {
+					undoStep: 3
+				}
+			} )
 			.then( newEditor => {
 				editor = newEditor;
 				doc = editor.document;

+ 5 - 2
packages/ckeditor5-typing/tests/input.js

@@ -39,7 +39,10 @@ describe( 'Input feature', () => {
 	before( () => {
 		listenter = Object.create( EmitterMixin );
 
-		return VirtualTestEditor.create( { plugins: [ Input, Paragraph ] } )
+		return VirtualTestEditor
+			.create( {
+				plugins: [ Input, Paragraph ]
+			} )
 			.then( newEditor => {
 				// Mock image feature.
 				newEditor.document.schema.registerItem( 'image', '$inline' );
@@ -428,7 +431,7 @@ describe( 'Input feature', () => {
 					ModelRange.createFromParentsAndOffsets( modelRoot.getChild( 0 ), 2, modelRoot.getChild( 0 ), 4 ) ] );
 			} );
 
-			view.fire( 'keydown', { keyCode: getCode( 'arrowright' ) } );
+			view.fire( 'keydown', { keyCode: getCode( 'arrowdown' ) } );
 
 			expect( getModelData( model ) ).to.equal( '<paragraph>fo[ob]ar</paragraph>' );
 		} );

+ 13 - 12
packages/ckeditor5-typing/tests/inputcommand-integration.js

@@ -27,18 +27,19 @@ describe( 'InputCommand integration', () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Typing, Paragraph, Undo, Bold, Italic, Enter ],
-			typing: { undoStep: 3 }
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			viewDocument = editor.editing.view;
-
-			boldView = editor.ui.componentFactory.create( 'bold' );
-			italicView = editor.ui.componentFactory.create( 'italic' );
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Typing, Paragraph, Undo, Bold, Italic, Enter ],
+				typing: { undoStep: 3 }
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				viewDocument = editor.editing.view;
+
+				boldView = editor.ui.componentFactory.create( 'bold' );
+				italicView = editor.ui.componentFactory.create( 'italic' );
+			} );
 	} );
 
 	afterEach( () => {

+ 7 - 6
packages/ckeditor5-typing/tests/inputcommand.js

@@ -52,12 +52,13 @@ describe( 'InputCommand', () => {
 		} );
 
 		it( 'has a buffer configured to config.typing.undoStep', () => {
-			return VirtualTestEditor.create( {
-				plugins: [ Input ],
-				typing: {
-					undoStep: 5
-				}
-			} )
+			return VirtualTestEditor
+				.create( {
+					plugins: [ Input ],
+					typing: {
+						undoStep: 5
+					}
+				} )
 				.then( editor => {
 					expect( editor.commands.get( 'input' )._buffer ).to.have.property( 'limit', 5 );
 				} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/20/1.js

@@ -12,13 +12,14 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/21/1.js

@@ -12,13 +12,14 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/40/1.js

@@ -10,13 +10,14 @@ import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Typing from '../../../src/typing';
 import Heading from '@ckeditor/ckeditor5-heading/src/heading';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Heading ],
-	toolbar: [ 'headings' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Heading ],
+		toolbar: [ 'headings' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/52/1.js

@@ -17,13 +17,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/59/1.js

@@ -10,13 +10,14 @@ import Typing from '../../../src/typing';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Typing, Paragraph, Bold ],
-	toolbar: [ 'bold' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Typing, Paragraph, Bold ],
+		toolbar: [ 'bold' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/82/1.js

@@ -15,13 +15,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Heading ],
-	toolbar: [ 'headings', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Heading ],
+		toolbar: [ 'headings', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/86/1.js

@@ -14,13 +14,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph ],
-	toolbar: [ 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph ],
+		toolbar: [ 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/delete.js

@@ -19,13 +19,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/input.js

@@ -17,13 +17,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 30 - 29
packages/ckeditor5-typing/tests/manual/nbsp.js

@@ -12,37 +12,38 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import { getData as getModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph ],
-	toolbar: []
-} )
-.then( editor => {
-	window.editor = editor;
-
-	editor.document.schema.allow( { name: '$text', inside: '$root' } );
-
-	const editable = editor.ui.view.editableElement;
-
-	document.querySelector( '#nbsp' ).addEventListener( 'click', () => {
-		editor.document.enqueueChanges( () => {
-			editor.document.selection.collapseToStart();
-			editor.document.batch().weakInsert( editor.document.selection.getFirstPosition(), '\u00A0' );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph ],
+		toolbar: []
+	} )
+	.then( editor => {
+		window.editor = editor;
+
+		editor.document.schema.allow( { name: '$text', inside: '$root' } );
+
+		const editable = editor.ui.view.editableElement;
+
+		document.querySelector( '#nbsp' ).addEventListener( 'click', () => {
+			editor.document.enqueueChanges( () => {
+				editor.document.selection.collapseToStart();
+				editor.document.batch().weakInsert( editor.document.selection.getFirstPosition(), '\u00A0' );
+			} );
 		} );
-	} );
 
-	editor.document.on( 'changesDone', () => {
-		console.clear();
+		editor.document.on( 'changesDone', () => {
+			console.clear();
 
-		const modelData = getModelData( editor.document, { withoutSelection: true } );
-		console.log( 'model:', modelData.replace( /\u00A0/g, '&nbsp;' ) );
+			const modelData = getModelData( editor.document, { withoutSelection: true } );
+			console.log( 'model:', modelData.replace( /\u00A0/g, '&nbsp;' ) );
 
-		const viewData = getViewData( editor.editing.view, { withoutSelection: true } );
-		console.log( 'view:', viewData.replace( /\u00A0/g, '&nbsp;' ) );
+			const viewData = getViewData( editor.editing.view, { withoutSelection: true } );
+			console.log( 'view:', viewData.replace( /\u00A0/g, '&nbsp;' ) );
 
-		console.log( 'dom:', editable.innerHTML );
-		console.log( 'editor.getData', editor.getData() );
-	}, { priority: 'lowest' } );
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+			console.log( 'dom:', editable.innerHTML );
+			console.log( 'editor.getData', editor.getData() );
+		}, { priority: 'lowest' } );
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 21 - 19
packages/ckeditor5-typing/tests/manual/rtl.js

@@ -85,22 +85,24 @@ window.setInterval( function() {
 	}
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor1' ), config )
-.then( editor => {
-	window.editor1 = editor;
-
-	// Editable doesn't automatically get this attribute right now.
-	// https://github.com/ckeditor/ckeditor5-editor-classic/issues/32
-	editor.editing.view.getDomRoot().setAttribute( 'dir', 'rtl' );
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
-
-ClassicEditor.create( document.querySelector( '#editor2' ), config )
-.then( editor => {
-	window.editor2 = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor1' ), config )
+	.then( editor => {
+		window.editor1 = editor;
+
+		// Editable doesn't automatically get this attribute right now.
+		// https://github.com/ckeditor/ckeditor5-editor-classic/issues/32
+		editor.editing.view.getDomRoot().setAttribute( 'dir', 'rtl' );
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+
+ClassicEditor
+	.create( document.querySelector( '#editor2' ), config )
+	.then( editor => {
+		window.editor2 = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/selection.js

@@ -10,13 +10,14 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold ],
-	toolbar: [ 'bold' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold ],
+		toolbar: [ 'bold' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/unicode.js

@@ -10,13 +10,14 @@ import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Typing from '../../src/typing';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph ],
-	toolbar: []
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph ],
+		toolbar: []
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 7 - 6
packages/ckeditor5-typing/tests/spellchecking.js

@@ -26,12 +26,13 @@ describe( 'Spellchecking integration', () => {
 		container = document.createElement( 'div' );
 		document.body.appendChild( container );
 
-		return ClassicEditor.create( container, {
-			plugins: [ Enter, Typing, Paragraph, Bold, Undo ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicEditor
+			.create( container, {
+				plugins: [ Enter, Typing, Paragraph, Bold, Undo ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	after( () => {

+ 7 - 6
packages/ckeditor5-typing/tests/tickets/59.js

@@ -19,12 +19,13 @@ describe( 'Bug ckeditor5-typing#59', () => {
 		container = document.createElement( 'div' );
 		document.body.appendChild( container );
 
-		return ClassicEditor.create( container, {
-			plugins: [ Typing, Paragraph, Bold ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicEditor
+			.create( container, {
+				plugins: [ Typing, Paragraph, Bold ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	afterEach( () => {