I am trying to build a node which allows the user to edit a JSON in the UI. To provide the user some visual clues about the structure of the JSON, I wanted to use the same IDE that is used in the node-red function editor: Ace
As starting-point, I wanted to include the editor in a template node:
Within the RED.editors.createEditor function, the call to ace.edit is made:
Then, on showTypeEditor handles the logic for displaying the exact type editor, which is what happens behind the scenes when calling editJson:
As the JSON part of the inject node is handled as part of the TypedInput, it sadly isn't found within the inject node's code. For showing this view, you could combine the knowledge from the template node as shown above, with what it shows there for the expand button function, but if you don't set the width to infinity and use editJSON rather than editText, you get the same overlay as the inject node.
I hope this helps, I'm currently working in putting something similar in place for uibuilder, rather than have it use the regular ace.edit calls as using those will mean the expanding won't work on all devices.
Here's the specific code for expanding in the inject node by the way, through the typedInput:
I've seen your message in DM, but I'm not interested in doing the development on your node for you. I've other projects eating up most of my time. For future readers of this topic, the author has seen my response and has considered this too difficult to implement. He's looking for people to instead implement it for him in his node, potentially paid through a donation.
Maybe someone else is interested in picking this up.
to add to this: the required know-how to implement this exceeds my current knowledge, hence I will not be able to develop this on my own.
If somebody is interested in the functionality above, I would be willing to "kickstart" the development (no strings attached, ideally you will publish the code as open-source). Please contact me if you are interested.