Browse Source

Up docs

pull/4849/head
Artur Arseniev 3 years ago
parent
commit
965a626358
  1. 2
      docs/api/components.md
  2. 4
      docs/api/editor.md
  3. 38
      docs/api/i18n.md
  4. 4
      docs/api/keymaps.md
  5. 10
      docs/api/parser.md
  6. 22
      docs/api/rich_text_editor.md
  7. 2
      docs/api/selector_manager.md
  8. 11
      docs/api/undo_manager.md
  9. 9
      src/undo_manager/index.ts

2
docs/api/components.md

@ -200,7 +200,7 @@ Return the array of all types
Returns **[Array][11]**
[1]: https://github.com/artf/grapesjs/blob/master/src/dom_components/config/config.js
[1]: https://github.com/artf/grapesjs/blob/master/src/dom_components/config/config.ts
[2]: #getwrapper

4
docs/api/editor.md

@ -210,7 +210,7 @@ Set style inside editor's canvas. This method overrides actual style
### Parameters
* `style` **([Array][19]<[Object][16]> | [Object][16] | [string][18])** CSS string or style model
* `opt` (optional, default `{}`)
* `opt` **any** (optional, default `{}`)
### Examples
@ -502,7 +502,7 @@ refresh you'll get misleading position of tools
### Parameters
* `opts` **any?**
* `opts` **{tools: [boolean][17]?}?**
* `options` **[Object][16]?** Options
* `options.tools` **[Boolean][17]** Update the position of tools (eg. rich text editor, component highlighter, etc.) (optional, default `false`)

38
docs/api/i18n.md

@ -29,19 +29,13 @@ const i18n = editor.I18n;
* `i18n:update` - The set of messages is updated
* `i18n:locale` - Locale changed
## getConfig
Get module configurations
Returns **[Object][2]** Configuration object
## setLocale
Update current locale
### Parameters
* `locale` **[String][3]** Locale value
* `locale` **[String][2]** Locale value
### Examples
@ -55,7 +49,7 @@ Returns **this**
Get current locale
Returns **[String][3]** Current locale value
Returns **[String][2]** Current locale value
## getMessages
@ -63,8 +57,8 @@ Get all messages
### Parameters
* `lang` **[String][3]?** Specify the language of messages to return
* `opts` **[Object][2]?** Options (optional, default `{}`)
* `lang` **[String][2]?** Specify the language of messages to return
* `opts` **[Object][3]?** Options (optional, default `{}`)
* `opts.debug` **[Boolean][4]?** Show warnings in case of missing language
@ -77,7 +71,7 @@ i18n.getMessages('en');
// -> { hello: '...' }
```
Returns **[Object][2]**
Returns **[Object][3]**
## setMessages
@ -85,7 +79,7 @@ Set new set of messages
### Parameters
* `msg` **[Object][2]** Set of messages
* `msg` **[Object][3]** Set of messages
### Examples
@ -106,7 +100,7 @@ Update messages
### Parameters
* `msg` **[Object][2]** Set of messages to add
* `msg` **[Object][3]** Set of messages to add
### Examples
@ -127,10 +121,10 @@ Translate the locale message
### Parameters
* `key` **[String][3]** Label to translate
* `opts` **[Object][2]?** Options for the translation (optional, default `{}`)
* `key` **[String][2]** Label to translate
* `opts` **[Object][3]?** Options for the translation (optional, default `{}`)
* `opts.params` **[Object][2]?** Params for the translation
* `opts.params` **[Object][3]?** Params for the translation
* `opts.debug` **[Boolean][4]?** Show warnings in case of missing resources
### Examples
@ -148,12 +142,18 @@ obj.t('msg2', { l: 'it', params: { test: 'hello' } }); // custom local
// -> outputs `Msg hello it`
```
Returns **[String][3]**
Returns **[String][2]**
## getConfig
Get configuration object
Returns **[Object][3]**
[1]: https://github.com/artf/grapesjs/blob/master/src/i18n/config.ts
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

4
docs/api/keymaps.md

@ -48,9 +48,9 @@ keymaps.add(...);
## getConfig
Get module configurations
Get configuration object
Returns **[Object][7]** Configuration object
Returns **[Object][7]**
## add

10
docs/api/parser.md

@ -31,15 +31,9 @@ const { Parser } = editor;
## getConfig
Get the configuration object
Get configuration object
### Examples
```javascript
console.log(Parser.getConfig())
```
Returns **[Object][5]** Configuration object
Returns **[Object][5]**
## parseHtml

22
docs/api/rich_text_editor.md

@ -39,14 +39,20 @@ rte.add(...);
* [remove][6]
* [getToolbarEl][7]
## getConfig
Get configuration object
Returns **[Object][8]**
## add
Add a new action to the built-in RTE toolbar
### Parameters
* `name` **[string][8]** Action name
* `action` **[Object][9]** Action options (optional, default `{}`)
* `name` **[string][9]** Action name
* `action` **[Object][8]** Action options (optional, default `{}`)
### Examples
@ -114,7 +120,7 @@ Get the action by its name
### Parameters
* `name` **[string][8]** Action name
* `name` **[string][9]** Action name
### Examples
@ -123,7 +129,7 @@ const action = rte.get('bold');
// {name: 'bold', ...}
```
Returns **[Object][9]**
Returns **[Object][8]**
## getAll
@ -137,7 +143,7 @@ Remove the action from the toolbar
### Parameters
* `name` **[string][8]**
* `name` **[string][9]**
### Examples
@ -146,7 +152,7 @@ const action = rte.remove('bold');
// {name: 'bold', ...}
```
Returns **[Object][9]** Removed action
Returns **[Object][8]** Removed action
## getToolbarEl
@ -168,9 +174,9 @@ Returns **[HTMLElement][11]**
[7]: #gettoolbarel
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

2
docs/api/selector_manager.md

@ -134,7 +134,7 @@ Remove Selector.
### Parameters
* `selector` **([String][18] | [Selector])** Selector instance or Selector string identifier
* `opts` **any?**
* `opts` **RemoveOptions?**
### Examples

11
docs/api/undo_manager.md

@ -26,16 +26,9 @@ const um = editor.UndoManager;
## getConfig
Get module configurations
Get configuration object
### Examples
```javascript
const config = um.getConfig();
// { ... }
```
Returns **[Object][15]** Configuration object
Returns **[Object][15]**
## add

9
src/undo_manager/index.ts

@ -145,11 +145,10 @@ export default class UndoManagerModule extends Module<UndoManagerConfig & { name
}
/**
* Get module configurations
* @return {Object} Configuration object
* @example
* const config = um.getConfig();
* // { ... }
* Get configuration object
* @name getConfig
* @function
* @return {Object}
*/
/**

Loading…
Cancel
Save