From 8641c2bba694311e5c20b8d4b9645e777287389a Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 14 Aug 2021 00:47:03 +0200 Subject: [PATCH] Add Block API Reference --- docs/.vuepress/config.js | 1 + docs/api.js | 1 + docs/api/block.md | 26 +++++++++++++++ docs/api/canvas.md | 56 ++++++++++++++++++-------------- src/block_manager/model/Block.js | 46 +++++++++++++++----------- src/common/Collection.js | 1 + src/common/Model.js | 1 + src/common/index.js | 2 ++ 8 files changed, 90 insertions(+), 44 deletions(-) create mode 100644 docs/api/block.md create mode 100644 src/common/Collection.js create mode 100644 src/common/Model.js create mode 100644 src/common/index.js diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 860bc5c16..1a235b67f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -62,6 +62,7 @@ module.exports = { ['/api/canvas', 'Canvas'], ['/api/assets', 'Asset Manager'], ['/api/block_manager', 'Block Manager'], + ['/api/block', `${subDivider}Block`], ['/api/commands', 'Commands'], ['/api/components', 'DOM Components'], ['/api/component', `${subDivider}Component`], diff --git a/docs/api.js b/docs/api.js index 6fa9290bb..2867f078c 100644 --- a/docs/api.js +++ b/docs/api.js @@ -14,6 +14,7 @@ async function generateDocs () { ['editor/index.js', 'editor.md'], ['asset_manager/index.js', 'assets.md'], ['block_manager/index.js', 'block_manager.md'], + ['block_manager/model/Block.js', 'block.md'], ['commands/index.js', 'commands.md'], ['dom_components/index.js', 'components.md'], ['dom_components/model/Component.js', 'component.md'], diff --git a/docs/api/block.md b/docs/api/block.md new file mode 100644 index 000000000..377b4acae --- /dev/null +++ b/docs/api/block.md @@ -0,0 +1,26 @@ + + +## Block + + + +### Properties + +* `label` **[String][1]?** Block label, eg. `My block` +* `activate` **[Boolean][2]?** If true, triggers an the 'active' event on dropped component +* `select` **[Boolean][2]?** If true, the dropped component will be selected +* `resetId` **[Boolean][2]?** If true, all IDs of dropped components and their styles will be changed +* `disable` **[Boolean][2]?** Disable the drag of the block +* `media` **[String][1]?** HTML string for the media/icon of the block, eg. `