The percentage unit cost and environmental impact of shipping electronics from China (or between any two points on earth near a major harbor) on a cargo vessel is zero.
If the labor in China is cheaper than the robot + the person that operates the robot, then it is cheaper to build it there.
Building it locally only makes economic sense if the design is changing frequently (e.g., using local pick and place for prototyping), or if it is built to order, so the time it spends on the boat actually matters.
As an extreme example, giant Italian windows cost about the same, delivered, in the US as inferior domestic ones do. The main downside is the lead time. In particular, thanks to a drought, traffic through the panama canal is all screwed up these days, so getting them to the west coast is hard.
If the economics tilt this way for shipping giant panes of glass, they certainly also do for tiny, high priced electronic devices.
Of course, externalities (e.g., environmental impact of Chinese manufacturing, human rights, national security and xenophobia) could change the tradeoffs.