Commit bc9da6a3 authored by Piotrek Koszuliński's avatar Piotrek Koszuliński

Other: Renamed the export name from `DecoupledDocumentEditor` to `DecoupledEditor`. Closes #6.

BREAKING CHANGES: The global variable exported by the build is now called `DecoupledEditor` instead of `DecoupledDocumentEditor`. See #6.
parent 7b4aef11
......@@ -33,7 +33,7 @@ And use it in your website:
</div>
<script src="./node_modules/@ckeditor/ckeditor5-build-decoupled-document/build/ckeditor.js"></script>
<script>
DecoupledDocumentEditor
DecoupledEditor
.create( '<h2>Hello world!</h2>', {
toolbarContainer: document.querySelector( '.toolbar-container' ),
editableContainer: document.querySelector( '.editable-container' )
......@@ -50,12 +50,12 @@ And use it in your website:
Or in your JavaScript application:
```js
import DecoupledDocumentEditor from '@ckeditor/ckeditor5-build-decoupled-document';
import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document';
// Or using the CommonJS version:
// const DecoupledDocumentEditor = require( '@ckeditor/ckeditor5-build-decoupled-document' );
// const DecoupledEditor = require( '@ckeditor/ckeditor5-build-decoupled-document' );
DecoupledDocumentEditor
DecoupledEditor
.create( '<h2>Hello world!</h2>', {
toolbarContainer: document.querySelector( '.toolbar-container' ),
editableContainer: document.querySelector( '.editable-container' )
......
......@@ -10,7 +10,7 @@ module.exports = {
editor: '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor',
// The name under which the editor will be exported.
moduleName: 'DecoupledDocumentEditor',
moduleName: 'DecoupledEditor',
// Plugins to include in the build.
plugins: [
......
......@@ -57,7 +57,7 @@
</figure>
<p>You can use this sample to validate whether your <a href="https://docs.ckeditor.com/ckeditor5/latest/builds/guides/development/custom-builds.html">custom build</a> works fine.</p>`;
DecoupledDocumentEditor.create( editorData )
DecoupledEditor.create( editorData )
.then( editor => {
window.editor = editor;
......
......@@ -3,7 +3,7 @@
* For licensing, see LICENSE.md.
*/
import DecoupledDocumentEditorBase from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor';
import DecoupledEditorBase from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor';
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials';
import AlignmentPlugin from '@ckeditor/ckeditor5-alignment/src/alignment';
import FontsizePlugin from '@ckeditor/ckeditor5-font/src/fontsize';
......@@ -27,9 +27,9 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link';
import ListPlugin from '@ckeditor/ckeditor5-list/src/list';
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph';
export default class DecoupledDocumentEditor extends DecoupledDocumentEditorBase {}
export default class DecoupledEditor extends DecoupledEditorBase {}
DecoupledDocumentEditor.build = {
DecoupledEditor.build = {
plugins: [
EssentialsPlugin,
AlignmentPlugin,
......
......@@ -5,10 +5,10 @@
/* globals document */
import DecoupledDocumentEditor from '../src/ckeditor';
import DecoupledEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor';
import DecoupledEditor from '../src/ckeditor';
import BaseDecoupledEditor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor';
describe( 'DecoupledDocumentEditor build', () => {
describe( 'DecoupledEditor build', () => {
let editor, editorData, editorElement;
beforeEach( () => {
......@@ -27,11 +27,11 @@ describe( 'DecoupledDocumentEditor build', () => {
describe( 'buid', () => {
it( 'contains plugins', () => {
expect( DecoupledDocumentEditor.build.plugins ).to.not.be.empty;
expect( DecoupledEditor.build.plugins ).to.not.be.empty;
} );
it( 'contains config', () => {
expect( DecoupledDocumentEditor.build.config.toolbar ).to.not.be.empty;
expect( DecoupledEditor.build.config.toolbar ).to.not.be.empty;
} );
} );
......@@ -39,7 +39,7 @@ describe( 'DecoupledDocumentEditor build', () => {
test( () => editorData );
it( 'does not define the UI DOM structure', () => {
return DecoupledDocumentEditor.create( editorData )
return DecoupledEditor.create( editorData )
.then( newEditor => {
expect( newEditor.ui.view.element ).to.be.null;
expect( newEditor.ui.view.toolbar.element.parentElement ).to.be.null;
......@@ -52,7 +52,7 @@ describe( 'DecoupledDocumentEditor build', () => {
test( () => editorElement );
it( 'uses the provided editable element', () => {
return DecoupledDocumentEditor.create( editorElement )
return DecoupledEditor.create( editorElement )
.then( newEditor => {
expect( newEditor.ui.view.editable.element.parentElement ).to.equal( document.body );
} );
......@@ -62,7 +62,7 @@ describe( 'DecoupledDocumentEditor build', () => {
function test( getEditorDataOrElement ) {
describe( 'create()', () => {
beforeEach( () => {
return DecoupledDocumentEditor.create( getEditorDataOrElement() )
return DecoupledEditor.create( getEditorDataOrElement() )
.then( newEditor => {
editor = newEditor;
} );
......@@ -72,9 +72,9 @@ describe( 'DecoupledDocumentEditor build', () => {
return editor.destroy();
} );
it( 'creates an instance which inherits from the DecoupledDocumentEditor', () => {
expect( editor ).to.be.instanceof( DecoupledDocumentEditor );
expect( editor ).to.be.instanceof( DecoupledEditor );
it( 'creates an instance which inherits from the DecoupledEditor', () => {
expect( editor ).to.be.instanceof( BaseDecoupledEditor );
expect( editor ).to.be.instanceof( BaseDecoupledEditor );
} );
it( 'loads passed data', () => {
......@@ -84,7 +84,7 @@ describe( 'DecoupledDocumentEditor build', () => {
describe( 'destroy()', () => {
beforeEach( () => {
return DecoupledDocumentEditor.create( getEditorDataOrElement() )
return DecoupledEditor.create( getEditorDataOrElement() )
.then( newEditor => {
editor = newEditor;
} );
......@@ -93,7 +93,7 @@ describe( 'DecoupledDocumentEditor build', () => {
describe( 'plugins', () => {
beforeEach( () => {
return DecoupledDocumentEditor.create( getEditorDataOrElement() )
return DecoupledEditor.create( getEditorDataOrElement() )
.then( newEditor => {
editor = newEditor;
} );
......@@ -212,7 +212,7 @@ describe( 'DecoupledDocumentEditor build', () => {
// https://github.com/ckeditor/ckeditor5/issues/572
it( 'allows configure toolbar items through config.toolbar', () => {
return DecoupledDocumentEditor
return DecoupledEditor
.create( getEditorDataOrElement(), {
toolbar: [ 'bold' ]
} )
......
......@@ -3,9 +3,9 @@
* For licensing, see LICENSE.md.
*/
const DecoupledDocumentEditor = require( '../../build/ckeditor' );
const DecoupledEditor = require( '../../build/ckeditor' );
DecoupledDocumentEditor.create( document.querySelector( '#editor' ) )
DecoupledEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
document.querySelector( '.toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
......
......@@ -3,9 +3,9 @@
* For licensing, see LICENSE.md.
*/
import DecoupledDocumentEditor from '../../build/ckeditor';
import DecoupledEditor from '../../build/ckeditor';
DecoupledDocumentEditor.create( document.querySelector( '#editor' ) )
DecoupledEditor.create( document.querySelector( '#editor' ) )
.then( editor => {
document.querySelector( '.toolbar-container' ).appendChild( editor.ui.view.toolbar.element );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment