From 859f885e9f341ff7d98fabbcb753256b65c915b0 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Wed, 27 Oct 2021 12:19:47 +0200 Subject: [PATCH] Add custom option to SelectorManager --- docs/modules/Selectors.md | 4 ++++ src/selector_manager/config/config.js | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/modules/Selectors.md b/docs/modules/Selectors.md index 87664f6d8..5428d650b 100644 --- a/docs/modules/Selectors.md +++ b/docs/modules/Selectors.md @@ -112,9 +112,13 @@ If you need to manage your selectors programmatically you can use its [APIs][Sel The default UI can handle most of the common tasks but in case you need a more advanced logic/elements, that requires a replace of the default UI. +All you have to do is to indicate the editor your intent to use a custom UI and then subscribe to the `block:custom` event that will give you all the information on any requested change. +In the example below we'll replicate most of the default functionality by using only the Selector Manager API. + + ## Events diff --git a/src/selector_manager/config/config.js b/src/selector_manager/config/config.js index 44e1af52f..6df172400 100644 --- a/src/selector_manager/config/config.js +++ b/src/selector_manager/config/config.js @@ -98,5 +98,8 @@ export default { // With this option enabled, also in the second case, the Component will be passed. // This method allows to avoid styling classes directly and make, for example, some // unintended changes below the visible canvas area (when components share same classes) - componentFirst: 0 + componentFirst: 0, + + // Avoid rendering the default Selector Manager UI. + custom: false };