|
@@ -16,7 +16,10 @@ import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement
|
|
|
import '../theme/theme.scss';
|
|
import '../theme/theme.scss';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Inline editor. Uses an inline editable and a floating toolbar.
|
|
|
|
|
|
|
+ * {@glink builds/guides/overview#Inline-editor Inline editor} - uses an inline editable and a floating toolbar.
|
|
|
|
|
+ *
|
|
|
|
|
+ * In order to create an Inline editor, use the
|
|
|
|
|
+ * {@link module:editor-inline/inlineeditor~InlineEditor#create InlineEditor.create()} method.
|
|
|
*
|
|
*
|
|
|
* @extends module:core/editor/standardeditor~StandardEditor
|
|
* @extends module:core/editor/standardeditor~StandardEditor
|
|
|
*/
|
|
*/
|
|
@@ -24,6 +27,9 @@ export default class InlineEditor extends StandardEditor {
|
|
|
/**
|
|
/**
|
|
|
* Creates an instance of the inline editor.
|
|
* Creates an instance of the inline editor.
|
|
|
*
|
|
*
|
|
|
|
|
+ * <strong>Note:</strong> do not use the constructor to create editor instances. Use static
|
|
|
|
|
+ * {@link module:editor-inline/inlineeditor~InlineEditor#create `InlineEditor.create()`} method instead.
|
|
|
|
|
+ *
|
|
|
* @param {HTMLElement} element The DOM element that will be the source for the created editor.
|
|
* @param {HTMLElement} element The DOM element that will be the source for the created editor.
|
|
|
* @param {Object} config The editor configuration.
|
|
* @param {Object} config The editor configuration.
|
|
|
*/
|
|
*/
|
|
@@ -56,16 +62,36 @@ export default class InlineEditor extends StandardEditor {
|
|
|
/**
|
|
/**
|
|
|
* Creates an inline editor instance.
|
|
* Creates an inline editor instance.
|
|
|
*
|
|
*
|
|
|
- * InlineEditor.create( document.querySelector( '#editor' ), {
|
|
|
|
|
- * plugins: [ Delete, Enter, Typing, Paragraph, Undo, Bold, Italic ],
|
|
|
|
|
- * toolbar: [ 'bold', 'italic', 'undo', 'redo' ]
|
|
|
|
|
- * } )
|
|
|
|
|
- * .then( editor => {
|
|
|
|
|
- * console.log( 'Editor was initialized', editor );
|
|
|
|
|
- * } )
|
|
|
|
|
- * .catch( err => {
|
|
|
|
|
- * console.error( err.stack );
|
|
|
|
|
- * } );
|
|
|
|
|
|
|
+ * Creating instance when using {@glink builds/index CKEditor build}:
|
|
|
|
|
+ *
|
|
|
|
|
+ * InlineEditor
|
|
|
|
|
+ * .create( document.querySelector( '#editor' ) )
|
|
|
|
|
+ * .then( editor => {
|
|
|
|
|
+ * console.log( 'Editor was initialized', editor );
|
|
|
|
|
+ * } )
|
|
|
|
|
+ * .catch( err => {
|
|
|
|
|
+ * console.error( err.stack );
|
|
|
|
|
+ * } );
|
|
|
|
|
+ *
|
|
|
|
|
+ * Creating instance when using CKEditor from source (make sure to specify the list of plugins to load and the toolbar):
|
|
|
|
|
+ *
|
|
|
|
|
+ * import InlineEditor from '@ckeditor/ckeditor5-editor-inline/src/inlineeditor';
|
|
|
|
|
+ * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
|
|
|
|
|
+ * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
|
|
|
|
|
+ * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
|
|
|
|
|
+ * import ...
|
|
|
|
|
+ *
|
|
|
|
|
+ * InlineEditor
|
|
|
|
|
+ * .create( document.querySelector( '#editor' ), {
|
|
|
|
|
+ * plugins: [ Essentials, Bold, Italic, ... ],
|
|
|
|
|
+ * toolbar: [ 'bold', 'italic', ... ]
|
|
|
|
|
+ * } )
|
|
|
|
|
+ * .then( editor => {
|
|
|
|
|
+ * console.log( 'Editor was initialized', editor );
|
|
|
|
|
+ * } )
|
|
|
|
|
+ * .catch( err => {
|
|
|
|
|
+ * console.error( err.stack );
|
|
|
|
|
+ * } );
|
|
|
*
|
|
*
|
|
|
* @param {HTMLElement} element See {@link module:editor-inline/inlineeditor~InlineEditor#constructor}'s parameters.
|
|
* @param {HTMLElement} element See {@link module:editor-inline/inlineeditor~InlineEditor#constructor}'s parameters.
|
|
|
* @param {Object} config See {@link module:editor-inline/inlineeditor~InlineEditor#constructor}'s parameters.
|
|
* @param {Object} config See {@link module:editor-inline/inlineeditor~InlineEditor#constructor}'s parameters.
|