Feat: add appflowy editor in backend (#1320)

* chore: remove update attributes

* chore: format code

* chore: extension for transaction

* refactor: add document editor trait

* chore: add appflowy_document editor

* chore: add document serde

* chore: add new document editor

* chore: add tests

* chore: add more test

* chore: add test

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Nathan.fooo
2022-10-20 11:35:11 +08:00
committed by GitHub
parent 833a6cd95f
commit f1a5726fcb
81 changed files with 2367 additions and 902 deletions

View File

@ -115,7 +115,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
void _composeDelta(Delta composedDelta, Delta documentDelta) async {
final json = jsonEncode(composedDelta.toJson());
Log.debug("doc_id: $view.id - Send json: $json");
final result = await service.applyEdit(docId: view.id, data: json);
final result = await service.applyEdit(docId: view.id, operations: json);
result.fold(
(_) {},

View File

@ -18,13 +18,11 @@ class DocumentService {
Future<Either<Unit, FlowyError>> applyEdit({
required String docId,
required String data,
String operations = "",
required String operations,
}) {
final payload = EditPayloadPB.create()
..docId = docId
..operations = operations
..operationsStr = data;
..operations = operations;
return DocumentEventApplyEdit(payload).send();
}