Thank you for the reply,
We have also tried this, however the editor removes all wp_enqueue_script on page load when targeting UI elements in the editor - so this only allow us to edit elements on the page generated by the editor, not in the editor itself. We need to add a category dropdown in the editor, not on the page generated by the editor. Adding JS works fine on the page, but gets removed when trying to load to add an element in the editor UI.
Please see below screenshots of what is happening:
In your main theme all actions are removed when loading the editor. So, any js we include using wp_enqueue_script action is getting removed because of the code in the theme.
Code Screenshot
As mentioned above, we are looking for a way to do this without making changes to the editor or theme directly so we can get the updates when you release them - if this is not possible, we will have to overwrite your code in the main theme and editor to add a multiple select dropdown control which we do not want to do.
We can see you have a new control in V4 which is in beta that allows multiple select, so if we need to wait for the new version to be released - not a problem, however it’s strange that an editor made for wordpress does not have a way of allowing someone to select more than one category for the posts they want to display as that is core functionality, also (maybe) stranger that there is no control for a multiple select dropdown in the Elements API.
Currently it’s not possible to select more than one category from a dropdown to display only some posts using the posts grid element in the editor - so we need to add a control for this, which we are happy to develop if you can please tell us how we can get our JS to not get removed by the editor in the main theme.