|
|
@@ -17,23 +17,40 @@ import setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement
|
|
|
import '../theme/theme.scss';
|
|
|
|
|
|
/**
|
|
|
- * {@glink builds/guides/overview#Balloon-editor Balloon editor} - Uses an inline editable and a toolbar based
|
|
|
- * on the {@link module:ui/toolbar/contextual/contextualtoolbar~ContextualToolbar}.
|
|
|
+ * The {@glink builds/guides/overview#Balloon-editor balloon editor} implementation (Medium-like editor).
|
|
|
+ * It uses an inline editable and a toolbar based on the {@link module:ui/toolbar/contextual/contextualtoolbar~ContextualToolbar}.
|
|
|
+ * See the {@glink examples/builds/balloon-editor demo}.
|
|
|
*
|
|
|
- * In order to create a Balloon editor, use the
|
|
|
+ * In order to create a balloon editor instance, use the static
|
|
|
* {@link module:editor-balloon/ballooneditor~BalloonEditor#create `BalloonEditor.create()`} method.
|
|
|
*
|
|
|
+ * # Balloon editor and balloon build
|
|
|
+ *
|
|
|
+ * The balloon editor can be used directly from source (if you installed the
|
|
|
+ * [`@ckeditor/ckeditor5-editor-balloon`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-balloon) package)
|
|
|
+ * but it is also available in the {@glink builds/guides/overview#Balloon-editor balloon build}.
|
|
|
+ *
|
|
|
+ * {@glink builds/guides/overview Builds} are ready-to-use editors with plugins bundled in. When using the editor from
|
|
|
+ * source you need to take care of loading all plugins by yourself
|
|
|
+ * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
|
|
+ * Using the editor from source gives much better flexibility and allows easier customization.
|
|
|
+ *
|
|
|
+ * Read more about initializing the editor from source or as a build in
|
|
|
+ * {@link module:editor-balloon/ballooneditor~BalloonEditor#create `BalloonEditor.create()`}.
|
|
|
+ *
|
|
|
* @extends module:core/editor/standardeditor~StandardEditor
|
|
|
*/
|
|
|
export default class BalloonEditor extends StandardEditor {
|
|
|
/**
|
|
|
* Creates an instance of the balloon editor.
|
|
|
*
|
|
|
- * <strong>Note:</strong> do not use the constructor to create editor instances. Use static
|
|
|
- * {@link module:editor-balloon/ballooneditor~BalloonEditor#create BalloonEditor.create()} method instead.
|
|
|
+ * **Note:** do not use the constructor to create editor instances. Use the static
|
|
|
+ * {@link module:editor-balloon/ballooneditor~BalloonEditor#create `BalloonEditor.create()`} method instead.
|
|
|
*
|
|
|
- * @param {HTMLElement} element The DOM element that will be the source for the created editor.
|
|
|
- * @param {Object} config The editor configuration.
|
|
|
+ * @protected
|
|
|
+ * @param {HTMLElement} element The DOM element that will be the source for the created editor
|
|
|
+ * (on which the editor will be initialized).
|
|
|
+ * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
|
|
|
*/
|
|
|
constructor( element, config ) {
|
|
|
super( element, config );
|
|
|
@@ -98,10 +115,11 @@ export default class BalloonEditor extends StandardEditor {
|
|
|
* console.error( err.stack );
|
|
|
* } );
|
|
|
*
|
|
|
- * @param {HTMLElement} element See {@link #constructor}'s parameters.
|
|
|
- * @param {Object} config See {@link #constructor}'s parameters.
|
|
|
+ * @param {HTMLElement} element The DOM element that will be the source for the created editor
|
|
|
+ * (on which the editor will be initialized).
|
|
|
+ * @param {module:core/editor/editorconfig~EditorConfig} config The editor configuration.
|
|
|
* @returns {Promise} A promise resolved once the editor is ready.
|
|
|
- * @returns {module:core/editor/standardeditor~StandardEditor} return.editor The editor instance.
|
|
|
+ * The promise returns the created {@link module:editor-balloon/ballooneditor~BalloonEditor} instance.
|
|
|
*/
|
|
|
static create( element, config ) {
|
|
|
return new Promise( resolve => {
|