@ckeditor/ckeditor5-core
Advanced tools
Comparing version 1.0.0-alpha.2 to 1.0.0-beta.1
Changelog | ||
========= | ||
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-core/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018-03-15) | ||
### Other changes | ||
* Moved `EditingController`, `DataController` and `EditingKeystrokeHandler` from `StandardEditor` to the `Editor` class. Closes [#110](https://github.com/ckeditor/ckeditor5-core/issues/110). ([5a2031e](https://github.com/ckeditor/ckeditor5-core/commit/5a2031e)) | ||
* Removed the `StandardEditor` class in favor of `DataInterface` and `ElementInterface` mixins. Added `EditorWithUI` interface. Closes [#115](https://github.com/ckeditor/ckeditor5-core/issues/115). Closes [#113](https://github.com/ckeditor/ckeditor5-core/issues/113). Closes https://github.com/ckeditor/ckeditor5/issues/303. ([fe81992](https://github.com/ckeditor/ckeditor5-core/commit/fe81992)) | ||
* `Command` should listen to `model.Document#event:change`. ([912570d](https://github.com/ckeditor/ckeditor5-core/commit/912570d)) | ||
* Changed `config.lang` to `config.language` to align to the naming convention. ([8720973](https://github.com/ckeditor/ckeditor5-core/commit/8720973)) | ||
* Removed `loadDataFromElement()` method from `ElementApiMixin`. Closes [#120](https://github.com/ckeditor/ckeditor5-core/issues/120). ([4976e10](https://github.com/ckeditor/ckeditor5-core/commit/4976e10)) | ||
### BREAKING CHANGES | ||
* The `StandardEditor` class was removed. Use `Editor` class with `DataInterface` and `ElementInterface` mixins. | ||
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-core/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017-11-14) | ||
@@ -5,0 +20,0 @@ |
@@ -5,3 +5,3 @@ Software License Agreement | ||
**CKEditor 5 Core Editor Architecture** – https://github.com/ckeditor/ckeditor5-core <br> | ||
Copyright (c) 2003-2017, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
Copyright (c) 2003-2018, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
@@ -8,0 +8,0 @@ Licensed under the terms of any of the following licenses at your choice: |
{ | ||
"name": "@ckeditor/ckeditor5-core", | ||
"version": "1.0.0-alpha.2", | ||
"version": "1.0.0-beta.1", | ||
"description": "CKEditor 5 core editor architecture.", | ||
@@ -10,21 +10,21 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-engine": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-utils": "^1.0.0-alpha.2" | ||
"@ckeditor/ckeditor5-engine": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-utils": "^1.0.0-beta.1" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-autoformat": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-basic-styles": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-block-quote": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-editor-classic": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-essentials": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-heading": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-image": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-link": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-list": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-paragraph": "^1.0.0-alpha.2", | ||
"@ckeditor/ckeditor5-ui": "^1.0.0-alpha.2", | ||
"eslint": "^4.8.0", | ||
"eslint-config-ckeditor5": "^1.0.6", | ||
"@ckeditor/ckeditor5-autoformat": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-basic-styles": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-block-quote": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-essentials": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-heading": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-image": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-link": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-list": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-paragraph": "^1.0.0-beta.1", | ||
"@ckeditor/ckeditor5-ui": "^1.0.0-beta.1", | ||
"eslint": "^4.15.0", | ||
"eslint-config-ckeditor5": "^1.0.7", | ||
"husky": "^0.14.3", | ||
"lint-staged": "^4.2.3" | ||
"lint-staged": "^6.0.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "engines": { |
@@ -7,3 +7,5 @@ CKEditor 5 core editor architecture | ||
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-core.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-core) | ||
[![Test Coverage](https://codeclimate.com/github/ckeditor/ckeditor5-core/badges/coverage.svg)](https://codeclimate.com/github/ckeditor/ckeditor5-core/coverage) | ||
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://www.browserstack.com/automate/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-core/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-core?branch=master) | ||
<br> | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-core/status.svg)](https://david-dm.org/ckeditor/ckeditor5-core) | ||
@@ -10,0 +12,0 @@ [![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-core/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-core?type=dev) |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -48,3 +48,3 @@ */ | ||
* | ||
* It's possible for a command to have no value (e.g. for stateless actions such as `uploadImage`). | ||
* It's possible for a command to have no value (e.g. for stateless actions such as `imageUpload`). | ||
* | ||
@@ -70,3 +70,3 @@ * @observable | ||
// By default every command is refreshed when changes are applied to the model. | ||
this.listenTo( this.editor.document, 'changesDone', () => { | ||
this.listenTo( this.editor.model.document, 'change', () => { | ||
this.refresh(); | ||
@@ -104,3 +104,3 @@ } ); | ||
* This method is automatically called when | ||
* {@link module:engine/model/document~Document#event:changesDone any changes are applied to the model}. | ||
* {@link module:engine/model/document~Document#event:change any changes are applied to the document}. | ||
*/ | ||
@@ -107,0 +107,0 @@ refresh() { |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -73,3 +73,3 @@ */ | ||
* | ||
* @returns {Iterator.<String>} | ||
* @returns {Iterable.<String>} | ||
*/ | ||
@@ -83,3 +83,3 @@ * names() { | ||
* | ||
* @returns {Iterator.<module:core/command~Command>} | ||
* @returns {Iterable.<module:core/command~Command>} | ||
*/ | ||
@@ -91,3 +91,7 @@ * commands() { | ||
/** | ||
* Collection iterator. | ||
* Iterable interface. | ||
* | ||
* Returns `[ commandName, commandInstance ]` pairs. | ||
* | ||
* @returns {Iterable.<Array>} | ||
*/ | ||
@@ -94,0 +98,0 @@ [ Symbol.iterator ]() { |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -14,3 +14,3 @@ */ | ||
* A keystroke handler for editor editing. Its instance is available | ||
* in {@link module:core/editor/standardeditor~StandardEditor#keystrokes} so plugins | ||
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins | ||
* can register their keystrokes. | ||
@@ -17,0 +17,0 @@ * |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -11,2 +11,3 @@ */ | ||
import Config from '@ckeditor/ckeditor5-utils/src/config'; | ||
import EditingController from '@ckeditor/ckeditor5-engine/src/controller/editingcontroller'; | ||
import PluginCollection from '../plugincollection'; | ||
@@ -16,3 +17,5 @@ import CommandCollection from '../commandcollection'; | ||
import DataController from '@ckeditor/ckeditor5-engine/src/controller/datacontroller'; | ||
import Document from '@ckeditor/ckeditor5-engine/src/model/document'; | ||
import Conversion from '@ckeditor/ckeditor5-engine/src/conversion/conversion'; | ||
import Model from '@ckeditor/ckeditor5-engine/src/model/model'; | ||
import EditingKeystrokeHandler from '../editingkeystrokehandler'; | ||
@@ -23,5 +26,9 @@ import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; | ||
/** | ||
* Class representing a basic editor. It contains a base architecture, without much additional logic. | ||
* Class representing the base of the editor. It is the API all plugins can expect to get when using `editor` property. | ||
* It should be enough to implement editing part of feature (schema definition, conversion, commands, keystrokes, etc.). | ||
* However it does not define editor UI, which is defined in {@link module:core/editor/editorwithui~EditorWithUI}. | ||
* | ||
* See also {@link module:core/editor/standardeditor~StandardEditor}. | ||
* All editors implementation (like {@link module:editor-classic/classiceditor~ClassicEditor} or | ||
* {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their | ||
* own methods and properties. | ||
* | ||
@@ -69,3 +76,3 @@ * @mixes module:utils/observablemixin~ObservableMixin | ||
*/ | ||
this.locale = new Locale( this.config.get( 'lang' ) ); | ||
this.locale = new Locale( this.config.get( 'language' ) ); | ||
@@ -81,22 +88,25 @@ /** | ||
/** | ||
* The editor's model document. | ||
* Defines whether this editor is in read-only mode. | ||
* | ||
* The center of the editor's abstract data model. The document contains | ||
* {@link module:engine/model/document~Document#getRoot all editing roots}, | ||
* {@link module:engine/model/document~Document#selection} and allows | ||
* applying changes to through the {@link module:engine/model/document~Document#batch batch interface}. | ||
* In read-only mode the editor {@link #commands commands} are disabled so it is not possible | ||
* to modify document using them. | ||
* | ||
* Besides the model document, the editor usually contains two controllers – | ||
* {@link #data data controller} and {@link #editing editing controller}. | ||
* The former is used e.g. when setting or retrieving editor data and contains a useful | ||
* set of methods for operating on the content. The latter controls user input and rendering | ||
* the content for editing. | ||
* @observable | ||
* @member {Boolean} #isReadOnly | ||
*/ | ||
this.set( 'isReadOnly', false ); | ||
/** | ||
* The editor's model. | ||
* | ||
* The center of the editor's abstract data model. | ||
* | ||
* @readonly | ||
* @member {module:engine/model/document~Document} | ||
* @member {module:engine/model/model~Model} | ||
*/ | ||
this.document = new Document(); | ||
this.model = new Model(); | ||
/** | ||
* The {@link module:engine/controller/datacontroller~DataController data controller}. | ||
* Used e.g. for setting or retrieving editor data. | ||
* | ||
@@ -106,27 +116,39 @@ * @readonly | ||
*/ | ||
this.data = new DataController( this.document ); | ||
this.data = new DataController( this.model ); | ||
/** | ||
* Defines whether this editor is in read-only mode. | ||
* The {@link module:engine/controller/editingcontroller~EditingController editing controller}. | ||
* Controls user input and rendering the content for editing. | ||
* | ||
* In read-only mode the editor {@link #commands commands} are disabled so it is not possible | ||
* to modify document using them. | ||
* | ||
* @observable | ||
* @member {Boolean} #isReadOnly | ||
* @readonly | ||
* @member {module:engine/controller/editingcontroller~EditingController} | ||
*/ | ||
this.set( 'isReadOnly', false ); | ||
this.editing = new EditingController( this.model ); | ||
this.editing.view.document.bind( 'isReadOnly' ).to( this ); | ||
/** | ||
* The {@link module:engine/controller/editingcontroller~EditingController editing controller}. | ||
* Conversion manager to which conversion dispatchers are registered. Used to add converters to the editor. | ||
* | ||
* This property is set by more specialized editor classes (such as {@link module:core/editor/standardeditor~StandardEditor}), | ||
* however, it's required for features to work as their engine-related parts will try to connect converters. | ||
* See {@link module:engine/conversion/conversion~Conversion#for} to learn how to use conversion helpers in order to | ||
* add converters to the editor. | ||
* | ||
* When defining a virtual editor class, like one working in Node.js, it's possible to plug a virtual | ||
* editing controller which only instantiates necessary properties, but without any observers and listeners. | ||
* @readonly | ||
* @member {module:engine/conversion/conversion~Conversion} | ||
*/ | ||
this.conversion = new Conversion(); | ||
this.conversion.register( 'downcast', [ this.editing.downcastDispatcher, this.data.downcastDispatcher ] ); | ||
this.conversion.register( 'editingDowncast', [ this.editing.downcastDispatcher ] ); | ||
this.conversion.register( 'dataDowncast', [ this.data.downcastDispatcher ] ); | ||
this.conversion.register( 'upcast', [ this.data.upcastDispatcher ] ); | ||
/** | ||
* Instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}. | ||
* | ||
* @readonly | ||
* @member {module:engine/controller/editingcontroller~EditingController} #editing | ||
* @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler} | ||
*/ | ||
this.keystrokes = new EditingKeystrokeHandler( this ); | ||
this.keystrokes.listenTo( this.editing.view.document ); | ||
} | ||
@@ -183,4 +205,6 @@ | ||
.then( () => { | ||
this.document.destroy(); | ||
this.model.destroy(); | ||
this.data.destroy(); | ||
this.editing.destroy(); | ||
this.keystrokes.destroy(); | ||
} ); | ||
@@ -236,8 +260,2 @@ } | ||
/** | ||
* Fired when the editor UI is ready. This event won't be fired if the editor has no UI. | ||
* | ||
* @event uiReady | ||
*/ | ||
/** | ||
* Fired when the data loaded to the editor is ready. If a specific editor doesn't load | ||
@@ -250,5 +268,11 @@ * any data initially, this event will be fired right before {@link #event:ready}. | ||
/** | ||
* Fired when {@link #event:pluginsReady plugins}, {@link #event:uiReady UI} and {@link #event:dataReady data} and all additional | ||
* Fired when {@link #event:pluginsReady plugins}, and {@link #event:dataReady data} and all additional | ||
* editor components are ready. | ||
* | ||
* Note: This event is most useful for plugin developers. When integrating the editor with your website or | ||
* application you do not have to listen to `editor#ready` because when the promise returned by the static | ||
* {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready. | ||
* In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback, | ||
* you cannot even add a listener to the `editor#ready` event. | ||
* | ||
* @event ready | ||
@@ -255,0 +279,0 @@ */ |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -27,2 +27,12 @@ */ | ||
* | ||
* Note that most editors implements {@link module:core/editor/editorwithui~EditorWithUI} interface in addition | ||
* to the base {@link module:core/editor/editor~Editor} interface. However, editors with external UI | ||
* (i.e. Bootstrap based) or headless editor may not implement {@link module:core/editor/editorwithui~EditorWithUI} | ||
* interface. | ||
* | ||
* Because of above, to make plugins more universal, it is recommended to split features into: | ||
* - "Editing" part which use only {@link module:core/editor/editor~Editor} interface, | ||
* - "UI" part which use both {@link module:core/editor/editor~Editor} interface and | ||
* {@link module:core/editor/editorwithui~EditorWithUI} interface. | ||
* | ||
* @readonly | ||
@@ -29,0 +39,0 @@ * @member {module:core/editor/editor~Editor} #editor |
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
@@ -58,3 +58,7 @@ */ | ||
/** | ||
* Collection iterator. Returns `[ PluginConstructor, pluginInstance ]` pairs. | ||
* Iterable interface. | ||
* | ||
* Returns `[ PluginConstructor, pluginInstance ]` pairs. | ||
* | ||
* @returns {Iterable.<Array>} | ||
*/ | ||
@@ -120,3 +124,3 @@ * [ Symbol.iterator ]() { | ||
* provide each plugin through reference (as a constructor function). Check out the examples in | ||
* {@glink builds/guides/integration/advanced-setup#Scenario-2-Building-from-source "Building from source"}. | ||
* {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"}. | ||
* | ||
@@ -123,0 +127,0 @@ * @error plugincollection-plugin-not-found |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
79375
67
1094
22