A YText just has insert, delete, format, and applyDelta for making modifications. It really is up to the editor, not YJS, to choose how to modify the YText.
Luckily it’s pretty easy to convert a diff to a delta and use ytext.applyDelta. Check out this discussion and the included demo: