Ohh, you gave me great idea about compressionstream.. Thanks.
I did a quick test atm, official large map fully compressed is 1.23MB.
It contains lots of cubes / tiles. After 7z: 343KB

Empty map, compressed 273KB.
And now compressed with 7z: 385 bytes lol.

This map format contains lots of 0. Thats why 7z is able to compress it so well.
I will try with compressionstreams..

Yes maps must be first compressed with specific way, before game is able to load them.
For undo its not needed.

This of course probably will be the easiest solution. Just take whole map and compress.
And if i limit undo count, maybe it will even work.

Atm i would like just to have undo / redo for tile "painting".