Line a baking sheet or large platter with a double layer of paper towels. Arrange the tomato slices in a single layer on the paper towels, sprinkle with the salt, and set aside for 30 minutes. Meanwhile, arrange a rack in the middle of the oven and heat to 400°F.
Stir the mayonnaise, lemon juice, and pepper together in a small bowl, set aside.
Line a second baking sheet with parchment paper. Unfold the puff pastry and gently press together any cracks in the seams. Use a sharp knife to score the perimeter of the dough 1-inch from the edge, making sure not to cut all the way through the dough. Pierce the surface of the dough inside the scored rectangle with a fork so that the center of the pastry does not puff in the oven.
Spread the mayonnaise mixture in an even layer over the center of the puff pastry. Then layer evenly with shredded mozzarella.
Pat the tops of the tomato slices dry with a new paper towel, then arrange in a single layer on top of the mayonnaise. Then layer with red onions and feta.
Bake until golden-brown and crisp, 25 - 30 minutes. Remove from the oven and let cool slightly, about 5 minutes. Drizzle with pesto then sprinkle with flaky sea salt, red pepper flakes, and herbs.