From 22830e8bcc20b100c836090ca30acd5b21360bf3 Mon Sep 17 00:00:00 2001 From: Valentin Serra Date: Mon, 16 Oct 2023 13:30:08 +0200 Subject: [PATCH] chore: document editor events Related to #839 --- packages/form-js-editor/README.md | 36 +++++++++++++++++++ .../src/render/components/FormEditor.js | 3 ++ 2 files changed, 39 insertions(+) diff --git a/packages/form-js-editor/README.md b/packages/form-js-editor/README.md index a8ec7586c..9b95dab46 100644 --- a/packages/form-js-editor/README.md +++ b/packages/form-js-editor/README.md @@ -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 diff --git a/packages/form-js-editor/src/render/components/FormEditor.js b/packages/form-js-editor/src/render/components/FormEditor.js index af6343fde..18b83a1c7 100644 --- a/packages/form-js-editor/src/render/components/FormEditor.js +++ b/packages/form-js-editor/src/render/components/FormEditor.js @@ -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'); }, []);