Converts the state history to a JSON string.
Returns a JSON string representing the state history of the editor.
Future<String> toJson() async { return jsonEncode(await toMap()); }