From 3120e84a0c904ee87d6c4bf0d4c5b2d3876ab4c2 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 24 Oct 2020 15:47:30 +0200 Subject: [PATCH] Update docs --- docs/api/block_manager.md | 8 ++++++++ docs/api/component.md | 9 +++++++++ docs/api/editor.md | 19 +++++++++++++++++++ docs/api/modal_dialog.md | 1 + 4 files changed, 37 insertions(+) diff --git a/docs/api/block_manager.md b/docs/api/block_manager.md index 4e79a6598..76058db0b 100644 --- a/docs/api/block_manager.md +++ b/docs/api/block_manager.md @@ -114,6 +114,14 @@ Remove a block by id - `id` **[string][12]** Block id +### Examples + +```javascript +// Id of the block which need to be removed +const id = 'button'; +blockManager.remove(id); +``` + Returns **Block** Removed block ## getCategories diff --git a/docs/api/component.md b/docs/api/component.md index bcd369e51..4b1c70208 100644 --- a/docs/api/component.md +++ b/docs/api/component.md @@ -548,6 +548,14 @@ component.toHTML({ Returns **[String][1]** HTML string +## getChangedProps + +Return an object containing only changed props + +### Parameters + +- `res` + ## getId Return the component id @@ -632,6 +640,7 @@ This method is used in Components.js just after the parsing - `components` - `styles` (optional, default `[]`) - `list` (optional, default `{}`) +- `opts` (optional, default `{}`) [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/docs/api/editor.md b/docs/api/editor.md index eed39dbf6..ff1d4ca68 100644 --- a/docs/api/editor.md +++ b/docs/api/editor.md @@ -111,6 +111,11 @@ editor.on('EVENT-NAME', (some, argument) => { - `modal:open` - Modal is opened - `modal:close` - Modal is closed +### Parser + +- `parse:html` - On HTML parse, an object containing the input and the output of the parser is passed as an argument +- `parse:css` - On CSS parse, an object containing the input and the output of the parser is passed as an argument + ### Commands - `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) @@ -446,6 +451,20 @@ This count resets at any `store()` Returns **[number][10]** +## refresh + +Update editor dimension offsets + +This method could be useful when you update, for example, some position +of the editor element (eg. canvas, panels, etc.) with CSS, where without +refresh you'll get misleading position of tools + +### Parameters + +- `opts` +- `options` **[Object][3]?** Options + - `options.tools` **[Boolean][4]** Update the position of tools (eg. rich text editor, component highlighter, etc.) (optional, default `false`) + ## setCustomRte Replace the built-in Rich Text Editor with a custom one. diff --git a/docs/api/modal_dialog.md b/docs/api/modal_dialog.md index e3ff89dbb..c33f33953 100644 --- a/docs/api/modal_dialog.md +++ b/docs/api/modal_dialog.md @@ -37,6 +37,7 @@ Open the modal window - `opts` **[Object][11]** Options (optional, default `{}`) - `opts.title` **([String][12] \| [HTMLElement][13])?** Title to set for the modal - `opts.content` **([String][12] \| [HTMLElement][13])?** Content to set for the modal + - `opts.attributes` **[Object][11]?** Updates the modal wrapper with custom attributes Returns **this**