。
When I woke up, I was lying on the floor.
Literal
Eye [subject-が] wake-up [when-と] I [topic-は] floor [at-に] was-lying.
寝る here doesn't mean 'to go to sleep' but 'to lie down / be lying' — in ~ていた it describes the state of being prone. Combined with the situation of waking up to discover one's position, the sentence captures the classic 'came to on the floor' feeling. The pattern 目が覚めると…ていた (waking + past resultative) is a go-to frame for 'I woke up to find…' narratives.