CodeMirror mode for the JSONata language - JSONata website
You can play around with it here
I am not a specialist in distributing frontend packages, so it's just a file codemirror-mode-jsonata.js
that you need to require in your build somehow.
The mode itself is implemented via CodeMirror API that is accessible from global scope in your browser.