As a recap of optimized lineup construction:
"you want your best three hitters to hit in the #1, #4, and #2 spots. Distribute them so OBP is higher in the order and SLG is lower. Then place your fourth and fifth best hitters, with the #5 spot usually seeing the better hitter, unless he's a high-homerun guy. Then place your four remaining hitters in decreasing order of overall hitting ability, with basestealers ahead of singles hitters. Finally, stop talking like the lineup is a make-or-break decision."
vs RHP the best 3 hitters are clearly Freeman, Riley and Soler. Following the guidelines above, they bat 1, 4 and 2. The exact order doesn't matter, but I'd probably lead off Freeman, stick Riley 4, and Soler 2. The next 2 best hitters are Swanson and Duvall, and since Duvall is a clear "high-homerun guy", he bats 3rd and Swanson bats 5th. Albies goes 6th to steal in front of Rosario and TDA (TDA 8th since Freeman is leading off).
vs LHP the best 3 hitters are Albies, Soler and Freeman. Following the guidelines above, Albies bats 1st, Freeman 2nd, and Soler 4th. To keep things a bit more stable, it might be fine to simply swap Albies and Riley between the 4 and 6 spots depending on SP. Heredia goes in for Rosario.