How do I add custom script for macro parameter on macro browser load?

I would like to add a piece of script on macro browser load for one of the macro parameter, but not finding a way to do it.

We do this in Server addon, by overriding the MacroConfig.prototype.fields.

MacroConfig.prototype.fields = {
        "string" : {
            "macroParam1" : function(param) {  
             var paramDiv = $(Confluence.Templates.MacroBrowser.macroParameter());
                //logic goes here ...
                return new AJS.MacroBrowser.Field(paramDiv, input);
            }
        }
    };

I am unable to find a way to do similar in Cloud addon.
Look forward for any references.

Thank you!

I’m afraid this is not an option in Cloud, but you can create your own Macro editor dialog. Have a look at the “editor” property of the Static Content Marco and Dynamic Content Macro modules

I asked the team to weigh in on a recommendation for this:

It’s not possible when using the default macro editor, but app vendors have the option to provide their own macro editor dialog, and this will allow them to do anything they’d want on the editor. This is probably the way to go for this one. I don’t think we’d ever support allowing arbitrary JS on the default macro editor.

https://developer.atlassian.com/cloud/confluence/modules/macro-editor/