Hi I think it sounds like you need to put your old relationship to rest and start over with a new and improved relationship.
Accept her invitation to dinner and visualize a pleasant evening for the both of you.
A couple of things to prepare in advance for:
If for any reason she gets angry and reverts to her "divorce paper" threats, remain calm (breathe deeply), and say I understand you are upset. I can't work through things with you if divorce is going to be threatened whenever things aren't going your way. But if you want to talk about it I'd be happy to work things out with you. But I can't if I'm going to be threatened.
Also if she texts more than once while you are there, politely excuse yourself and go to the bathroom and stay there for a long time.
Cool off and let her realize something's up. When she comes to check on you, come back to the table.
If she starts texting again, say maybe this isn't a good time for you, I'll go now. If she still won't put the texting away, say look I appreciate the dinner but you are not the only one who wants a different relationship together. I will focus on you if you will focus on me.
Also DON'T SLEEP WITH HER. She's obviously open to this and that's very good. But you need to get on an even keel with her.
It would really feel bad to sleep with her and then the next thing you know she's being mysterious and suspicious or getting angry and threatening divorce a day or week later.
Things have to progress where you can trust that you are officially committed to working on things together.