Browse Source

Merge branch 'master' into t/ckeditor5/1120

Piotrek Koszuliński 7 years ago
parent
commit
61f99cce25

+ 4 - 2
packages/ckeditor5-enter/.travis.yml

@@ -1,7 +1,7 @@
 sudo: required
 dist: trusty
 addons:
-  firefox: "latest"
+  firefox: latest
   apt:
     sources:
     - google-chrome
@@ -9,12 +9,14 @@ addons:
     - google-chrome-stable
 language: node_js
 node_js:
-- '6'
+- '8'
 cache:
 - node_modules
 before_install:
 - export DISPLAY=:99.0
 - sh -e /etc/init.d/xvfb start
+- npm config set package-lock false
+- npm i -g npm@^5.7.1
 install:
 - npm install @ckeditor/ckeditor5-dev-tests
 - ckeditor5-dev-tests-install-dependencies

+ 5 - 0
packages/ckeditor5-enter/CHANGELOG.md

@@ -1,6 +1,11 @@
 Changelog
 =========
 
+## [10.1.1](https://github.com/ckeditor/ckeditor5-enter/compare/v10.1.0...v10.1.1) (2018-07-18)
+
+Internal changes only (updated dependencies, documentation, etc.).
+
+
 ## [10.1.0](https://github.com/ckeditor/ckeditor5-enter/compare/v10.0.0...v10.1.0) (2018-06-21)
 
 ### Features

+ 1 - 1
packages/ckeditor5-enter/README.md

@@ -14,7 +14,7 @@ This package implements the <kbd>Enter</kbd> and <kbd>Shift</kbd>+<kbd>Enter</kb
 
 ## Documentation
 
-See the [`@ckeditor/ckeditor5-enter` package](https://docs.ckeditor.com/ckeditor5/latest/api/enter.html) page in [CKEditor 5 documentation](https://docs.ckeditor.com/ckeditor5/latest/).
+See the [`@ckeditor/ckeditor5-enter` package](https://ckeditor.com/docs/ckeditor5/latest/api/enter.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
 
 ## License
 

+ 11 - 11
packages/ckeditor5-enter/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-enter",
-  "version": "10.1.0",
+  "version": "10.1.1",
   "description": "Enter feature for CKEditor 5.",
   "keywords": [
     "ckeditor",
@@ -9,24 +9,24 @@
     "ckeditor5-feature"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-core": "^10.1.0",
-    "@ckeditor/ckeditor5-engine": "^10.1.0",
-    "@ckeditor/ckeditor5-utils": "^10.1.0"
+    "@ckeditor/ckeditor5-core": "^11.0.0",
+    "@ckeditor/ckeditor5-engine": "^10.2.0",
+    "@ckeditor/ckeditor5-utils": "^10.2.0"
   },
   "devDependencies": {
-    "@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",
+    "@ckeditor/ckeditor5-basic-styles": "^10.0.2",
+    "@ckeditor/ckeditor5-editor-classic": "^11.0.0",
+    "@ckeditor/ckeditor5-heading": "^10.0.2",
+    "@ckeditor/ckeditor5-paragraph": "^10.0.2",
+    "@ckeditor/ckeditor5-typing": "^11.0.0",
+    "@ckeditor/ckeditor5-undo": "^10.0.2",
     "eslint": "^4.15.0",
     "eslint-config-ckeditor5": "^1.0.7",
     "husky": "^0.14.3",
     "lint-staged": "^7.0.0"
   },
   "engines": {
-    "node": ">=6.0.0",
+    "node": ">=6.9.0",
     "npm": ">=3.0.0"
   },
   "author": "CKSource (http://cksource.com/)",

+ 9 - 9
packages/ckeditor5-enter/tests/entercommand.js

@@ -5,7 +5,7 @@
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';
 import EnterCommand from '../src/entercommand';
-import InsertDelta from '@ckeditor/ckeditor5-engine/src/model/delta/insertdelta';
+import InsertOperation from '@ckeditor/ckeditor5-engine/src/model/operation/insertoperation';
 import { getData, setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 
 describe( 'EnterCommand', () => {
@@ -50,30 +50,30 @@ describe( 'EnterCommand', () => {
 			setData( model, '<p>foo[]</p>' );
 
 			model.change( writer => {
-				expect( writer.batch.deltas ).to.length( 0 );
+				expect( writer.batch.operations ).to.length( 0 );
 				editor.execute( 'enter' );
-				expect( writer.batch.deltas ).to.length.above( 0 );
+				expect( writer.batch.operations ).to.length.above( 0 );
 			} );
 		} );
 
-		it( 'creates InsertDelta if enter is at the beginning of block', () => {
+		it( 'creates InsertOperation if enter is at the beginning of block', () => {
 			setData( model, '<p>[]foo</p>' );
 
 			editor.execute( 'enter' );
 
-			const deltas = Array.from( doc.history.getDeltas() );
+			const ops = doc.history.getOperations();
 
-			expect( deltas[ deltas.length - 1 ] ).to.be.instanceof( InsertDelta );
+			expect( ops[ ops.length - 1 ] ).to.be.instanceof( InsertOperation );
 		} );
 
-		it( 'creates InsertDelta if enter is at the end of block', () => {
+		it( 'creates InsertOperation if enter is at the end of block', () => {
 			setData( model, '<p>foo[]</p>' );
 
 			editor.execute( 'enter' );
 
-			const deltas = Array.from( doc.history.getDeltas() );
+			const operations = Array.from( doc.history.getOperations() );
 
-			expect( deltas[ deltas.length - 1 ] ).to.be.instanceof( InsertDelta );
+			expect( operations[ operations.length - 1 ] ).to.be.instanceof( InsertOperation );
 		} );
 	} );
 

+ 26 - 16
packages/ckeditor5-enter/tests/shiftentercommand.js

@@ -4,7 +4,7 @@
  */
 
 import ModelTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/modeltesteditor';
-import InsertDelta from '@ckeditor/ckeditor5-engine/src/model/delta/insertdelta';
+import InsertOperation from '@ckeditor/ckeditor5-engine/src/model/operation/insertoperation';
 import { getData, setData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import ShiftEnter from '../src/shiftenter';
 
@@ -49,30 +49,30 @@ describe( 'ShiftEnterCommand', () => {
 			setData( model, '<p>foo[]</p>' );
 
 			model.change( writer => {
-				expect( writer.batch.deltas ).to.length( 0 );
+				expect( writer.batch.operations ).to.length( 0 );
 				editor.execute( 'shiftEnter' );
-				expect( writer.batch.deltas ).to.length.above( 0 );
+				expect( writer.batch.operations ).to.length.above( 0 );
 			} );
 		} );
 
-		it( 'creates InsertDelta if soft enter is at the beginning of block', () => {
+		it( 'creates InsertOperation if soft enter is at the beginning of block', () => {
 			setData( model, '<p>[]foo</p>' );
 
 			editor.execute( 'shiftEnter' );
 
-			const deltas = Array.from( doc.history.getDeltas() );
+			const operations = Array.from( doc.history.getOperations() );
 
-			expect( deltas[ deltas.length - 1 ] ).to.be.instanceof( InsertDelta );
+			expect( operations[ operations.length - 1 ] ).to.be.instanceof( InsertOperation );
 		} );
 
-		it( 'creates InsertDelta if soft enter is at the end of block', () => {
+		it( 'creates InsertOperation if soft enter is at the end of block', () => {
 			setData( model, '<p>foo[]</p>' );
 
 			editor.execute( 'shiftEnter' );
 
-			const deltas = Array.from( doc.history.getDeltas() );
+			const operations = Array.from( doc.history.getOperations() );
 
-			expect( deltas[ deltas.length - 1 ] ).to.be.instanceof( InsertDelta );
+			expect( operations[ operations.length - 1 ] ).to.be.instanceof( InsertOperation );
 		} );
 	} );
 
@@ -295,7 +295,7 @@ describe( 'ShiftEnterCommand', () => {
 			model.change( () => {
 				setData( model, '<p><inlineLimit>F[oo.</inlineLimit>B]ar.</p>' );
 
-				// Enforce command refresh because of 'transparent' batch.
+				// Refresh it manually because we're in the middle of a change block.
 				command.refresh();
 
 				expect( command.isEnabled ).to.equal( false );
@@ -307,7 +307,7 @@ describe( 'ShiftEnterCommand', () => {
 			model.change( () => {
 				setData( model, '<p>F[oo<inlineLimit>Bar].</inlineLimit></p>' );
 
-				// Enforce command refresh because of 'transparent' batch.
+				// Refresh it manually because we're in the middle of a change block.
 				command.refresh();
 
 				expect( command.isEnabled ).to.equal( false );
@@ -319,7 +319,7 @@ describe( 'ShiftEnterCommand', () => {
 			model.change( () => {
 				setData( model, '<img>[]</img>' );
 
-				// Enforce command refresh because of 'transparent' batch.
+				// Refresh it manually because we're in the middle of a change block.
 				command.refresh();
 
 				expect( command.isEnabled ).to.equal( false );
@@ -327,15 +327,25 @@ describe( 'ShiftEnterCommand', () => {
 		} );
 
 		it( 'should be disabled for non-collapsed selection which starts in element inside a block limit element', () => {
-			setData( model, '<blockLimit><p>F[oo.</p></blockLimit><p>B]ar.</p>' );
+			model.change( () => {
+				setData( model, '<blockLimit><p>F[oo.</p></blockLimit><p>B]ar.</p>' );
 
-			expect( command.isEnabled ).to.equal( false );
+				// Refresh it manually because we're in the middle of a change block.
+				command.refresh();
+
+				expect( command.isEnabled ).to.equal( false );
+			} );
 		} );
 
 		it( 'should be disabled for non-collapsed selection which ends in element inside a block limit element', () => {
-			setData( model, '<p>Fo[o.</p><blockLimit><p>Bar].</p></blockLimit>' );
+			model.change( () => {
+				setData( model, '<p>Fo[o.</p><blockLimit><p>Bar].</p></blockLimit>' );
 
-			expect( command.isEnabled ).to.equal( false );
+				// Refresh it manually because we're in the middle of a change block.
+				command.refresh();
+
+				expect( command.isEnabled ).to.equal( false );
+			} );
 		} );
 
 		it( 'should be disabled for multi-ranges selection (1)', () => {