R.R.
Have you tried getting her into therapy? Seriously. While lots of her behavior is normal with the hormonal changes beginning to take place in her body, the independence of being in middle school, peer pressure to act a certain way, the family changes from being with dad to your boyfriend, (how is her relationship with him?) the new baby coming (congrats)...she has a lot going on in her life. Talking to a therapist may help her see that what she's facing is all in a 12 year old's life and normal, and help her to zero in on the areas that need changing on her part.
Put the responsibility of doing well at school on her, not the school. Yes, you want to hear from them if something is amiss, but it is ultimately HER responsibility to get things done. Get her a notebook to write down each homework assignment by class/subject, and that she has teachers initial when she turns it in, that way she's accountable on a daily basis. Make homework a priority (for all your children who have it) when she gets home, before anything else, in a common area so you can see them doing it, not hidden in their rooms. If she doesn't comply and turn it in take all electronics out of her room and cell phone away from her (let her dad buy her a new one for when she's with him if he wants her to have one) and keep them until there are major changes in her attitude and school performance. If you know she is capable of doing the work there's no reason for her not to. She's getting to the point where in a few years as she applies to colleges depending on the ones they are they WILL look at 7th grade and up performance (they have to as there are so many qualified students for each opening. My friend who is on the board at Stanford says it breaks her heart to not allow all the applicants in, but that's impossible, and the grades back as far as 7th grade are considered.)
Why is she tardy? Does she walk or is she taken to school? If she is walking there she needs to leave earlier. As far as disciplining her for being disrespectful, pick your discipline and stick to it. Have her earn her belongings back with respectful behavior. Also talk to her dad and let him know exactly what is going on, tell him that as long as you both aren't on the same page she is going to pull the "live with dad" card, and if that isn't an option she needs to know it. He may think he's cool to be the way he is, but in the long run he's hurting her and not doing her any good.
And explain to her that while she gets her way at his house she doesn't at yours, your home, your rules. How you deal with her now is setting the tone for your other children who see what is happening and will remember. Better to get her compliant now than to try in a few years when there are boys in the picture.
And don't let it break your heart when she says she wants to live with her dad or that she hates you. Tell her that's OK, you still love her. It's a common ploy and she knows it hurts you. If it's not an option for her to live with him be content with that, and if it is consider calling her bluff. She may find that dad isn't as fun as she thought. At 12 they are beginning to think they can do what they want as they realize they are more independent than they were even last year, but they have to learn that with independence comes responsibility and increased attitude of respect.
I know it's rough but hang in there! {{HUGS}}