Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: document editor events #845

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
}, []);

Expand Down
18 changes: 9 additions & 9 deletions packages/form-js-viewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ Fired off on form submission.
### `import.done :: { error, warnings }`
Fired whenever a schema has finished importing, whether it succeeds or fails.

### `form.layoutCalculated :: { rows }`
### Layouting events
- `form.layoutCleared`
- `form.layoutCalculated :: { rows }`

### `form.layoutCleared :: {}`

### `<lifeCycleEvent> :: {}`
### Lifecycle Events
- `detach`
- `attach`
- `form.init`
Expand All @@ -176,11 +176,11 @@ Fired whenever a schema has finished importing, whether it succeeds or fails.
- `diagram.clear`
- `diagram.destroy`

### `<formFieldEvent> :: { formField }`
- `formField.add`
- `formField.remove`
- `formField.focus`
- `formField.blur`
### Formfield events
- `formField.add :: { formField }`
- `formField.remove :: { formField }`
- `formField.focus :: { formField }`
- `formField.blur :: { formField }`


## License
Expand Down