Because it can be useful to review data in text files and not only via the panel UI, it would be great if the blocks serialization was a bit more human friendly.
Currently it’s stored as a JSON array in a single line:
MyField: [{"content": {}, "id": "41793082-67cc-4aa3-9b3d-ec49512b8f58", "isHidden": false, "type": "heading"},{"content": {}, "id": "52032388-147b-4140-9d7b-f51cfd3d6cc6", "isHidden": false, "type": "text"},{"content": {},"id": "fcadde7b-1808-4872-8ff5-36781e4a9234", "isHidden": false, "type": "text"}]
It could help to serialize it by putting each block on its own line, like this:
MyField: [
{"content": {}, "id": "41793082-67cc-4aa3-9b3d-ec49512b8f58", "isHidden": false, "type": "heading"},
{"content": {}, "id": "52032388-147b-4140-9d7b-f51cfd3d6cc6", "isHidden": false, "type": "text"},
{"content": {},"id": "fcadde7b-1808-4872-8ff5-36781e4a9234", "isHidden": false, "type": "text"}
]
That way:
Not exactly like you propose, but you can use the pretty: true
prop in the blueprint definition of the blocks field, which will pretty-print the JSON in the content file.
Oh, good to know!