Hey champ,
I had this happen once. It was crazy. I invited it and allowed it. Probably you did the same.
I think there are 2 ways of going about it.
1) Don't be affected. Don't show fear. Hold the frame and own the frame. (I don't appreciate you doing that. Kinda verbals)
2) Be affected. You probably will show fear and reactivity. If so, go crazy, be loud. Make a scene. Have a good justification when everything is said and done. (I'm a grown man. She can't yell at me like that. I just reciprocated, etc.) Fight back in some way, don't go physical (ofc, lol) but explode in other ways.
If you are emotionally effected and do nothing, it's like showing a blood pack to a shark. She will get encouraged and continue doing it. Probably there was some point you showed to her it was OK for her to do so, with your vibe and energy; or maybe you showed it within the same interaction by your micro reactions.
I remember with my situation; I was really apologetic and fearful/defensive. Trying to minimize it only prolonged it. (She was a jealous, conversative girl I went on a date with, then saw me getting a -rather smooth if I may say- daygame number the same place I met her. ROFL. She confronted me and I was shitting myself. Couldn't own it at all. I remember, first she was normal, then I shelled up, she upped her verbals, I didn't do anything, shelled up more, like giving her a micro permission, and then she started screaming because from my behaviour she assumed it was OK if she did and I wouldn't do anything. BTW, this all happened in like 10-15 seconds.)
Probably you had a similar 10-20 seconds where you showed her it was OK for her to do it. Or maybe from your general vibe and demeanor, she got that you're not someone who would push back or hurt her. You have to be ready to cause a scene and defend your story. If so, %99 you won't end up in that situation because you won't give her those micro permissions.
No fight itself just "happens", people always gauge and calibrate before, if not for nothing else, just for self preservation reasons. Many fist fights require a back and forth escalation process where both parties need to get "amped up" you can't just read a book and then start fighting. It doesn't work like that.