Congratulations! I'd wait until you are ready for this to be general public information because you can't tell a 7 year old and then tell her to keep it quiet. So wait until you're really ready. If you have a lot of symptoms, then I think you may have to tell her sooner - it's not right for kids to think that, say, something terrible is wrong with Mommy who is throwing up all the time.
Kids should not find out from other adults, though, so if you've told anyone else who might inadvertently spills the beans or even say something within earshot when they don't realize she's listening, I'd tell her sooner.
I do think it's wise to tell your ex directly. Kids should not be in charge of delivering adult news, and you don't want him to be in a position of having to come up with a response. Also, if she doesn't tell him directly but starts asking all kinds of questions about where babies come from, and then he goes into some explanation, which she surprises him by saying, "Gee, that's not what Mommy and Stepdaddy said about their baby," it doesn't go well. Out of respect for him and for co-parenting, I'd tell him ahead of him seeing her and tell him briefly what vocabulary you used with her and any questions or comments she had if there was anything noteworthy. I'm a believer in not asking kids to do an adult's job, and making her responsible for informing him (which is what it would turn out to be, whether you intended it that way or not) isn't right. You don't have to discuss it with him - you can tell him by email or text if that's better, and just say you are letting him know ahead of her coming to visit him so he has a head's up. You can tell him before you tell her, or after, but it should not be when you are dropping her off or when she is there. There are adult conversations that occur without the child present, and this is one of them.