Skip to content

Commit

Permalink
Up API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Aug 7, 2023
1 parent 55a7a95 commit 839563f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/api/block_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ Return the Blocks container element

Returns **[HTMLElement][14]**

## getDragBlock

Returns currently dragging block.
Updated when the drag starts and cleared once it's done.

Returns **([Block] | [undefined][15])**

## render

Render blocks
Expand All @@ -160,8 +167,8 @@ Render blocks
* `blocks` **[Array][13]** Blocks to render, without the argument will render all global blocks
* `opts` **[Object][11]** Options (optional, default `{}`)

* `opts.external` **[Boolean][15]?** Render blocks in a new container (HTMLElement will be returned)
* `opts.ignoreCategories` **[Boolean][15]?** Render blocks without categories
* `opts.external` **[Boolean][16]?** Render blocks in a new container (HTMLElement will be returned)
* `opts.ignoreCategories` **[Boolean][16]?** Render blocks without categories

### Examples

Expand Down Expand Up @@ -217,4 +224,6 @@ Returns **[HTMLElement][14]** Rendered element

[14]: https://developer.mozilla.org/docs/Web/HTML/Element

[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[15]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined

[16]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
9 changes: 9 additions & 0 deletions docs/api/canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Set canvas position coordinates

* `x` **[Number][22]** Horizontal position
* `y` **[Number][22]** Vertical position
* `opts` **ToWorldOption** (optional, default `{}`)

### Examples

Expand Down Expand Up @@ -233,6 +234,12 @@ canvas.addFrame({

Returns **[Frame]**

## getLastDragResult

Get the last created Component from a drag & drop to the canvas.

Returns **([Component] | [undefined][23])**

[1]: https://github.com/GrapesJS/grapesjs/blob/master/src/canvas/config/config.ts

[2]: #getconfig
Expand Down Expand Up @@ -276,3 +283,5 @@ Returns **[Frame]**
[21]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean

[22]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined

0 comments on commit 839563f

Please sign in to comment.