Reducing volume for a split-phase 230VAC@60Hz sealed power supply providing 5VDC@50mA
This is the smartest offline regulator that fits your requirements for size, simplicity and low cost. The regulator only charges the cap line rectified input is &lt;32Vdc. It  is adjustable.





Since your requirements do not include cost, availability and are only looking for a prototype quantity and you don't have access to Far East suppliers, and the interface requirements to the grid and heat loss in a small thermally insulated 1" cube, your options will always be a compromise. The easiest one to adjust is volume, your artificial requirement.

The simplest is a bridge and a series self-healing X1 cap.  The load Cap will act as a voltage divider from 340Vp to 8Vp which is then clamped with a 5V Zener The load is a combination of the duty cycle of pulsed current to charge the cap and linear current to discharge the cap. 

A unregulated output should result  RC=8*10ms for 100Hz 10% ripple.  As a check your load 5V@50mA=250mW will have loss in LDO and bridge. So cap choices must ensure Vin(min) is >5V with 0.1V drop easy to match.

This is easy at 50mA but values of C escalate quickly with load current beyond 50mA making size and cost undesireable.

IF load is 300mW at 5V including LDO =50mW for a target and 250mW for a load, and 230Vac RMS/5Vdc RMS= 46 than VAR value of series X1 cap must be at least 46x1/4W ~ 12VAR @ 100Hz. 

We can approximate this with VAR=1/2CV^2 @100Hz although the rectified signal is rich in harmonics.
Thus 12[VAR]=E=1/2*C(230)^2
... C(X1)=450uF. hmm Doesn't sound right.

Anyways my answer is this