How can I add a method to create files when in theme-editor.php

This is a concept of my goal

concept image

I want to

be able to create files in the current opened directory by entering the complete file name and and extension in a text field, click create and use the AJAX process to run the file_put_contents() method.

I haven’t tried any coding methods as I do not even have a starting point. After 18 hours of research, I have only found methods using add_theme_page() to add a page where all the custom coding can be done. While that’s a solid option, I’d like to keep it all in the core file editor. It’s just an overkill to create an entire file editor which does all the same tasks as the core, with the only diff being a text field.