A powerful 7.7-magnitude earthquake has struck Indonesia - with buildings and homes collapsing.