mirror of https://github.com/artf/grapesjs.git
committed by
GitHub
10 changed files with 149 additions and 41 deletions
@ -0,0 +1,66 @@ |
|||
/**{START_EVENTS}*/ |
|||
export enum EditorEvents { |
|||
/** |
|||
* @event `update` Event triggered on any change of the project (eg. component added/removed, style changes, etc.) |
|||
* @example |
|||
* editor.on('update', () => { ... }); |
|||
*/ |
|||
update = 'update', |
|||
|
|||
/** |
|||
* @event `undo` Undo executed. |
|||
* @example |
|||
* editor.on('undo', () => { ... }); |
|||
*/ |
|||
undo = 'undo', |
|||
|
|||
/** |
|||
* @event `redo` Redo executed. |
|||
* @example |
|||
* editor.on('redo', () => { ... }); |
|||
*/ |
|||
redo = 'redo', |
|||
|
|||
/** |
|||
* @event `load` Editor is loaded. At this stage, the project is loaded in the editor and elements in the canvas are rendered. |
|||
* @example |
|||
* editor.on('load', () => { ... }); |
|||
*/ |
|||
load = 'load', |
|||
|
|||
/** |
|||
* @event `project:load` Project JSON loaded in the editor. The event is triggered on the initial load and on the `editor.loadProjectData` method. |
|||
* @example |
|||
* editor.on('project:load', ({ project, initial }) => { ... }); |
|||
*/ |
|||
projectLoad = 'project:load', |
|||
|
|||
/** |
|||
* @event `log` Log message triggered. |
|||
* @example |
|||
* editor.on('log', (msg, opts) => { ... }); |
|||
*/ |
|||
log = 'log', |
|||
|
|||
/** |
|||
* @event `telemetry:init` Initial telemetry data are sent. |
|||
* @example |
|||
* editor.on('telemetry:init', () => { ... }); |
|||
*/ |
|||
telemetryInit = 'telemetry:init', |
|||
|
|||
/** |
|||
* @event `destroy` Editor started destroy (on `editor.destroy()`). |
|||
* @example |
|||
* editor.on('destroy', () => { ... }); |
|||
*/ |
|||
destroy = 'destroy', |
|||
|
|||
/** |
|||
* @event `destroyed` Editor destroyed. |
|||
* @example |
|||
* editor.on('destroyed', () => { ... }); |
|||
*/ |
|||
destroyed = 'destroyed', |
|||
} |
|||
/**{END_EVENTS}*/ |
|||
@ -0,0 +1,25 @@ |
|||
/**{START_EVENTS}*/ |
|||
export enum ParserEvents { |
|||
/** |
|||
* @event `parse:html` On HTML parse, an object containing the input and the output of the parser is passed as an argument. |
|||
* @example |
|||
* editor.on('parse:html', ({ input, output }) => { ... }); |
|||
*/ |
|||
html = 'parse:html', |
|||
htmlRoot = 'parse:html:root', |
|||
|
|||
/** |
|||
* @event `parse:css` On CSS parse, an object containing the input and the output of the parser is passed as an argument. |
|||
* @example |
|||
* editor.on('parse:css', ({ input, output }) => { ... }); |
|||
*/ |
|||
css = 'parse:css', |
|||
|
|||
/** |
|||
* @event `parse` Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback. |
|||
* @example |
|||
* editor.on('parse', ({ event, ... }) => { ... }); |
|||
*/ |
|||
all = 'parse', |
|||
} |
|||
/**{END_EVENTS}*/ |
|||
Loading…
Reference in new issue