Skip to content

Commit

Permalink
chore: document editor events
Browse files Browse the repository at this point in the history
Related to #839
  • Loading branch information
Skaiir committed Oct 16, 2023
1 parent a09e9f6 commit 75c5cbe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions packages/form-js-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,42 @@ Subscribe to an [event](#events).

Remove form from editor the document.

## Events

### `selection.changed :: { selection }`

### Properties panel events
- `propertiesPanel.focusin`
- `propertiesPanel.focusout`
- `propertiesPanel.showEntry :: { id }`
- `propertiesPanel.updated :: { formField }`

### Form lifecycle events
- `detach`
- `attach`
- `rendered`
- `form.init`
- `form.clear`
- `form.destroy`
- `diagram.clear`
- `diagram.destroy`
- `dragula.created`
- `dragula.destroyed`
- `editorActions.init :: { editorActions }`

### Drag events
- `drag.start :: { element, source }`
- `drag.end :: { element }`
- `drag.drop :: { element, target, source, sibling }`
- `drag.hover :: { element, container, source }`
- `drag.out :: { element, container, source }`
- `drag.cancel :: { element, container, source }`

### Form field events
- `formField.add :: { formField }`
- `formField.remove :: { formField }`
- `formField.updateId :: { formField, newId }`


## License

Expand Down
3 changes: 3 additions & 0 deletions packages/form-js-editor/src/render/components/FormEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ export default function FormEditor(props) {

// fire event after render to notify interested parties
useEffect(() => {
eventBus.fire('rendered');

// keep deprecated event to ensure backward compatibility
eventBus.fire('formEditor.rendered');
}, []);

Check warning on line 409 in packages/form-js-editor/src/render/components/FormEditor.js

View workflow job for this annotation

GitHub Actions / Build (macos-latest, 20)

React Hook useEffect has a missing dependency: 'eventBus'. Either include it or remove the dependency array

Check warning on line 409 in packages/form-js-editor/src/render/components/FormEditor.js

View workflow job for this annotation

GitHub Actions / Build (ubuntu-20.04, 20)

React Hook useEffect has a missing dependency: 'eventBus'. Either include it or remove the dependency array

Check warning on line 409 in packages/form-js-editor/src/render/components/FormEditor.js

View workflow job for this annotation

GitHub Actions / Build (windows-latest, 20)

React Hook useEffect has a missing dependency: 'eventBus'. Either include it or remove the dependency array

Expand Down

0 comments on commit 75c5cbe

Please sign in to comment.