diff --git a/docs/api/components.md b/docs/api/components.md index d0ab96276..851b4584e 100644 --- a/docs/api/components.md +++ b/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 diff --git a/docs/api/editor.md b/docs/api/editor.md index 1d9c8cb5b..d2e429137 100644 --- a/docs/api/editor.md +++ b/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`) diff --git a/docs/api/i18n.md b/docs/api/i18n.md index 3aa21acd5..ecb372580 100644 --- a/docs/api/i18n.md +++ b/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 diff --git a/docs/api/keymaps.md b/docs/api/keymaps.md index 269c66f14..dd1f8a58f 100644 --- a/docs/api/keymaps.md +++ b/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 diff --git a/docs/api/parser.md b/docs/api/parser.md index d818b9868..b2ef898ed 100644 --- a/docs/api/parser.md +++ b/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 diff --git a/docs/api/rich_text_editor.md b/docs/api/rich_text_editor.md index 6c094a63d..bd0b1dfd3 100644 --- a/docs/api/rich_text_editor.md +++ b/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 diff --git a/docs/api/selector_manager.md b/docs/api/selector_manager.md index ec4b6665a..8db28ad56 100644 --- a/docs/api/selector_manager.md +++ b/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 diff --git a/docs/api/undo_manager.md b/docs/api/undo_manager.md index 12acb6864..e83254fea 100644 --- a/docs/api/undo_manager.md +++ b/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 diff --git a/src/undo_manager/index.ts b/src/undo_manager/index.ts index 1b5b525d8..26b4e3c64 100644 --- a/src/undo_manager/index.ts +++ b/src/undo_manager/index.ts @@ -145,11 +145,10 @@ export default class UndoManagerModule extends Module