Skip to content

Commit

Permalink
Fix docs api (#6284)
Browse files Browse the repository at this point in the history
* Fix autogenerated docs API

* Move README

* Move LICENSE in core

* Create symlinks for README and LICENSE
  • Loading branch information
artf authored Oct 31, 2024
1 parent e369c03 commit c1a2ea5
Show file tree
Hide file tree
Showing 12 changed files with 237 additions and 277 deletions.
25 changes: 0 additions & 25 deletions LICENSE

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
174 changes: 0 additions & 174 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
20 changes: 5 additions & 15 deletions docs/api/canvas.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ canvas.setCoords(...);

* `canvas:dragend` When a drag operation is ended, `DataTransfer` instance passed as an argument.

`canvas:dragdata` On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments.
By changing `result.content` you're able to customize what is dropped.
------------------------------------------------------------------------
* `canvas:dragdata` On any dataTransfer parse, `DataTransfer` instance and the `result` are passed as arguments. By changing `result.content` you're able to customize what is dropped.

* `canvas:drop` Something is dropped in canvas, `DataTransfer` instance and the dropped model are passed as arguments.

Expand Down Expand Up @@ -92,39 +90,31 @@ editor.on('canvas:pointer', () => {
});
```

`canvas:refresh` Canvas was refreshed to update elements on top,
like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize).
--------------------------------------------------------------------------
* `canvas:refresh` Canvas was refreshed to update elements on top, like spots/tools (eg. via `editor.Canvas.refresh()` or on frame resize).

```javascript
editor.on('canvas:refresh', (canvasRefreshOptions) => {
console.log('Canvas refreshed with options:', canvasRefreshOptions);
});
```

`canvas:frame:load` Frame loaded in canvas.
The event is triggered right after iframe's `onload`.
-------------------------------------------------------
* `canvas:frame:load` Frame loaded in canvas. The event is triggered right after iframe's `onload`.

```javascript
editor.on('canvas:frame:load', ({ window }) => {
console.log('Frame loaded', window);
});
```

`canvas:frame:load:head` Frame head loaded in canvas.
The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)
---------------------------------------------------------------------------------------------
* `canvas:frame:load:head` Frame head loaded in canvas. The event is triggered right after iframe's finished to load the head elemenets (eg. scripts)

```javascript
editor.on('canvas:frame:load:head', ({ window }) => {
console.log('Frame head loaded', window);
});
```

`canvas:frame:load:body` Frame body loaded in canvas.
The event is triggered when the body is rendered with components.
-----------------------------------------------------------------
* `canvas:frame:load:body` Frame body loaded in canvas. The event is triggered when the body is rendered with components.

```javascript
editor.on('canvas:frame:load:body', ({ window }) => {
Expand Down
10 changes: 5 additions & 5 deletions docs/api/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ editor.on('command:run', ({ id, result, options }) => {
});
```

* `command:run:COMMAND\_ID` Triggered on run of a specific command.
* `command:run:COMMAND-ID` Triggered on run of a specific command.

```javascript
editor.on('command:run:my-command', ({ result, options }) => { ... });
```

* `command:run:before:COMMAND\_ID` Triggered before the command is called.
* `command:run:before:COMMAND-ID` Triggered before the command is called.

```javascript
editor.on('command:run:before:my-command', ({ options }) => { ... });
```

* `command:abort:COMMAND\_ID` Triggered when the command execution is aborted.
* `command:abort:COMMAND-ID` Triggered when the command execution is aborted.

```javascript
editor.on('command:abort:my-command', ({ options }) => { ... });
Expand All @@ -65,13 +65,13 @@ editor.on('command:stop', ({ id, result, options }) => {
});
```

* `command:stop:COMMAND\_ID` Triggered on stop of a specific command.
* `command:stop:COMMAND-ID` Triggered on stop of a specific command.

```javascript
editor.on('command:run:my-command', ({ result, options }) => { ... });
```

* `command:stop:before:COMMAND\_ID` Triggered before the command is called to stop.
* `command:stop:before:COMMAND-ID` Triggered before the command is called to stop.

```javascript
editor.on('command:stop:before:my-command', ({ options }) => { ... });
Expand Down
8 changes: 1 addition & 7 deletions docs/api/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,14 @@ cmp.addType(...);
## Methods

* [getWrapper][2]

* [getComponents][3]

* [addComponent][4]

* [clear][5]

* [addType][6]

* [getType][7]

* [getTypes][8]

* [Component]: component.html
[Component]: component.html

## getWrapper

Expand Down
28 changes: 7 additions & 21 deletions docs/api/storage_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ editor.on('storage:start', (type) => {
});
```

`storage:start:store` Storage store request start.
The project JSON object to store is passed as an argument (which you can edit).
-------------------------------------------------------------------------------
* `storage:start:store` Storage store request start. The project JSON object to store is passed as an argument (which you can edit).

```javascript
editor.on('storage:start:store', (data) => {
Expand All @@ -50,59 +48,47 @@ editor.on('storage:start:load', () => {
});
```

`storage:load` Storage loaded the project.
The loaded project is passed as an argument.
--------------------------------------------
* `storage:load` Storage loaded the project. The loaded project is passed as an argument.

```javascript
editor.on('storage:load', (data, res) => {
console.log('Storage loaded the project');
});
```

`storage:store` Storage stored the project.
The stored project is passed as an argument.
--------------------------------------------
* `storage:store` Storage stored the project. The stored project is passed as an argument.

```javascript
editor.on('storage:store', (data, res) => {
console.log('Storage stored the project');
});
```

`storage:after` Storage request completed.
Triggered right after `storage:load`/`storage:store`.
---------------------------------------------------------
* `storage:after` Storage request completed. Triggered right after `storage:load`/`storage:store`.

```javascript
editor.on('storage:after', (type) => {
console.log('Storage request completed');
});
```

`storage:end` Storage request ended.
This event triggers also in case of errors.
-------------------------------------------
* `storage:end` Storage request ended. This event triggers also in case of errors.

```javascript
editor.on('storage:end', (type) => {
console.log('Storage request ended');
});
```

`storage:end:store` Storage store request ended.
This event triggers also in case of errors.
-------------------------------------------
* `storage:end:store` Storage store request ended. This event triggers also in case of errors.

```javascript
editor.on('storage:end:store', () => {
console.log('Storage store request ended');
});
```

`storage:end:load` Storage load request ended.
This event triggers also in case of errors.
-------------------------------------------
* `storage:end:load` Storage load request ended. This event triggers also in case of errors.

```javascript
editor.on('storage:end:load', () => {
Expand Down
Loading

0 comments on commit c1a2ea5

Please sign in to comment.