Browse Source

Update docs

pull/2362/head
Artur Arseniev 7 years ago
parent
commit
35bb143c6a
  1. 1
      docs/api/component.md
  2. 25
      docs/api/editor.md
  3. 2
      docs/api/rich_text_editor.md
  4. 5
      docs/api/style_manager.md

1
docs/api/component.md

@ -528,6 +528,7 @@ Set new id on the component
### Parameters
- `id` **[String][1]**
- `opts`
Returns **this**

25
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

2
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
}
})

5
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

Loading…
Cancel
Save