For the fatayer dough, in a large bowl, mix the flour, salt, sugar, and yeast. Using the back of a wooden spoon, make a hole in the mix and pour the water and olive oil into the hole. Mix the ingredients together well with a wooden spoon or your hands, as is the Lebanese practice. Continue mixing and kneading until the dough comes together as a whole piece.
Form the dough into a round, and place it in a large bowl. Coat the dough with a little olive oil.
Cover the bowl with a kitchen towel and leave it in a warm place for about 1 hour until it’s doubled in size.
Make the filling while the dough rises. Put the spinach in a large bowl, sprinkle it with the salt, and set it aside for 10 minutes. Squeeze the spinach to drain any water, then chop it into small pieces.
Add the onions, tomatoes, olive oil, lemon juice, vinegar, sumac, pepper, 7 spice seasoning, and vinegar. Mix until the ingredients are well combined.
When the dough rises, punch it down and knead it a bit. Divide the dough into 16 small balls. Cover the balls with the towel and let them rest for 10 minutes.
On a floured surface, use a rolling pin, to roll the balls into ¼-inch, or a little thinner, circles. Let the circles rest for 10 minutes.
While the circles rest, put 2 baking sheets in the oven and preheat it to 400 degrees F.
To make the fatayer, put ¼ cup of spinach filling in the middle of a circle, and top it with 1 tablespoon of feta, if using. Bring two sides of the dough together, then pinch to close them. Bring up the third side and pinch to close it, making a triangle. Brush the fatayer with the egg.
With a potholder, remove the baking sheets from the oven and dust them with flour. Put 4 to 5 of the fatayer on each baking sheet to allow room for the dough to rise more as they bake. Bake the fatayer for 15 to 18 minutes, until they become golden. Bake the remaining fatayer.
Serve the fatayer warm with lemon juice.