From f4692539166546de50f785feaa9d6acb121835a8 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 11 Oct 2022 09:36:04 +0800 Subject: [PATCH] chore: update README.MD --- .../app_flowy/packages/appflowy_editor/README.md | 2 +- .../test/legacy/flowy_editor_test.dart | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/app_flowy/packages/appflowy_editor/README.md b/frontend/app_flowy/packages/appflowy_editor/README.md index a317119829..f6fac062b0 100644 --- a/frontend/app_flowy/packages/appflowy_editor/README.md +++ b/frontend/app_flowy/packages/appflowy_editor/README.md @@ -67,7 +67,7 @@ You can also create an editor from a JSON object in order to configure your init ```dart final json = ...; final editorStyle = EditorStyle.defaultStyle(); -final editorState = EditorState(StateTree.fromJson(data)); +final editorState = EditorState(Document.fromJson(data)); final editor = AppFlowyEditor( editorState: editorState, editorStyle: editorStyle, diff --git a/frontend/app_flowy/packages/appflowy_editor/test/legacy/flowy_editor_test.dart b/frontend/app_flowy/packages/appflowy_editor/test/legacy/flowy_editor_test.dart index 998ea974f7..29c38650f3 100644 --- a/frontend/app_flowy/packages/appflowy_editor/test/legacy/flowy_editor_test.dart +++ b/frontend/app_flowy/packages/appflowy_editor/test/legacy/flowy_editor_test.dart @@ -9,7 +9,7 @@ void main() { test('create state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // expect(document.root.type, 'root'); // expect(document.root.toJson(), data['document']); }); @@ -17,7 +17,7 @@ void main() { test('search node by Path in state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // final checkBoxNode = document.root.childAtPath([1, 0]); // expect(checkBoxNode != null, true); // final textType = checkBoxNode!.attributes['text-type']; @@ -27,7 +27,7 @@ void main() { test('search node by Self in state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // final checkBoxNode = document.root.childAtPath([1, 0]); // expect(checkBoxNode != null, true); // final textType = checkBoxNode!.attributes['text-type']; @@ -39,7 +39,7 @@ void main() { test('insert node in state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // final insertNode = Node.fromJson({ // 'type': 'text', // }); @@ -51,7 +51,7 @@ void main() { test('delete node in state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // document.delete([1, 1], 1); // final node = document.nodeAtPath([1, 1]); // expect(node != null, true); @@ -61,7 +61,7 @@ void main() { test('update node in state tree', () async { // final String response = await rootBundle.loadString('assets/document.json'); // final data = Map.from(json.decode(response)); - // final document = StateTree.fromJson(data); + // final document = Document.fromJson(data); // final test = document.update([1, 1], {'text-type': 'heading1'}); // expect(test, true); // final updatedNode = document.nodeAtPath([1, 1]);