From 35bb143c6aab80b34a6509a89e00b931de6d5414 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 18 Sep 2019 07:55:02 +0200 Subject: [PATCH] Update docs --- docs/api/component.md | 1 + docs/api/editor.md | 25 +++++++++++++------------ docs/api/rich_text_editor.md | 2 +- docs/api/style_manager.md | 5 ++++- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/api/component.md b/docs/api/component.md index 802431389..1f396fb08 100644 --- a/docs/api/component.md +++ b/docs/api/component.md @@ -528,6 +528,7 @@ Set new id on the component ### Parameters - `id` **[String][1]** +- `opts` Returns **this** diff --git a/docs/api/editor.md b/docs/api/editor.md index 430377ece..8bca570d0 100644 --- a/docs/api/editor.md +++ b/docs/api/editor.md @@ -151,6 +151,7 @@ Returns CSS built inside canvas ### Parameters - `opts` **[Object][3]** Options (optional, default `{}`) + - `opts.avoidProtected` **[Boolean][4]** Don't include protected CSS (optional, default `false`) Returns **[string][2]** CSS string @@ -178,7 +179,7 @@ Set components inside editor's canvas. This method overrides actual components ### Parameters -- `components` **([Array][4]<[Object][3]> | [Object][3] \| [string][2])** HTML string or components model +- `components` **([Array][5]<[Object][3]> | [Object][3] \| [string][2])** HTML string or components model ### Examples @@ -200,9 +201,9 @@ Add components ### Parameters -- `components` **([Array][4]<[Object][3]> | [Object][3] \| [string][2])** HTML string or components model +- `components` **([Array][5]<[Object][3]> | [Object][3] \| [string][2])** HTML string or components model - `opts` **[Object][3]** Options - - `opts.avoidUpdateStyle` **[Boolean][5]** If the HTML string contains styles, + - `opts.avoidUpdateStyle` **[Boolean][4]** If the HTML string contains styles, by default, they will be created and, if already exist, updated. When this option is true, styles already created will not be updated. (optional, default `false`) @@ -218,7 +219,7 @@ editor.addComponents({ }); ``` -Returns **[Array][4]<Component>** +Returns **[Array][5]<Component>** ## getStyle @@ -232,7 +233,7 @@ Set style inside editor's canvas. This method overrides actual style ### Parameters -- `style` **([Array][4]<[Object][3]> | [Object][3] \| [string][2])** CSS string or style model +- `style` **([Array][5]<[Object][3]> | [Object][3] \| [string][2])** CSS string or style model ### Examples @@ -257,7 +258,7 @@ Returns **Model** Returns an array of all selected components -Returns **[Array][4]** +Returns **[Array][5]** ## getSelectedToStyle @@ -277,7 +278,7 @@ Select a component - `el` **(Component | [HTMLElement][6])** Component to select - `opts` **[Object][3]?** Options - - `opts.scroll` **[Boolean][5]?** Scroll canvas to the selected element + - `opts.scroll` **[Boolean][4]?** Scroll canvas to the selected element ### Examples @@ -296,7 +297,7 @@ Add component to selection ### Parameters -- `el` **(Component | [HTMLElement][6] \| [Array][4])** Component to select +- `el` **(Component | [HTMLElement][6] \| [Array][5])** Component to select ### Examples @@ -312,7 +313,7 @@ Remove component from selection ### Parameters -- `el` **(Component | [HTMLElement][6] \| [Array][4])** Component to select +- `el` **(Component | [HTMLElement][6] \| [Array][5])** Component to select ### Examples @@ -328,7 +329,7 @@ Toggle component selection ### Parameters -- `el` **(Component | [HTMLElement][6] \| [Array][4])** Component to select +- `el` **(Component | [HTMLElement][6] \| [Array][5])** Component to select ### Examples @@ -596,9 +597,9 @@ Returns **[HTMLElement][6]** [3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array [6]: https://developer.mozilla.org/docs/Web/HTML/Element diff --git a/docs/api/rich_text_editor.md b/docs/api/rich_text_editor.md index 408043df7..5c661cd41 100644 --- a/docs/api/rich_text_editor.md +++ b/docs/api/rich_text_editor.md @@ -9,7 +9,7 @@ You can customize the initial state of the module from the editor initialization ```js const editor = grapesjs.init({ - rte: { + richTextEditor: { // options } }) diff --git a/docs/api/style_manager.md b/docs/api/style_manager.md index 0d4b7f0b5..2d735f0ae 100644 --- a/docs/api/style_manager.md +++ b/docs/api/style_manager.md @@ -130,6 +130,8 @@ Add property to the sector identified by id - `property.properties` **[Array][19]<[Object][16]>** Nested properties for composite and stack type (optional, default `[]`) - `property.layers` **[Array][19]<[Object][16]>** Layers for stack properties (optional, default `[]`) - `property.list` **[Array][19]<[Object][16]>** List of possible options for radio and select types (optional, default `[]`) +- `opts` (optional, default `{}`) +- `options` **[Object][16]** Options (optional, default `{}`) ### Examples @@ -146,7 +148,8 @@ var property = styleManager.addProperty('mySector',{ value: '200px', name: '200', }], -}); +}, { at: 0 }); +// With `at: 0` we place the new property at the beginning of the collection ``` Returns **(Property | null)** Added Property or `null` in case sector doesn't exist