diff --git a/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart b/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart index 01b0d6818a..a0498491f9 100644 --- a/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart +++ b/frontend/app_flowy/lib/workspace/application/doc/doc_service.dart @@ -1,21 +1,22 @@ import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/dispatch/dispatch.dart'; -import 'package:flowy_sdk/protobuf/flowy-collaboration/document_info.pb.dart'; + import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-sync/text_block_info.pb.dart'; class DocumentService { - Future> openDocument({ + Future> openDocument({ required String docId, }) async { await FolderEventSetLatestView(ViewId(value: docId)).send(); - final payload = BlockId(value: docId); + final payload = TextBlockId(value: docId); return BlockEventGetBlockData(payload).send(); } - Future> composeDelta({required String docId, required String data}) { - final payload = BlockDelta.create() + Future> composeDelta({required String docId, required String data}) { + final payload = TextBlockDelta.create() ..blockId = docId ..deltaStr = data; return BlockEventApplyDelta(payload).send(); diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart index 4e4fe85e54..c8fd8a2b96 100644 --- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart +++ b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart @@ -1,6 +1,6 @@ import 'package:app_flowy/workspace/application/doc/share_service.dart'; import 'package:app_flowy/workspace/application/markdown/delta_markdown.dart'; -import 'package:flowy_sdk/protobuf/flowy-block/entities.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_service.dart b/frontend/app_flowy/lib/workspace/application/doc/share_service.dart index a01117aa7e..cc3afe1314 100644 --- a/frontend/app_flowy/lib/workspace/application/doc/share_service.dart +++ b/frontend/app_flowy/lib/workspace/application/doc/share_service.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/dispatch/dispatch.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; -import 'package:flowy_sdk/protobuf/flowy-block/protobuf.dart'; +import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart'; class ShareService { Future> export(String docId, ExportType type) { diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart index 048f417de0..f027bf3e7a 100644 --- a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart +++ b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart @@ -21,7 +21,7 @@ import 'package:flowy_infra/theme.dart'; import 'package:flowy_infra_ui/flowy_infra_ui.dart'; import 'package:flowy_infra_ui/widget/rounded_button.dart'; import 'package:flowy_sdk/log.dart'; -import 'package:flowy_sdk/protobuf/flowy-block/entities.pb.dart'; +import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:flutter/material.dart'; diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-block/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart similarity index 82% rename from frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-block/dart_event.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart index 052905e8c5..6785a1c681 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-block/dart_event.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart @@ -2,34 +2,34 @@ /// Auto generate. Do not edit part of '../../dispatch.dart'; class BlockEventGetBlockData { - BlockId request; + TextBlockId request; BlockEventGetBlockData(this.request); - Future> send() { + Future> send() { final request = FFIRequest.create() ..event = BlockEvent.GetBlockData.toString() ..payload = requestToBytes(this.request); return Dispatch.asyncRequest(request) .then((bytesResult) => bytesResult.fold( - (okBytes) => left(BlockDelta.fromBuffer(okBytes)), + (okBytes) => left(TextBlockDelta.fromBuffer(okBytes)), (errBytes) => right(FlowyError.fromBuffer(errBytes)), )); } } class BlockEventApplyDelta { - BlockDelta request; + TextBlockDelta request; BlockEventApplyDelta(this.request); - Future> send() { + Future> send() { final request = FFIRequest.create() ..event = BlockEvent.ApplyDelta.toString() ..payload = requestToBytes(this.request); return Dispatch.asyncRequest(request) .then((bytesResult) => bytesResult.fold( - (okBytes) => left(BlockDelta.fromBuffer(okBytes)), + (okBytes) => left(TextBlockDelta.fromBuffer(okBytes)), (errBytes) => right(FlowyError.fromBuffer(errBytes)), )); } diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart index 715b9b2f4f..b068956465 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dispatch.dart @@ -3,7 +3,6 @@ import 'package:dartz/dartz.dart'; import 'package:flowy_sdk/log.dart'; // ignore: unnecessary_import import 'package:flowy_sdk/protobuf/dart-ffi/ffi_response.pb.dart'; -import 'package:flowy_sdk/protobuf/flowy-collaboration/document_info.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-net/event.pb.dart'; import 'package:flowy_sdk/protobuf/flowy-net/network_state.pb.dart'; @@ -21,8 +20,9 @@ import 'package:flowy_sdk/ffi.dart' as ffi; import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart'; import 'package:flowy_sdk/protobuf/dart-ffi/protobuf.dart'; import 'package:flowy_sdk/protobuf/flowy-folder-data-model/protobuf.dart'; -import 'package:flowy_sdk/protobuf/flowy-block/protobuf.dart'; +import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart'; import 'package:flowy_sdk/protobuf/flowy-grid-data-model/protobuf.dart'; +import 'package:flowy_sdk/protobuf/flowy-sync/protobuf.dart'; // ignore: unused_import import 'package:protobuf/protobuf.dart'; @@ -33,7 +33,7 @@ part 'dart_event/flowy-folder/dart_event.dart'; part 'dart_event/flowy-net/dart_event.dart'; part 'dart_event/flowy-user/dart_event.dart'; part 'dart_event/flowy-grid/dart_event.dart'; -part 'dart_event/flowy-block/dart_event.dart'; +part 'dart_event/flowy-text-block/dart_event.dart'; enum FFIException { RequestIsEmpty, diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pb.dart deleted file mode 100644 index d2732dca6a..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pb.dart +++ /dev/null @@ -1,412 +0,0 @@ -/// -// Generated code. Do not modify. -// source: document_info.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields - -import 'dart:core' as $core; - -import 'package:fixnum/fixnum.dart' as $fixnum; -import 'package:protobuf/protobuf.dart' as $pb; - -import 'revision.pb.dart' as $0; - -class CreateBlockParams extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateBlockParams', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'id') - ..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions', subBuilder: $0.RepeatedRevision.create) - ..hasRequiredFields = false - ; - - CreateBlockParams._() : super(); - factory CreateBlockParams({ - $core.String? id, - $0.RepeatedRevision? revisions, - }) { - final _result = create(); - if (id != null) { - _result.id = id; - } - if (revisions != null) { - _result.revisions = revisions; - } - return _result; - } - factory CreateBlockParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory CreateBlockParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - CreateBlockParams clone() => CreateBlockParams()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - CreateBlockParams copyWith(void Function(CreateBlockParams) updates) => super.copyWith((message) => updates(message as CreateBlockParams)) as CreateBlockParams; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static CreateBlockParams create() => CreateBlockParams._(); - CreateBlockParams createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static CreateBlockParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static CreateBlockParams? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get id => $_getSZ(0); - @$pb.TagNumber(1) - set id($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasId() => $_has(0); - @$pb.TagNumber(1) - void clearId() => clearField(1); - - @$pb.TagNumber(2) - $0.RepeatedRevision get revisions => $_getN(1); - @$pb.TagNumber(2) - set revisions($0.RepeatedRevision v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasRevisions() => $_has(1); - @$pb.TagNumber(2) - void clearRevisions() => clearField(2); - @$pb.TagNumber(2) - $0.RepeatedRevision ensureRevisions() => $_ensure(1); -} - -class BlockInfo extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockInfo', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'text') - ..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revId') - ..aInt64(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'baseRevId') - ..hasRequiredFields = false - ; - - BlockInfo._() : super(); - factory BlockInfo({ - $core.String? blockId, - $core.String? text, - $fixnum.Int64? revId, - $fixnum.Int64? baseRevId, - }) { - final _result = create(); - if (blockId != null) { - _result.blockId = blockId; - } - if (text != null) { - _result.text = text; - } - if (revId != null) { - _result.revId = revId; - } - if (baseRevId != null) { - _result.baseRevId = baseRevId; - } - return _result; - } - factory BlockInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlockInfo.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlockInfo clone() => BlockInfo()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlockInfo copyWith(void Function(BlockInfo) updates) => super.copyWith((message) => updates(message as BlockInfo)) as BlockInfo; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlockInfo create() => BlockInfo._(); - BlockInfo createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlockInfo getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlockInfo? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get blockId => $_getSZ(0); - @$pb.TagNumber(1) - set blockId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasBlockId() => $_has(0); - @$pb.TagNumber(1) - void clearBlockId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get text => $_getSZ(1); - @$pb.TagNumber(2) - set text($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasText() => $_has(1); - @$pb.TagNumber(2) - void clearText() => clearField(2); - - @$pb.TagNumber(3) - $fixnum.Int64 get revId => $_getI64(2); - @$pb.TagNumber(3) - set revId($fixnum.Int64 v) { $_setInt64(2, v); } - @$pb.TagNumber(3) - $core.bool hasRevId() => $_has(2); - @$pb.TagNumber(3) - void clearRevId() => clearField(3); - - @$pb.TagNumber(4) - $fixnum.Int64 get baseRevId => $_getI64(3); - @$pb.TagNumber(4) - set baseRevId($fixnum.Int64 v) { $_setInt64(3, v); } - @$pb.TagNumber(4) - $core.bool hasBaseRevId() => $_has(3); - @$pb.TagNumber(4) - void clearBaseRevId() => clearField(4); -} - -class ResetBlockParams extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ResetBlockParams', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..aOM<$0.RepeatedRevision>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revisions', subBuilder: $0.RepeatedRevision.create) - ..hasRequiredFields = false - ; - - ResetBlockParams._() : super(); - factory ResetBlockParams({ - $core.String? blockId, - $0.RepeatedRevision? revisions, - }) { - final _result = create(); - if (blockId != null) { - _result.blockId = blockId; - } - if (revisions != null) { - _result.revisions = revisions; - } - return _result; - } - factory ResetBlockParams.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ResetBlockParams.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ResetBlockParams clone() => ResetBlockParams()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ResetBlockParams copyWith(void Function(ResetBlockParams) updates) => super.copyWith((message) => updates(message as ResetBlockParams)) as ResetBlockParams; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static ResetBlockParams create() => ResetBlockParams._(); - ResetBlockParams createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static ResetBlockParams getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static ResetBlockParams? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get blockId => $_getSZ(0); - @$pb.TagNumber(1) - set blockId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasBlockId() => $_has(0); - @$pb.TagNumber(1) - void clearBlockId() => clearField(1); - - @$pb.TagNumber(2) - $0.RepeatedRevision get revisions => $_getN(1); - @$pb.TagNumber(2) - set revisions($0.RepeatedRevision v) { setField(2, v); } - @$pb.TagNumber(2) - $core.bool hasRevisions() => $_has(1); - @$pb.TagNumber(2) - void clearRevisions() => clearField(2); - @$pb.TagNumber(2) - $0.RepeatedRevision ensureRevisions() => $_ensure(1); -} - -class BlockDelta extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockDelta', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'blockId') - ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'deltaStr') - ..hasRequiredFields = false - ; - - BlockDelta._() : super(); - factory BlockDelta({ - $core.String? blockId, - $core.String? deltaStr, - }) { - final _result = create(); - if (blockId != null) { - _result.blockId = blockId; - } - if (deltaStr != null) { - _result.deltaStr = deltaStr; - } - return _result; - } - factory BlockDelta.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlockDelta.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlockDelta clone() => BlockDelta()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlockDelta copyWith(void Function(BlockDelta) updates) => super.copyWith((message) => updates(message as BlockDelta)) as BlockDelta; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlockDelta create() => BlockDelta._(); - BlockDelta createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlockDelta getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlockDelta? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get blockId => $_getSZ(0); - @$pb.TagNumber(1) - set blockId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasBlockId() => $_has(0); - @$pb.TagNumber(1) - void clearBlockId() => clearField(1); - - @$pb.TagNumber(2) - $core.String get deltaStr => $_getSZ(1); - @$pb.TagNumber(2) - set deltaStr($core.String v) { $_setString(1, v); } - @$pb.TagNumber(2) - $core.bool hasDeltaStr() => $_has(1); - @$pb.TagNumber(2) - void clearDeltaStr() => clearField(2); -} - -class NewDocUser extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'NewDocUser', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'userId') - ..aInt64(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'revId') - ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId') - ..hasRequiredFields = false - ; - - NewDocUser._() : super(); - factory NewDocUser({ - $core.String? userId, - $fixnum.Int64? revId, - $core.String? docId, - }) { - final _result = create(); - if (userId != null) { - _result.userId = userId; - } - if (revId != null) { - _result.revId = revId; - } - if (docId != null) { - _result.docId = docId; - } - return _result; - } - factory NewDocUser.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory NewDocUser.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - NewDocUser clone() => NewDocUser()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - NewDocUser copyWith(void Function(NewDocUser) updates) => super.copyWith((message) => updates(message as NewDocUser)) as NewDocUser; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static NewDocUser create() => NewDocUser._(); - NewDocUser createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static NewDocUser getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static NewDocUser? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get userId => $_getSZ(0); - @$pb.TagNumber(1) - set userId($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasUserId() => $_has(0); - @$pb.TagNumber(1) - void clearUserId() => clearField(1); - - @$pb.TagNumber(2) - $fixnum.Int64 get revId => $_getI64(1); - @$pb.TagNumber(2) - set revId($fixnum.Int64 v) { $_setInt64(1, v); } - @$pb.TagNumber(2) - $core.bool hasRevId() => $_has(1); - @$pb.TagNumber(2) - void clearRevId() => clearField(2); - - @$pb.TagNumber(3) - $core.String get docId => $_getSZ(2); - @$pb.TagNumber(3) - set docId($core.String v) { $_setString(2, v); } - @$pb.TagNumber(3) - $core.bool hasDocId() => $_has(2); - @$pb.TagNumber(3) - void clearDocId() => clearField(3); -} - -class BlockId extends $pb.GeneratedMessage { - static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'BlockId', createEmptyInstance: create) - ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value') - ..hasRequiredFields = false - ; - - BlockId._() : super(); - factory BlockId({ - $core.String? value, - }) { - final _result = create(); - if (value != null) { - _result.value = value; - } - return _result; - } - factory BlockId.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory BlockId.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - BlockId clone() => BlockId()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - BlockId copyWith(void Function(BlockId) updates) => super.copyWith((message) => updates(message as BlockId)) as BlockId; // ignore: deprecated_member_use - $pb.BuilderInfo get info_ => _i; - @$core.pragma('dart2js:noInline') - static BlockId create() => BlockId._(); - BlockId createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); - @$core.pragma('dart2js:noInline') - static BlockId getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); - static BlockId? _defaultInstance; - - @$pb.TagNumber(1) - $core.String get value => $_getSZ(0); - @$pb.TagNumber(1) - set value($core.String v) { $_setString(0, v); } - @$pb.TagNumber(1) - $core.bool hasValue() => $_has(0); - @$pb.TagNumber(1) - void clearValue() => clearField(1); -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbjson.dart deleted file mode 100644 index 4e3e1a0ecd..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbjson.dart +++ /dev/null @@ -1,78 +0,0 @@ -/// -// Generated code. Do not modify. -// source: document_info.proto -// -// @dart = 2.12 -// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package - -import 'dart:core' as $core; -import 'dart:convert' as $convert; -import 'dart:typed_data' as $typed_data; -@$core.Deprecated('Use createBlockParamsDescriptor instead') -const CreateBlockParams$json = const { - '1': 'CreateBlockParams', - '2': const [ - const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, - const {'1': 'revisions', '3': 2, '4': 1, '5': 11, '6': '.RepeatedRevision', '10': 'revisions'}, - ], -}; - -/// Descriptor for `CreateBlockParams`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List createBlockParamsDescriptor = $convert.base64Decode('ChFDcmVhdGVCbG9ja1BhcmFtcxIOCgJpZBgBIAEoCVICaWQSLwoJcmV2aXNpb25zGAIgASgLMhEuUmVwZWF0ZWRSZXZpc2lvblIJcmV2aXNpb25z'); -@$core.Deprecated('Use blockInfoDescriptor instead') -const BlockInfo$json = const { - '1': 'BlockInfo', - '2': const [ - const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'text', '3': 2, '4': 1, '5': 9, '10': 'text'}, - const {'1': 'rev_id', '3': 3, '4': 1, '5': 3, '10': 'revId'}, - const {'1': 'base_rev_id', '3': 4, '4': 1, '5': 3, '10': 'baseRevId'}, - ], -}; - -/// Descriptor for `BlockInfo`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blockInfoDescriptor = $convert.base64Decode('CglCbG9ja0luZm8SGQoIYmxvY2tfaWQYASABKAlSB2Jsb2NrSWQSEgoEdGV4dBgCIAEoCVIEdGV4dBIVCgZyZXZfaWQYAyABKANSBXJldklkEh4KC2Jhc2VfcmV2X2lkGAQgASgDUgliYXNlUmV2SWQ='); -@$core.Deprecated('Use resetBlockParamsDescriptor instead') -const ResetBlockParams$json = const { - '1': 'ResetBlockParams', - '2': const [ - const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'revisions', '3': 2, '4': 1, '5': 11, '6': '.RepeatedRevision', '10': 'revisions'}, - ], -}; - -/// Descriptor for `ResetBlockParams`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List resetBlockParamsDescriptor = $convert.base64Decode('ChBSZXNldEJsb2NrUGFyYW1zEhkKCGJsb2NrX2lkGAEgASgJUgdibG9ja0lkEi8KCXJldmlzaW9ucxgCIAEoCzIRLlJlcGVhdGVkUmV2aXNpb25SCXJldmlzaW9ucw=='); -@$core.Deprecated('Use blockDeltaDescriptor instead') -const BlockDelta$json = const { - '1': 'BlockDelta', - '2': const [ - const {'1': 'block_id', '3': 1, '4': 1, '5': 9, '10': 'blockId'}, - const {'1': 'delta_str', '3': 2, '4': 1, '5': 9, '10': 'deltaStr'}, - ], -}; - -/// Descriptor for `BlockDelta`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blockDeltaDescriptor = $convert.base64Decode('CgpCbG9ja0RlbHRhEhkKCGJsb2NrX2lkGAEgASgJUgdibG9ja0lkEhsKCWRlbHRhX3N0chgCIAEoCVIIZGVsdGFTdHI='); -@$core.Deprecated('Use newDocUserDescriptor instead') -const NewDocUser$json = const { - '1': 'NewDocUser', - '2': const [ - const {'1': 'user_id', '3': 1, '4': 1, '5': 9, '10': 'userId'}, - const {'1': 'rev_id', '3': 2, '4': 1, '5': 3, '10': 'revId'}, - const {'1': 'doc_id', '3': 3, '4': 1, '5': 9, '10': 'docId'}, - ], -}; - -/// Descriptor for `NewDocUser`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List newDocUserDescriptor = $convert.base64Decode('CgpOZXdEb2NVc2VyEhcKB3VzZXJfaWQYASABKAlSBnVzZXJJZBIVCgZyZXZfaWQYAiABKANSBXJldklkEhUKBmRvY19pZBgDIAEoCVIFZG9jSWQ='); -@$core.Deprecated('Use blockIdDescriptor instead') -const BlockId$json = const { - '1': 'BlockId', - '2': const [ - const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'}, - ], -}; - -/// Descriptor for `BlockId`. Decode as a `google.protobuf.DescriptorProto`. -final $typed_data.Uint8List blockIdDescriptor = $convert.base64Decode('CgdCbG9ja0lkEhQKBXZhbHVlGAEgASgJUgV2YWx1ZQ=='); diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pb.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pb.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pb.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbenum.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbenum.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbenum.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbjson.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbjson.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbjson.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbserver.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/folder_info.pbserver.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/folder_info.pbserver.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/protobuf.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/protobuf.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/protobuf.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/protobuf.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pb.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pb.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pb.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbenum.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbenum.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbenum.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbjson.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbjson.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbjson.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbserver.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/revision.pbserver.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/revision.pbserver.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pb.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pb.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pb.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbenum.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbenum.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbenum.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbjson.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbjson.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbjson.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbserver.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/text_block_info.pbserver.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/text_block_info.pbserver.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pb.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pb.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pb.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbenum.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbenum.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbenum.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbjson.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbjson.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbjson.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbserver.dart similarity index 100% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/ws_data.pbserver.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-sync/ws_data.pbserver.dart diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pb.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pb.dart new file mode 100644 index 0000000000..bcd8d6051a --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pb.dart @@ -0,0 +1,137 @@ +/// +// Generated code. Do not modify. +// source: entities.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields + +import 'dart:core' as $core; + +import 'package:protobuf/protobuf.dart' as $pb; + +import 'entities.pbenum.dart'; + +export 'entities.pbenum.dart'; + +class ExportPayload extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportPayload', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId') + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'exportType', $pb.PbFieldType.OE, defaultOrMaker: ExportType.Text, valueOf: ExportType.valueOf, enumValues: ExportType.values) + ..hasRequiredFields = false + ; + + ExportPayload._() : super(); + factory ExportPayload({ + $core.String? viewId, + ExportType? exportType, + }) { + final _result = create(); + if (viewId != null) { + _result.viewId = viewId; + } + if (exportType != null) { + _result.exportType = exportType; + } + return _result; + } + factory ExportPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ExportPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ExportPayload clone() => ExportPayload()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ExportPayload copyWith(void Function(ExportPayload) updates) => super.copyWith((message) => updates(message as ExportPayload)) as ExportPayload; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ExportPayload create() => ExportPayload._(); + ExportPayload createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ExportPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ExportPayload? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get viewId => $_getSZ(0); + @$pb.TagNumber(1) + set viewId($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasViewId() => $_has(0); + @$pb.TagNumber(1) + void clearViewId() => clearField(1); + + @$pb.TagNumber(2) + ExportType get exportType => $_getN(1); + @$pb.TagNumber(2) + set exportType(ExportType v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasExportType() => $_has(1); + @$pb.TagNumber(2) + void clearExportType() => clearField(2); +} + +class ExportData extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportData', createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data') + ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'exportType', $pb.PbFieldType.OE, defaultOrMaker: ExportType.Text, valueOf: ExportType.valueOf, enumValues: ExportType.values) + ..hasRequiredFields = false + ; + + ExportData._() : super(); + factory ExportData({ + $core.String? data, + ExportType? exportType, + }) { + final _result = create(); + if (data != null) { + _result.data = data; + } + if (exportType != null) { + _result.exportType = exportType; + } + return _result; + } + factory ExportData.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory ExportData.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ExportData clone() => ExportData()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ExportData copyWith(void Function(ExportData) updates) => super.copyWith((message) => updates(message as ExportData)) as ExportData; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static ExportData create() => ExportData._(); + ExportData createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static ExportData getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ExportData? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get data => $_getSZ(0); + @$pb.TagNumber(1) + set data($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasData() => $_has(0); + @$pb.TagNumber(1) + void clearData() => clearField(1); + + @$pb.TagNumber(2) + ExportType get exportType => $_getN(1); + @$pb.TagNumber(2) + set exportType(ExportType v) { setField(2, v); } + @$pb.TagNumber(2) + $core.bool hasExportType() => $_has(1); + @$pb.TagNumber(2) + void clearExportType() => clearField(2); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbenum.dart new file mode 100644 index 0000000000..f5413e61f2 --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbenum.dart @@ -0,0 +1,28 @@ +/// +// Generated code. Do not modify. +// source: entities.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields + +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class ExportType extends $pb.ProtobufEnum { + static const ExportType Text = ExportType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Text'); + static const ExportType Markdown = ExportType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Markdown'); + static const ExportType Link = ExportType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Link'); + + static const $core.List values = [ + Text, + Markdown, + Link, + ]; + + static final $core.Map<$core.int, ExportType> _byValue = $pb.ProtobufEnum.initByValue(values); + static ExportType? valueOf($core.int value) => _byValue[value]; + + const ExportType._($core.int v, $core.String n) : super(v, n); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbjson.dart new file mode 100644 index 0000000000..4935602b83 --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbjson.dart @@ -0,0 +1,44 @@ +/// +// Generated code. Do not modify. +// source: entities.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use exportTypeDescriptor instead') +const ExportType$json = const { + '1': 'ExportType', + '2': const [ + const {'1': 'Text', '2': 0}, + const {'1': 'Markdown', '2': 1}, + const {'1': 'Link', '2': 2}, + ], +}; + +/// Descriptor for `ExportType`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List exportTypeDescriptor = $convert.base64Decode('CgpFeHBvcnRUeXBlEggKBFRleHQQABIMCghNYXJrZG93bhABEggKBExpbmsQAg=='); +@$core.Deprecated('Use exportPayloadDescriptor instead') +const ExportPayload$json = const { + '1': 'ExportPayload', + '2': const [ + const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'}, + const {'1': 'export_type', '3': 2, '4': 1, '5': 14, '6': '.ExportType', '10': 'exportType'}, + ], +}; + +/// Descriptor for `ExportPayload`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List exportPayloadDescriptor = $convert.base64Decode('Cg1FeHBvcnRQYXlsb2FkEhcKB3ZpZXdfaWQYASABKAlSBnZpZXdJZBIsCgtleHBvcnRfdHlwZRgCIAEoDjILLkV4cG9ydFR5cGVSCmV4cG9ydFR5cGU='); +@$core.Deprecated('Use exportDataDescriptor instead') +const ExportData$json = const { + '1': 'ExportData', + '2': const [ + const {'1': 'data', '3': 1, '4': 1, '5': 9, '10': 'data'}, + const {'1': 'export_type', '3': 2, '4': 1, '5': 14, '6': '.ExportType', '10': 'exportType'}, + ], +}; + +/// Descriptor for `ExportData`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List exportDataDescriptor = $convert.base64Decode('CgpFeHBvcnREYXRhEhIKBGRhdGEYASABKAlSBGRhdGESLAoLZXhwb3J0X3R5cGUYAiABKA4yCy5FeHBvcnRUeXBlUgpleHBvcnRUeXBl'); diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbserver.dart similarity index 83% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbserver.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbserver.dart index b619f42f96..88741cd6c2 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbserver.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/entities.pbserver.dart @@ -1,9 +1,9 @@ /// // Generated code. Do not modify. -// source: document_info.proto +// source: entities.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package -export 'document_info.pb.dart'; +export 'entities.pb.dart'; diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pb.dart similarity index 74% rename from frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbenum.dart rename to frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pb.dart index 4c8f36115e..5bfad20674 100644 --- a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbenum.dart +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pb.dart @@ -1,7 +1,11 @@ /// // Generated code. Do not modify. -// source: document_info.proto +// source: event_map.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields +import 'dart:core' as $core; + +export 'event_map.pbenum.dart'; + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbenum.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbenum.dart new file mode 100644 index 0000000000..d88c52395c --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbenum.dart @@ -0,0 +1,28 @@ +/// +// Generated code. Do not modify. +// source: event_map.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields + +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class BlockEvent extends $pb.ProtobufEnum { + static const BlockEvent GetBlockData = BlockEvent._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'GetBlockData'); + static const BlockEvent ApplyDelta = BlockEvent._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ApplyDelta'); + static const BlockEvent ExportDocument = BlockEvent._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ExportDocument'); + + static const $core.List values = [ + GetBlockData, + ApplyDelta, + ExportDocument, + ]; + + static final $core.Map<$core.int, BlockEvent> _byValue = $pb.ProtobufEnum.initByValue(values); + static BlockEvent? valueOf($core.int value) => _byValue[value]; + + const BlockEvent._($core.int v, $core.String n) : super(v, n); +} + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbjson.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbjson.dart new file mode 100644 index 0000000000..ac0f243e6f --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbjson.dart @@ -0,0 +1,22 @@ +/// +// Generated code. Do not modify. +// source: event_map.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package + +import 'dart:core' as $core; +import 'dart:convert' as $convert; +import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use blockEventDescriptor instead') +const BlockEvent$json = const { + '1': 'BlockEvent', + '2': const [ + const {'1': 'GetBlockData', '2': 0}, + const {'1': 'ApplyDelta', '2': 1}, + const {'1': 'ExportDocument', '2': 2}, + ], +}; + +/// Descriptor for `BlockEvent`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List blockEventDescriptor = $convert.base64Decode('CgpCbG9ja0V2ZW50EhAKDEdldEJsb2NrRGF0YRAAEg4KCkFwcGx5RGVsdGEQARISCg5FeHBvcnREb2N1bWVudBAC'); diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbserver.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbserver.dart new file mode 100644 index 0000000000..e359d1146c --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/event_map.pbserver.dart @@ -0,0 +1,9 @@ +/// +// Generated code. Do not modify. +// source: event_map.proto +// +// @dart = 2.12 +// ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package + +export 'event_map.pb.dart'; + diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/protobuf.dart b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/protobuf.dart new file mode 100644 index 0000000000..a2db1d12ab --- /dev/null +++ b/frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-text-block/protobuf.dart @@ -0,0 +1,3 @@ +// Auto-generated, do not edit +export './entities.pb.dart'; +export './event_map.pb.dart'; diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock index 27f3e9310e..e99f1b541b 100755 --- a/frontend/rust-lib/Cargo.lock +++ b/frontend/rust-lib/Cargo.lock @@ -818,74 +818,6 @@ dependencies = [ "syn", ] -[[package]] -name = "flowy-block" -version = "0.1.0" -dependencies = [ - "async-stream", - "bytes", - "chrono", - "color-eyre", - "criterion", - "dart-notify", - "dashmap", - "derive_more", - "diesel", - "diesel_derives", - "flowy-block", - "flowy-collaboration", - "flowy-database", - "flowy-derive", - "flowy-error", - "flowy-sync", - "flowy-test", - "futures", - "futures-util", - "lib-dispatch", - "lib-infra", - "lib-ot", - "lib-ws", - "log", - "protobuf", - "rand 0.7.3", - "serde", - "serde_json", - "strum", - "strum_macros", - "tokio", - "tracing", - "unicode-segmentation", - "url", -] - -[[package]] -name = "flowy-collaboration" -version = "0.1.0" -dependencies = [ - "async-stream", - "bytes", - "chrono", - "dashmap", - "dissimilar", - "flowy-derive", - "flowy-folder-data-model", - "flowy-grid-data-model", - "futures", - "lib-infra", - "lib-ot", - "log", - "md5", - "parking_lot", - "protobuf", - "serde", - "serde_json", - "strum", - "strum_macros", - "tokio", - "tracing", - "url", -] - [[package]] name = "flowy-database" version = "0.1.0" @@ -918,10 +850,10 @@ name = "flowy-error" version = "0.1.0" dependencies = [ "bytes", - "flowy-collaboration", "flowy-database", "flowy-derive", "flowy-error-code", + "flowy-sync", "http-flowy", "lib-dispatch", "lib-infra", @@ -950,15 +882,15 @@ dependencies = [ "dart-notify", "diesel", "diesel_derives", - "flowy-block", - "flowy-collaboration", "flowy-database", "flowy-derive", "flowy-error", "flowy-folder", "flowy-folder-data-model", + "flowy-revision", "flowy-sync", "flowy-test", + "flowy-text-block", "futures", "lazy_static", "lib-dispatch", @@ -1006,12 +938,12 @@ dependencies = [ "dart-notify", "dashmap", "diesel", - "flowy-collaboration", "flowy-database", "flowy-derive", "flowy-error", "flowy-grid", "flowy-grid-data-model", + "flowy-revision", "flowy-sync", "flowy-test", "lazy_static", @@ -1056,12 +988,12 @@ dependencies = [ "bytes", "config", "dashmap", - "flowy-block", - "flowy-collaboration", "flowy-derive", "flowy-error", "flowy-folder", "flowy-folder-data-model", + "flowy-sync", + "flowy-text-block", "flowy-user", "flowy-user-data-model", "futures-util", @@ -1084,6 +1016,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "flowy-revision" +version = "0.1.0" +dependencies = [ + "async-stream", + "bytes", + "dashmap", + "diesel", + "diesel_derives", + "flowy-database", + "flowy-error", + "flowy-sync", + "futures-util", + "lib-infra", + "lib-ot", + "lib-ws", + "serde", + "strum", + "strum_macros", + "tokio", + "tracing", +] + [[package]] name = "flowy-sdk" version = "0.1.0" @@ -1092,14 +1047,14 @@ dependencies = [ "bytes", "claim 0.5.0", "color-eyre", - "flowy-block", - "flowy-collaboration", "flowy-database", "flowy-folder", "flowy-grid", "flowy-grid-data-model", "flowy-net", + "flowy-revision", "flowy-sync", + "flowy-text-block", "flowy-user", "futures-core", "futures-util", @@ -1121,21 +1076,26 @@ version = "0.1.0" dependencies = [ "async-stream", "bytes", + "chrono", "dashmap", - "diesel", - "diesel_derives", - "flowy-collaboration", - "flowy-database", - "flowy-error", - "futures-util", + "dissimilar", + "flowy-derive", + "flowy-folder-data-model", + "flowy-grid-data-model", + "futures", "lib-infra", "lib-ot", - "lib-ws", + "log", + "md5", + "parking_lot", + "protobuf", "serde", + "serde_json", "strum", "strum_macros", "tokio", "tracing", + "url", ] [[package]] @@ -1147,10 +1107,10 @@ dependencies = [ "claim 0.4.0", "claim 0.5.0", "fake", - "flowy-collaboration", "flowy-folder", "flowy-net", "flowy-sdk", + "flowy-sync", "flowy-user", "futures", "futures-util", @@ -1168,6 +1128,46 @@ dependencies = [ "tokio", ] +[[package]] +name = "flowy-text-block" +version = "0.1.0" +dependencies = [ + "async-stream", + "bytes", + "chrono", + "color-eyre", + "criterion", + "dart-notify", + "dashmap", + "derive_more", + "diesel", + "diesel_derives", + "flowy-database", + "flowy-derive", + "flowy-error", + "flowy-revision", + "flowy-sync", + "flowy-test", + "flowy-text-block", + "futures", + "futures-util", + "lib-dispatch", + "lib-infra", + "lib-ot", + "lib-ws", + "log", + "protobuf", + "rand 0.7.3", + "serde", + "serde_json", + "strum", + "strum_macros", + "tokio", + "tracing", + "unicode-segmentation", + "url", +] + [[package]] name = "flowy-user" version = "0.1.0" diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml index 42f8187844..d4cc70df5f 100644 --- a/frontend/rust-lib/Cargo.toml +++ b/frontend/rust-lib/Cargo.toml @@ -11,9 +11,9 @@ members = [ "flowy-database", "flowy-folder", "dart-notify", - "flowy-block", + "flowy-text-block", "flowy-error", - "flowy-sync", + "flowy-revision", "flowy-grid", ] diff --git a/frontend/rust-lib/flowy-error/Cargo.toml b/frontend/rust-lib/flowy-error/Cargo.toml index b7a816b026..5041facaca 100644 --- a/frontend/rust-lib/flowy-error/Cargo.toml +++ b/frontend/rust-lib/flowy-error/Cargo.toml @@ -13,7 +13,7 @@ protobuf = {version = "2.20.0"} bytes = "1.0" -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration", optional = true} +flowy-sync = { path = "../../../shared-lib/flowy-sync", optional = true} lib-ot = { path = "../../../shared-lib/lib-ot", optional = true} serde_json = {version = "1.0", optional = true} http-flowy = { git = "https://github.com/AppFlowy-IO/AppFlowy-Server", optional = true} @@ -22,7 +22,7 @@ r2d2 = { version = "0.8", optional = true} lib-sqlite = { path = "../lib-sqlite", optional = true } [features] -collaboration = ["flowy-collaboration"] +collaboration = ["flowy-sync"] ot = ["lib-ot"] serde = ["serde_json"] http_server = ["http-flowy"] diff --git a/frontend/rust-lib/flowy-error/src/ext/collaborate.rs b/frontend/rust-lib/flowy-error/src/ext/collaborate.rs index c4a6725794..f93b2b7bc3 100644 --- a/frontend/rust-lib/flowy-error/src/ext/collaborate.rs +++ b/frontend/rust-lib/flowy-error/src/ext/collaborate.rs @@ -1,9 +1,9 @@ use crate::FlowyError; -use flowy_collaboration::errors::ErrorCode; +use flowy_sync::errors::ErrorCode; -impl std::convert::From for FlowyError { - fn from(error: flowy_collaboration::errors::CollaborateError) -> Self { +impl std::convert::From for FlowyError { + fn from(error: flowy_sync::errors::CollaborateError) -> Self { match error.code { ErrorCode::RecordNotFound => FlowyError::record_not_found().context(error.msg), _ => FlowyError::internal().context(error.msg), diff --git a/frontend/rust-lib/flowy-folder/Cargo.toml b/frontend/rust-lib/flowy-folder/Cargo.toml index 92e7b7b535..93ff98a6f3 100644 --- a/frontend/rust-lib/flowy-folder/Cargo.toml +++ b/frontend/rust-lib/flowy-folder/Cargo.toml @@ -7,17 +7,17 @@ edition = "2018" [dependencies] flowy-folder-data-model = { path = "../../../shared-lib/flowy-folder-data-model" } -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" } +flowy-sync = { path = "../../../shared-lib/flowy-sync" } flowy-derive = { path = "../../../shared-lib/flowy-derive" } lib-ot = { path = "../../../shared-lib/lib-ot" } lib-infra = { path = "../../../shared-lib/lib-infra" } -flowy-block = { path = "../flowy-block" } +flowy-text-block = { path = "../flowy-text-block" } flowy-database = { path = "../flowy-database" } flowy-error = { path = "../flowy-error", features = ["db", "http_server"]} dart-notify = { path = "../dart-notify" } lib-dispatch = { path = "../lib-dispatch" } -flowy-sync = { path = "../flowy-sync" } +flowy-revision = { path = "../flowy-revision" } parking_lot = "0.11" protobuf = {version = "2.18.0"} @@ -45,5 +45,5 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file [features] default = [] http_server = [] -flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"] +flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-revision/flowy_unit_test"] dart = ["lib-infra/dart", "flowy-folder/dart"] \ No newline at end of file diff --git a/frontend/rust-lib/flowy-folder/src/manager.rs b/frontend/rust-lib/flowy-folder/src/manager.rs index d93dca3f4e..05847f8cc1 100644 --- a/frontend/rust-lib/flowy-folder/src/manager.rs +++ b/frontend/rust-lib/flowy-folder/src/manager.rs @@ -9,14 +9,14 @@ use crate::{ }, }; use bytes::Bytes; -use flowy_collaboration::client_document::default::{initial_quill_delta_string, initial_read_me}; +use flowy_sync::client_document::default::{initial_quill_delta_string, initial_read_me}; -use flowy_collaboration::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData}; use flowy_error::FlowyError; use flowy_folder_data_model::entities::view::ViewDataType; use flowy_folder_data_model::user_default; -use flowy_sync::disk::SQLiteTextBlockRevisionPersistence; -use flowy_sync::{RevisionManager, RevisionPersistence, RevisionWebSocket}; +use flowy_revision::disk::SQLiteTextBlockRevisionPersistence; +use flowy_revision::{RevisionManager, RevisionPersistence, RevisionWebSocket}; +use flowy_sync::{client_folder::FolderPad, entities::ws_data::ServerRevisionWSData}; use lazy_static::lazy_static; use lib_infra::future::FutureResult; use std::{collections::HashMap, convert::TryInto, fmt::Formatter, sync::Arc}; diff --git a/frontend/rust-lib/flowy-folder/src/services/folder_editor.rs b/frontend/rust-lib/flowy-folder/src/services/folder_editor.rs index 48c83cc612..99867fb484 100644 --- a/frontend/rust-lib/flowy-folder/src/services/folder_editor.rs +++ b/frontend/rust-lib/flowy-folder/src/services/folder_editor.rs @@ -1,15 +1,15 @@ use crate::services::web_socket::make_folder_ws_manager; -use flowy_collaboration::{ +use flowy_sync::{ client_folder::{FolderChange, FolderPad}, entities::{revision::Revision, ws_data::ServerRevisionWSData}, }; use crate::manager::FolderId; use bytes::Bytes; -use flowy_collaboration::util::make_delta_from_revisions; use flowy_error::{FlowyError, FlowyResult}; +use flowy_sync::util::make_delta_from_revisions; -use flowy_sync::{ +use flowy_revision::{ RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder, RevisionWebSocket, RevisionWebSocketManager, }; diff --git a/frontend/rust-lib/flowy-folder/src/services/persistence/migration.rs b/frontend/rust-lib/flowy-folder/src/services/persistence/migration.rs index c08a4c226e..bc8838059a 100644 --- a/frontend/rust-lib/flowy-folder/src/services/persistence/migration.rs +++ b/frontend/rust-lib/flowy-folder/src/services/persistence/migration.rs @@ -3,7 +3,6 @@ use crate::{ event_map::WorkspaceDatabase, services::persistence::{AppTableSql, TrashTableSql, ViewTableSql, WorkspaceTableSql}, }; -use flowy_collaboration::{client_folder::FolderPad, entities::revision::md5}; use flowy_database::kv::KV; use flowy_error::{FlowyError, FlowyResult}; use flowy_folder_data_model::entities::{ @@ -11,8 +10,9 @@ use flowy_folder_data_model::entities::{ view::{RepeatedView, View}, workspace::Workspace, }; -use flowy_sync::disk::SQLiteTextBlockRevisionPersistence; -use flowy_sync::{RevisionLoader, RevisionPersistence}; +use flowy_revision::disk::SQLiteTextBlockRevisionPersistence; +use flowy_revision::{RevisionLoader, RevisionPersistence}; +use flowy_sync::{client_folder::FolderPad, entities::revision::md5}; use std::sync::Arc; const V1_MIGRATION: &str = "FOLDER_V1_MIGRATION"; diff --git a/frontend/rust-lib/flowy-folder/src/services/persistence/mod.rs b/frontend/rust-lib/flowy-folder/src/services/persistence/mod.rs index ccb35cc8ac..89b7245da9 100644 --- a/frontend/rust-lib/flowy-folder/src/services/persistence/mod.rs +++ b/frontend/rust-lib/flowy-folder/src/services/persistence/mod.rs @@ -7,8 +7,6 @@ use crate::{ manager::FolderId, services::{folder_editor::ClientFolderEditor, persistence::migration::FolderMigration}, }; -use flowy_collaboration::client_folder::initial_folder_delta; -use flowy_collaboration::{client_folder::FolderPad, entities::revision::Revision}; use flowy_database::ConnectionPool; use flowy_error::{FlowyError, FlowyResult}; use flowy_folder_data_model::entities::{ @@ -17,8 +15,10 @@ use flowy_folder_data_model::entities::{ view::View, workspace::Workspace, }; -use flowy_sync::disk::{RevisionRecord, RevisionState}; -use flowy_sync::mk_revision_disk_cache; +use flowy_revision::disk::{RevisionRecord, RevisionState}; +use flowy_revision::mk_revision_disk_cache; +use flowy_sync::client_folder::initial_folder_delta; +use flowy_sync::{client_folder::FolderPad, entities::revision::Revision}; use std::sync::Arc; use tokio::sync::RwLock; pub use version_1::{app_sql::*, trash_sql::*, v1_impl::V1Transaction, view_sql::*, workspace_sql::*}; diff --git a/frontend/rust-lib/flowy-folder/src/services/view/controller.rs b/frontend/rust-lib/flowy-folder/src/services/view/controller.rs index c9851d6652..185521eac3 100644 --- a/frontend/rust-lib/flowy-folder/src/services/view/controller.rs +++ b/frontend/rust-lib/flowy-folder/src/services/view/controller.rs @@ -13,9 +13,9 @@ use crate::{ }, }; use bytes::Bytes; -use flowy_collaboration::entities::text_block_info::TextBlockId; use flowy_database::kv::KV; use flowy_folder_data_model::entities::view::ViewDataType; +use flowy_sync::entities::text_block_info::TextBlockId; use futures::{FutureExt, StreamExt}; use lib_infra::uuid; use std::{collections::HashSet, sync::Arc}; diff --git a/frontend/rust-lib/flowy-folder/src/services/web_socket.rs b/frontend/rust-lib/flowy-folder/src/services/web_socket.rs index 98902b8878..c14db04d3f 100644 --- a/frontend/rust-lib/flowy-folder/src/services/web_socket.rs +++ b/frontend/rust-lib/flowy-folder/src/services/web_socket.rs @@ -1,14 +1,14 @@ use crate::services::FOLDER_SYNC_INTERVAL_IN_MILLIS; use bytes::Bytes; -use flowy_collaboration::{ +use flowy_error::FlowyError; +use flowy_revision::*; +use flowy_sync::{ client_folder::FolderPad, entities::{ revision::RevisionRange, ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSDataType}, }, }; -use flowy_error::FlowyError; -use flowy_sync::*; use lib_infra::future::{BoxResultFuture, FutureResult}; use lib_ot::core::{OperationTransformable, PlainTextAttributes, PlainTextDelta}; use parking_lot::RwLock; diff --git a/frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs b/frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs index 9f9bae4a82..68a1bcea65 100644 --- a/frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs +++ b/frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs @@ -2,7 +2,7 @@ use crate::script::{invalid_workspace_name_test_case, FolderScript::*, FolderTes use flowy_folder::entities::workspace::CreateWorkspacePayload; use flowy_folder_data_model::entities::view::ViewDataType; -use flowy_sync::disk::RevisionState; +use flowy_revision::disk::RevisionState; use flowy_test::{event_builder::*, FlowySDKTest}; #[tokio::test] diff --git a/frontend/rust-lib/flowy-folder/tests/workspace/script.rs b/frontend/rust-lib/flowy-folder/tests/workspace/script.rs index e476c36f2d..a6fd1fbe29 100644 --- a/frontend/rust-lib/flowy-folder/tests/workspace/script.rs +++ b/frontend/rust-lib/flowy-folder/tests/workspace/script.rs @@ -1,4 +1,3 @@ -use flowy_collaboration::entities::text_block_info::TextBlockInfo; use flowy_folder::event_map::FolderEvent::*; use flowy_folder::{errors::ErrorCode, services::folder_editor::ClientFolderEditor}; use flowy_folder_data_model::entities::view::{RepeatedViewId, ViewId}; @@ -15,8 +14,9 @@ use flowy_folder_data_model::entities::{ view::{CreateViewPayload, UpdateViewPayload}, workspace::{CreateWorkspacePayload, RepeatedWorkspace}, }; -use flowy_sync::disk::RevisionState; -use flowy_sync::REVISION_WRITE_INTERVAL_IN_MILLIS; +use flowy_revision::disk::RevisionState; +use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS; +use flowy_sync::entities::text_block_info::TextBlockInfo; use flowy_test::{event_builder::*, FlowySDKTest}; use std::{sync::Arc, time::Duration}; use tokio::time::sleep; diff --git a/frontend/rust-lib/flowy-grid/Cargo.toml b/frontend/rust-lib/flowy-grid/Cargo.toml index 599f41c043..3549bedd08 100644 --- a/frontend/rust-lib/flowy-grid/Cargo.toml +++ b/frontend/rust-lib/flowy-grid/Cargo.toml @@ -8,13 +8,13 @@ edition = "2021" [dependencies] lib-dispatch = { path = "../lib-dispatch" } dart-notify = { path = "../dart-notify" } -flowy-sync = { path = "../flowy-sync" } +flowy-revision = { path = "../flowy-revision" } flowy-error = { path = "../flowy-error", features = ["db"]} flowy-derive = { path = "../../../shared-lib/flowy-derive" } lib-ot = { path = "../../../shared-lib/lib-ot" } lib-infra = { path = "../../../shared-lib/lib-infra" } flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" } -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" } +flowy-sync = { path = "../../../shared-lib/flowy-sync" } flowy-database = { path = "../flowy-database" } strum = "0.21" @@ -45,4 +45,4 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file [features] default = [] dart = ["lib-infra/dart"] -flowy_unit_test = ["flowy-sync/flowy_unit_test"] \ No newline at end of file +flowy_unit_test = ["flowy-revision/flowy_unit_test"] \ No newline at end of file diff --git a/frontend/rust-lib/flowy-grid/src/manager.rs b/frontend/rust-lib/flowy-grid/src/manager.rs index b0c1e16623..75499acdac 100644 --- a/frontend/rust-lib/flowy-grid/src/manager.rs +++ b/frontend/rust-lib/flowy-grid/src/manager.rs @@ -2,13 +2,13 @@ use crate::services::grid_editor::ClientGridEditor; use crate::services::kv_persistence::GridKVPersistence; use bytes::Bytes; use dashmap::DashMap; -use flowy_collaboration::client_grid::{make_block_meta_delta, make_grid_delta}; -use flowy_collaboration::entities::revision::{RepeatedRevision, Revision}; use flowy_database::ConnectionPool; use flowy_error::{FlowyError, FlowyResult}; use flowy_grid_data_model::entities::{BuildGridContext, GridMeta}; -use flowy_sync::disk::{SQLiteGridBlockMetaRevisionPersistence, SQLiteGridRevisionPersistence}; -use flowy_sync::{RevisionManager, RevisionPersistence, RevisionWebSocket}; +use flowy_revision::disk::{SQLiteGridBlockMetaRevisionPersistence, SQLiteGridRevisionPersistence}; +use flowy_revision::{RevisionManager, RevisionPersistence, RevisionWebSocket}; +use flowy_sync::client_grid::{make_block_meta_delta, make_grid_delta}; +use flowy_sync::entities::revision::{RepeatedRevision, Revision}; use std::sync::Arc; use tokio::sync::RwLock; diff --git a/frontend/rust-lib/flowy-grid/src/services/block_meta_editor.rs b/frontend/rust-lib/flowy-grid/src/services/block_meta_editor.rs index 650b537221..ca3f99b363 100644 --- a/frontend/rust-lib/flowy-grid/src/services/block_meta_editor.rs +++ b/frontend/rust-lib/flowy-grid/src/services/block_meta_editor.rs @@ -4,17 +4,17 @@ use bytes::Bytes; use crate::dart_notification::{send_dart_notification, GridNotification}; use dashmap::DashMap; -use flowy_collaboration::client_grid::{GridBlockMetaChange, GridBlockMetaPad}; -use flowy_collaboration::entities::revision::Revision; -use flowy_collaboration::util::make_delta_from_revisions; use flowy_error::{FlowyError, FlowyResult}; use flowy_grid_data_model::entities::{ FieldMeta, GridBlockId, GridBlockMeta, GridBlockMetaChangeset, RepeatedCell, RowMeta, RowMetaChangeset, RowOrder, }; -use flowy_sync::disk::SQLiteGridBlockMetaRevisionPersistence; -use flowy_sync::{ +use flowy_revision::disk::SQLiteGridBlockMetaRevisionPersistence; +use flowy_revision::{ RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder, RevisionPersistence, }; +use flowy_sync::client_grid::{GridBlockMetaChange, GridBlockMetaPad}; +use flowy_sync::entities::revision::Revision; +use flowy_sync::util::make_delta_from_revisions; use lib_infra::future::FutureResult; use lib_ot::core::PlainTextAttributes; use std::collections::HashMap; diff --git a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs index d1276bb8ab..7bcbe39830 100644 --- a/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs +++ b/frontend/rust-lib/flowy-grid/src/services/grid_editor.rs @@ -1,14 +1,14 @@ use crate::manager::GridUser; use crate::services::block_meta_editor::GridBlockMetaEditorManager; use bytes::Bytes; -use flowy_collaboration::client_grid::{GridChangeset, GridMetaPad}; -use flowy_collaboration::entities::revision::Revision; -use flowy_collaboration::util::make_delta_from_revisions; use flowy_error::{FlowyError, FlowyResult}; use flowy_grid_data_model::entities::{ CellMetaChangeset, Field, FieldChangeset, FieldMeta, Grid, GridBlockMeta, GridBlockMetaChangeset, GridBlockOrder, RepeatedField, RepeatedFieldOrder, RepeatedGridBlock, RepeatedRow, Row, RowMeta, RowMetaChangeset, RowOrder, }; +use flowy_sync::client_grid::{GridChangeset, GridMetaPad}; +use flowy_sync::entities::revision::Revision; +use flowy_sync::util::make_delta_from_revisions; use std::collections::HashMap; use crate::dart_notification::{send_dart_notification, GridNotification}; @@ -16,7 +16,7 @@ use crate::services::row::{ make_grid_block_from_block_metas, make_grid_blocks, make_row_meta_from_context, make_rows_from_row_metas, serialize_cell_data, CreateRowMetaBuilder, CreateRowMetaPayload, GridBlockMetaData, }; -use flowy_sync::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder}; +use flowy_revision::{RevisionCloudService, RevisionCompactor, RevisionManager, RevisionObjectBuilder}; use lib_infra::future::FutureResult; use lib_ot::core::PlainTextAttributes; use std::sync::Arc; diff --git a/frontend/rust-lib/flowy-grid/src/util.rs b/frontend/rust-lib/flowy-grid/src/util.rs index 82d5399f9e..1c10eb1726 100644 --- a/frontend/rust-lib/flowy-grid/src/util.rs +++ b/frontend/rust-lib/flowy-grid/src/util.rs @@ -1,7 +1,7 @@ use crate::services::cell::*; use crate::services::field::*; -use flowy_collaboration::client_grid::GridBuilder; use flowy_grid_data_model::entities::{BuildGridContext, FieldType}; +use flowy_sync::client_grid::GridBuilder; pub fn make_default_grid() -> BuildGridContext { let text_field = FieldBuilder::new(RichTextTypeOptionsBuilder::default()) diff --git a/frontend/rust-lib/flowy-grid/tests/grid/script.rs b/frontend/rust-lib/flowy-grid/tests/grid/script.rs index eba36d8bbd..0da0a911f1 100644 --- a/frontend/rust-lib/flowy-grid/tests/grid/script.rs +++ b/frontend/rust-lib/flowy-grid/tests/grid/script.rs @@ -1,5 +1,5 @@ use bytes::Bytes; -use flowy_collaboration::client_grid::GridBuilder; +use flowy_sync::client_grid::GridBuilder; use std::collections::HashMap; use flowy_grid::services::cell::*; @@ -10,7 +10,7 @@ use flowy_grid_data_model::entities::{ BuildGridContext, CellMetaChangeset, FieldChangeset, FieldMeta, FieldType, GridBlockMeta, GridBlockMetaChangeset, RowMeta, RowMetaChangeset, RowOrder, }; -use flowy_sync::REVISION_WRITE_INTERVAL_IN_MILLIS; +use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS; use flowy_test::helper::ViewTest; use flowy_test::FlowySDKTest; use std::sync::Arc; diff --git a/frontend/rust-lib/flowy-net/Cargo.toml b/frontend/rust-lib/flowy-net/Cargo.toml index e494f6f5d1..b8e22e7f30 100644 --- a/frontend/rust-lib/flowy-net/Cargo.toml +++ b/frontend/rust-lib/flowy-net/Cargo.toml @@ -9,12 +9,12 @@ edition = "2018" lib-dispatch = { path = "../lib-dispatch" } flowy-error = { path = "../flowy-error", features = ["collaboration", "http_server"] } flowy-derive = { path = "../../../shared-lib/flowy-derive" } -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration"} +flowy-sync = { path = "../../../shared-lib/flowy-sync"} flowy-folder-data-model = { path = "../../../shared-lib/flowy-folder-data-model"} flowy-user-data-model = { path = "../../../shared-lib/flowy-user-data-model"} flowy-folder = { path = "../flowy-folder" } flowy-user = { path = "../flowy-user" } -flowy-block = { path = "../flowy-block" } +flowy-text-block = { path = "../flowy-text-block" } lazy_static = "1.4.0" lib-infra = { path = "../../../shared-lib/lib-infra" } protobuf = {version = "2.18.0"} @@ -43,7 +43,7 @@ http_server = [] dart = [ "lib-infra/dart", "flowy-user/dart", - "flowy-collaboration/dart", + "flowy-sync/dart", "flowy-error/dart", "flowy-user-data-model/dart", "flowy-folder-data-model/dart" diff --git a/frontend/rust-lib/flowy-net/src/http_server/document.rs b/frontend/rust-lib/flowy-net/src/http_server/document.rs index 1016e903e4..f10c737a95 100644 --- a/frontend/rust-lib/flowy-net/src/http_server/document.rs +++ b/frontend/rust-lib/flowy-net/src/http_server/document.rs @@ -2,11 +2,9 @@ use crate::{ configuration::*, request::{HttpRequestBuilder, ResponseMiddleware}, }; -use flowy_block::BlockCloudService; -use flowy_collaboration::entities::text_block_info::{ - CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo, -}; use flowy_error::FlowyError; +use flowy_sync::entities::text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo}; +use flowy_text_block::BlockCloudService; use http_flowy::response::FlowyResponse; use lazy_static::lazy_static; use lib_infra::future::FutureResult; diff --git a/frontend/rust-lib/flowy-net/src/local_server/persistence.rs b/frontend/rust-lib/flowy-net/src/local_server/persistence.rs index 525b487ce4..6d7dd9c342 100644 --- a/frontend/rust-lib/flowy-net/src/local_server/persistence.rs +++ b/frontend/rust-lib/flowy-net/src/local_server/persistence.rs @@ -1,4 +1,4 @@ -use flowy_collaboration::{ +use flowy_sync::{ entities::{folder_info::FolderInfo, text_block_info::TextBlockInfo}, errors::CollaborateError, protobuf::{RepeatedRevision as RepeatedRevisionPB, Revision as RevisionPB}, diff --git a/frontend/rust-lib/flowy-net/src/local_server/server.rs b/frontend/rust-lib/flowy-net/src/local_server/server.rs index 6bcd538a6b..48ead1c03d 100644 --- a/frontend/rust-lib/flowy-net/src/local_server/server.rs +++ b/frontend/rust-lib/flowy-net/src/local_server/server.rs @@ -1,7 +1,9 @@ use crate::local_server::persistence::LocalTextBlockCloudPersistence; use async_stream::stream; use bytes::Bytes; -use flowy_collaboration::{ +use flowy_error::{internal_error, FlowyError}; +use flowy_folder::event_map::FolderCouldServiceV1; +use flowy_sync::{ client_document::default::initial_quill_delta_string, entities::{ text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo}, @@ -13,8 +15,6 @@ use flowy_collaboration::{ server_folder::ServerFolderManager, synchronizer::{RevisionSyncResponse, RevisionUser}, }; -use flowy_error::{internal_error, FlowyError}; -use flowy_folder::event_map::FolderCouldServiceV1; use futures_util::stream::StreamExt; use lib_ws::{WSChannel, WebSocketRawMessage}; use parking_lot::RwLock; @@ -251,13 +251,13 @@ impl RevisionUser for LocalRevisionUser { } } -use flowy_block::BlockCloudService; use flowy_folder_data_model::entities::{ app::{App, AppId, CreateAppParams, RepeatedApp, UpdateAppParams}, trash::{RepeatedTrash, RepeatedTrashId}, view::{CreateViewParams, RepeatedView, RepeatedViewId, UpdateViewParams, View, ViewId}, workspace::{CreateWorkspaceParams, RepeatedWorkspace, UpdateWorkspaceParams, Workspace, WorkspaceId}, }; +use flowy_text_block::BlockCloudService; use flowy_user::event_map::UserCloudService; use flowy_user_data_model::entities::{ SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserParams, UserProfile, diff --git a/frontend/rust-lib/flowy-sync/Cargo.toml b/frontend/rust-lib/flowy-revision/Cargo.toml similarity index 86% rename from frontend/rust-lib/flowy-sync/Cargo.toml rename to frontend/rust-lib/flowy-revision/Cargo.toml index 42e43826ba..504e05a2ce 100644 --- a/frontend/rust-lib/flowy-sync/Cargo.toml +++ b/frontend/rust-lib/flowy-revision/Cargo.toml @@ -1,12 +1,12 @@ [package] -name = "flowy-sync" +name = "flowy-revision" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" } +flowy-sync = { path = "../../../shared-lib/flowy-sync" } lib-ot = { path = "../../../shared-lib/lib-ot" } lib-ws = { path = "../../../shared-lib/lib-ws" } lib-infra = { path = "../../../shared-lib/lib-infra" } diff --git a/frontend/rust-lib/flowy-sync/src/cache/disk/folder_rev_impl.rs b/frontend/rust-lib/flowy-revision/src/cache/disk/folder_rev_impl.rs similarity index 100% rename from frontend/rust-lib/flowy-sync/src/cache/disk/folder_rev_impl.rs rename to frontend/rust-lib/flowy-revision/src/cache/disk/folder_rev_impl.rs diff --git a/frontend/rust-lib/flowy-sync/src/cache/disk/grid_meta_rev_impl.rs b/frontend/rust-lib/flowy-revision/src/cache/disk/grid_meta_rev_impl.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/cache/disk/grid_meta_rev_impl.rs rename to frontend/rust-lib/flowy-revision/src/cache/disk/grid_meta_rev_impl.rs index 4cd46058bf..e850119c30 100644 --- a/frontend/rust-lib/flowy-sync/src/cache/disk/grid_meta_rev_impl.rs +++ b/frontend/rust-lib/flowy-revision/src/cache/disk/grid_meta_rev_impl.rs @@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState}; use bytes::Bytes; use diesel::{sql_types::Integer, update, SqliteConnection}; -use flowy_collaboration::{ - entities::revision::{Revision, RevisionRange}, - util::md5, -}; use flowy_database::{ impl_sql_integer_expression, insert_or_ignore_into, prelude::*, @@ -14,6 +10,10 @@ use flowy_database::{ ConnectionPool, }; use flowy_error::{internal_error, FlowyError, FlowyResult}; +use flowy_sync::{ + entities::revision::{Revision, RevisionRange}, + util::md5, +}; use std::sync::Arc; pub struct SQLiteGridBlockMetaRevisionPersistence { diff --git a/frontend/rust-lib/flowy-sync/src/cache/disk/grid_rev_impl.rs b/frontend/rust-lib/flowy-revision/src/cache/disk/grid_rev_impl.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/cache/disk/grid_rev_impl.rs rename to frontend/rust-lib/flowy-revision/src/cache/disk/grid_rev_impl.rs index 414bbb96c9..d51ea8e48c 100644 --- a/frontend/rust-lib/flowy-sync/src/cache/disk/grid_rev_impl.rs +++ b/frontend/rust-lib/flowy-revision/src/cache/disk/grid_rev_impl.rs @@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState}; use bytes::Bytes; use diesel::{sql_types::Integer, update, SqliteConnection}; -use flowy_collaboration::{ - entities::revision::{Revision, RevisionRange}, - util::md5, -}; use flowy_database::{ impl_sql_integer_expression, insert_or_ignore_into, prelude::*, @@ -14,6 +10,10 @@ use flowy_database::{ ConnectionPool, }; use flowy_error::{internal_error, FlowyError, FlowyResult}; +use flowy_sync::{ + entities::revision::{Revision, RevisionRange}, + util::md5, +}; use std::sync::Arc; pub struct SQLiteGridRevisionPersistence { diff --git a/frontend/rust-lib/flowy-sync/src/cache/disk/mod.rs b/frontend/rust-lib/flowy-revision/src/cache/disk/mod.rs similarity index 96% rename from frontend/rust-lib/flowy-sync/src/cache/disk/mod.rs rename to frontend/rust-lib/flowy-revision/src/cache/disk/mod.rs index 3a278afe36..945c6d707f 100644 --- a/frontend/rust-lib/flowy-sync/src/cache/disk/mod.rs +++ b/frontend/rust-lib/flowy-revision/src/cache/disk/mod.rs @@ -8,8 +8,8 @@ pub use grid_meta_rev_impl::*; pub use grid_rev_impl::*; pub use text_rev_impl::*; -use flowy_collaboration::entities::revision::{RevId, Revision, RevisionRange}; use flowy_error::FlowyResult; +use flowy_sync::entities::revision::{RevId, Revision, RevisionRange}; use std::fmt::Debug; pub trait RevisionDiskCache: Sync + Send { diff --git a/frontend/rust-lib/flowy-sync/src/cache/disk/text_rev_impl.rs b/frontend/rust-lib/flowy-revision/src/cache/disk/text_rev_impl.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/cache/disk/text_rev_impl.rs rename to frontend/rust-lib/flowy-revision/src/cache/disk/text_rev_impl.rs index 13a8298916..165864d5db 100644 --- a/frontend/rust-lib/flowy-sync/src/cache/disk/text_rev_impl.rs +++ b/frontend/rust-lib/flowy-revision/src/cache/disk/text_rev_impl.rs @@ -3,10 +3,6 @@ use crate::disk::{RevisionChangeset, RevisionRecord, RevisionState}; use bytes::Bytes; use diesel::{sql_types::Integer, update, SqliteConnection}; -use flowy_collaboration::{ - entities::revision::{RevType, Revision, RevisionRange}, - util::md5, -}; use flowy_database::{ impl_sql_integer_expression, insert_or_ignore_into, prelude::*, @@ -14,6 +10,10 @@ use flowy_database::{ ConnectionPool, }; use flowy_error::{internal_error, FlowyError, FlowyResult}; +use flowy_sync::{ + entities::revision::{RevType, Revision, RevisionRange}, + util::md5, +}; use std::sync::Arc; pub struct SQLiteTextBlockRevisionPersistence { diff --git a/frontend/rust-lib/flowy-sync/src/cache/memory.rs b/frontend/rust-lib/flowy-revision/src/cache/memory.rs similarity index 98% rename from frontend/rust-lib/flowy-sync/src/cache/memory.rs rename to frontend/rust-lib/flowy-revision/src/cache/memory.rs index f709abcdd2..6120c3f224 100644 --- a/frontend/rust-lib/flowy-sync/src/cache/memory.rs +++ b/frontend/rust-lib/flowy-revision/src/cache/memory.rs @@ -1,8 +1,8 @@ use crate::disk::RevisionRecord; use crate::REVISION_WRITE_INTERVAL_IN_MILLIS; use dashmap::DashMap; -use flowy_collaboration::entities::revision::RevisionRange; use flowy_error::{FlowyError, FlowyResult}; +use flowy_sync::entities::revision::RevisionRange; use std::{borrow::Cow, sync::Arc, time::Duration}; use tokio::{sync::RwLock, task::JoinHandle}; diff --git a/frontend/rust-lib/flowy-sync/src/cache/mod.rs b/frontend/rust-lib/flowy-revision/src/cache/mod.rs similarity index 100% rename from frontend/rust-lib/flowy-sync/src/cache/mod.rs rename to frontend/rust-lib/flowy-revision/src/cache/mod.rs diff --git a/frontend/rust-lib/flowy-sync/src/conflict_resolve.rs b/frontend/rust-lib/flowy-revision/src/conflict_resolve.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/conflict_resolve.rs rename to frontend/rust-lib/flowy-revision/src/conflict_resolve.rs index a4f4f6c818..0a63f37f3e 100644 --- a/frontend/rust-lib/flowy-sync/src/conflict_resolve.rs +++ b/frontend/rust-lib/flowy-revision/src/conflict_resolve.rs @@ -1,13 +1,13 @@ use crate::RevisionManager; use bytes::Bytes; -use flowy_collaboration::{ +use flowy_error::{FlowyError, FlowyResult}; +use flowy_sync::{ entities::{ revision::{RepeatedRevision, Revision, RevisionRange}, ws_data::ServerRevisionWSDataType, }, util::make_delta_from_revisions, }; -use flowy_error::{FlowyError, FlowyResult}; use lib_infra::future::BoxResultFuture; use lib_ot::core::{Attributes, Delta, PlainTextAttributes}; use lib_ot::rich_text::RichTextAttributes; diff --git a/frontend/rust-lib/flowy-sync/src/lib.rs b/frontend/rust-lib/flowy-revision/src/lib.rs similarity index 100% rename from frontend/rust-lib/flowy-sync/src/lib.rs rename to frontend/rust-lib/flowy-revision/src/lib.rs diff --git a/frontend/rust-lib/flowy-sync/src/rev_manager.rs b/frontend/rust-lib/flowy-revision/src/rev_manager.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/rev_manager.rs rename to frontend/rust-lib/flowy-revision/src/rev_manager.rs index 7b34bb8115..3cd9b54de0 100644 --- a/frontend/rust-lib/flowy-sync/src/rev_manager.rs +++ b/frontend/rust-lib/flowy-revision/src/rev_manager.rs @@ -1,11 +1,11 @@ use crate::disk::RevisionState; use crate::{RevisionPersistence, WSDataProviderDataSource}; use bytes::Bytes; -use flowy_collaboration::{ +use flowy_error::{FlowyError, FlowyResult}; +use flowy_sync::{ entities::revision::{RepeatedRevision, Revision, RevisionRange}, util::{pair_rev_id_from_revisions, RevIdCounter}, }; -use flowy_error::{FlowyError, FlowyResult}; use lib_infra::future::FutureResult; use std::sync::Arc; diff --git a/frontend/rust-lib/flowy-sync/src/rev_persistence.rs b/frontend/rust-lib/flowy-revision/src/rev_persistence.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/rev_persistence.rs rename to frontend/rust-lib/flowy-revision/src/rev_persistence.rs index 8a1d9647c4..6412b26ec6 100644 --- a/frontend/rust-lib/flowy-sync/src/rev_persistence.rs +++ b/frontend/rust-lib/flowy-revision/src/rev_persistence.rs @@ -5,9 +5,9 @@ use crate::cache::{ use crate::disk::{RevisionRecord, RevisionState}; use crate::memory::RevisionMemoryCache; use crate::RevisionCompactor; -use flowy_collaboration::entities::revision::{Revision, RevisionRange}; use flowy_database::ConnectionPool; use flowy_error::{internal_error, FlowyError, FlowyResult}; +use flowy_sync::entities::revision::{Revision, RevisionRange}; use std::collections::VecDeque; use std::{borrow::Cow, sync::Arc}; use tokio::sync::RwLock; diff --git a/frontend/rust-lib/flowy-sync/src/ws_manager.rs b/frontend/rust-lib/flowy-revision/src/ws_manager.rs similarity index 99% rename from frontend/rust-lib/flowy-sync/src/ws_manager.rs rename to frontend/rust-lib/flowy-revision/src/ws_manager.rs index 1a5891dbbb..42ad39c617 100644 --- a/frontend/rust-lib/flowy-sync/src/ws_manager.rs +++ b/frontend/rust-lib/flowy-revision/src/ws_manager.rs @@ -2,11 +2,11 @@ use crate::ConflictRevisionSink; use async_stream::stream; use bytes::Bytes; -use flowy_collaboration::entities::{ +use flowy_error::{FlowyError, FlowyResult}; +use flowy_sync::entities::{ revision::{RevId, Revision, RevisionRange}, ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSData, ServerRevisionWSDataType}, }; -use flowy_error::{FlowyError, FlowyResult}; use futures_util::{future::BoxFuture, stream::StreamExt}; use lib_infra::future::{BoxResultFuture, FutureResult}; use lib_ws::WSConnectState; diff --git a/frontend/rust-lib/flowy-sdk/Cargo.toml b/frontend/rust-lib/flowy-sdk/Cargo.toml index 75ab8a3b5c..9ac3bef2f6 100644 --- a/frontend/rust-lib/flowy-sdk/Cargo.toml +++ b/frontend/rust-lib/flowy-sdk/Cargo.toml @@ -14,8 +14,8 @@ flowy-folder = { path = "../flowy-folder", default-features = false } flowy-grid = { path = "../flowy-grid", default-features = false } flowy-grid-data-model = { path = "../../../shared-lib/flowy-grid-data-model" } flowy-database = { path = "../flowy-database" } -flowy-block = { path = "../flowy-block", default-features = false } -flowy-sync = { path = "../flowy-sync" } +flowy-text-block = { path = "../flowy-text-block", default-features = false } +flowy-revision = { path = "../flowy-revision" } tracing = { version = "0.1" } log = "0.4.14" @@ -25,7 +25,7 @@ bytes = "1.0" tokio = { version = "1", features = ["rt"] } parking_lot = "0.11" -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" } +flowy-sync = { path = "../../../shared-lib/flowy-sync" } lib-ws = { path = "../../../shared-lib/lib-ws" } lib-infra = { path = "../../../shared-lib/lib-infra" } @@ -38,6 +38,6 @@ tokio = { version = "1", features = ["full"]} futures-util = "0.3.15" [features] -http_server = ["flowy-user/http_server", "flowy-folder/http_server", "flowy-block/http_server"] +http_server = ["flowy-user/http_server", "flowy-folder/http_server", "flowy-text-block/http_server"] use_bunyan = ["lib-log/use_bunyan"] -dart = ["flowy-user/dart", "flowy-net/dart", "flowy-folder/dart", "flowy-collaboration/dart", "flowy-grid/dart", "flowy-block/dart"] +dart = ["flowy-user/dart", "flowy-net/dart", "flowy-folder/dart", "flowy-sync/dart", "flowy-grid/dart", "flowy-text-block/dart"] diff --git a/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs b/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs index 6ed3df3207..24af171a92 100644 --- a/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs +++ b/frontend/rust-lib/flowy-sdk/src/deps_resolve/folder_deps.rs @@ -1,9 +1,9 @@ use bytes::Bytes; -use flowy_block::TextBlockManager; -use flowy_collaboration::client_document::default::initial_quill_delta_string; -use flowy_collaboration::entities::revision::{RepeatedRevision, Revision}; -use flowy_collaboration::entities::ws_data::ClientRevisionWSData; use flowy_database::ConnectionPool; +use flowy_sync::client_document::default::initial_quill_delta_string; +use flowy_sync::entities::revision::{RepeatedRevision, Revision}; +use flowy_sync::entities::ws_data::ClientRevisionWSData; +use flowy_text_block::TextBlockManager; use flowy_folder::manager::{ViewDataProcessor, ViewDataProcessorMap}; use flowy_folder::prelude::ViewDataType; @@ -19,7 +19,7 @@ use flowy_net::ClientServerConfiguration; use flowy_net::{ http_server::folder::FolderHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect, }; -use flowy_sync::{RevisionWebSocket, WSStateReceiver}; +use flowy_revision::{RevisionWebSocket, WSStateReceiver}; use flowy_user::services::UserSession; use futures_core::future::BoxFuture; use lib_infra::future::{BoxResultFuture, FutureResult}; diff --git a/frontend/rust-lib/flowy-sdk/src/deps_resolve/grid_deps.rs b/frontend/rust-lib/flowy-sdk/src/deps_resolve/grid_deps.rs index 64ad6e9dd4..514c320511 100644 --- a/frontend/rust-lib/flowy-sdk/src/deps_resolve/grid_deps.rs +++ b/frontend/rust-lib/flowy-sdk/src/deps_resolve/grid_deps.rs @@ -1,10 +1,10 @@ use crate::FlowyError; use bytes::Bytes; -use flowy_collaboration::entities::ws_data::ClientRevisionWSData; use flowy_database::ConnectionPool; use flowy_grid::manager::{GridManager, GridUser}; use flowy_net::ws::connection::FlowyWebSocketConnect; -use flowy_sync::{RevisionWebSocket, WSStateReceiver}; +use flowy_revision::{RevisionWebSocket, WSStateReceiver}; +use flowy_sync::entities::ws_data::ClientRevisionWSData; use flowy_user::services::UserSession; use futures_core::future::BoxFuture; use lib_infra::future::BoxResultFuture; diff --git a/frontend/rust-lib/flowy-sdk/src/deps_resolve/text_block_deps.rs b/frontend/rust-lib/flowy-sdk/src/deps_resolve/text_block_deps.rs index 5482bbe546..7b80e637ab 100644 --- a/frontend/rust-lib/flowy-sdk/src/deps_resolve/text_block_deps.rs +++ b/frontend/rust-lib/flowy-sdk/src/deps_resolve/text_block_deps.rs @@ -1,15 +1,15 @@ use bytes::Bytes; -use flowy_block::{ - errors::{internal_error, FlowyError}, - BlockCloudService, TextBlockManager, TextBlockUser, -}; -use flowy_collaboration::entities::ws_data::ClientRevisionWSData; use flowy_database::ConnectionPool; use flowy_net::ClientServerConfiguration; use flowy_net::{ http_server::document::BlockHttpCloudService, local_server::LocalServer, ws::connection::FlowyWebSocketConnect, }; -use flowy_sync::{RevisionWebSocket, WSStateReceiver}; +use flowy_revision::{RevisionWebSocket, WSStateReceiver}; +use flowy_sync::entities::ws_data::ClientRevisionWSData; +use flowy_text_block::{ + errors::{internal_error, FlowyError}, + BlockCloudService, TextBlockManager, TextBlockUser, +}; use flowy_user::services::UserSession; use futures_core::future::BoxFuture; use lib_infra::future::BoxResultFuture; diff --git a/frontend/rust-lib/flowy-sdk/src/lib.rs b/frontend/rust-lib/flowy-sdk/src/lib.rs index 7acf14952e..8ade107e00 100644 --- a/frontend/rust-lib/flowy-sdk/src/lib.rs +++ b/frontend/rust-lib/flowy-sdk/src/lib.rs @@ -3,7 +3,6 @@ pub mod module; pub use flowy_net::get_client_server_configuration; use crate::deps_resolve::*; -use flowy_block::TextBlockManager; use flowy_folder::{errors::FlowyError, manager::FolderManager}; use flowy_grid::manager::GridManager; use flowy_net::ClientServerConfiguration; @@ -12,6 +11,7 @@ use flowy_net::{ local_server::LocalServer, ws::connection::{listen_on_websocket, FlowyWebSocketConnect}, }; +use flowy_text_block::TextBlockManager; use flowy_user::services::{notifier::UserStatus, UserSession, UserSessionConfig}; use lib_dispatch::prelude::*; use lib_dispatch::util::tokio_default_runtime; diff --git a/frontend/rust-lib/flowy-sdk/src/module.rs b/frontend/rust-lib/flowy-sdk/src/module.rs index 0a3fb1f87a..cbb1673a17 100644 --- a/frontend/rust-lib/flowy-sdk/src/module.rs +++ b/frontend/rust-lib/flowy-sdk/src/module.rs @@ -1,7 +1,7 @@ -use flowy_block::TextBlockManager; use flowy_folder::manager::FolderManager; use flowy_grid::manager::GridManager; use flowy_net::ws::connection::FlowyWebSocketConnect; +use flowy_text_block::TextBlockManager; use flowy_user::services::UserSession; use lib_dispatch::prelude::Module; use std::sync::Arc; @@ -44,5 +44,5 @@ fn mk_grid_module(grid_manager: Arc) -> Module { } fn mk_text_block_module(text_block_manager: Arc) -> Module { - flowy_block::event_map::create(text_block_manager) + flowy_text_block::event_map::create(text_block_manager) } diff --git a/frontend/rust-lib/flowy-test/Cargo.toml b/frontend/rust-lib/flowy-test/Cargo.toml index 0a04c1d5f6..4499a34828 100644 --- a/frontend/rust-lib/flowy-test/Cargo.toml +++ b/frontend/rust-lib/flowy-test/Cargo.toml @@ -12,7 +12,7 @@ flowy-net = { path = "../flowy-net"} flowy-folder = { path = "../flowy-folder", default-features = false} lib-dispatch = { path = "../lib-dispatch" } -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" } +flowy-sync = { path = "../../../shared-lib/flowy-sync" } lib-ot = { path = "../../../shared-lib/lib-ot" } lib-infra = { path = "../../../shared-lib/lib-infra" } diff --git a/frontend/rust-lib/flowy-block/Cargo.toml b/frontend/rust-lib/flowy-text-block/Cargo.toml similarity index 82% rename from frontend/rust-lib/flowy-block/Cargo.toml rename to frontend/rust-lib/flowy-text-block/Cargo.toml index b4ae85f597..84c0cf9605 100644 --- a/frontend/rust-lib/flowy-block/Cargo.toml +++ b/frontend/rust-lib/flowy-text-block/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "flowy-block" +name = "flowy-text-block" version = "0.1.0" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration"} +flowy-sync = { path = "../../../shared-lib/flowy-sync"} flowy-derive = { path = "../../../shared-lib/flowy-derive" } lib-ot = { path = "../../../shared-lib/lib-ot" } lib-ws = { path = "../../../shared-lib/lib-ws" } @@ -15,7 +15,7 @@ lib-infra = { path = "../../../shared-lib/lib-infra" } lib-dispatch = { path = "../lib-dispatch" } flowy-database = { path = "../flowy-database" } -flowy-sync = { path = "../flowy-sync" } +flowy-revision = { path = "../flowy-revision" } flowy-error = { path = "../flowy-error", features = ["collaboration", "ot", "http_server", "serde", "db"] } dart-notify = { path = "../dart-notify" } @@ -40,7 +40,7 @@ futures = "0.3.15" [dev-dependencies] flowy-test = { path = "../flowy-test" } -flowy-block = { path = "../flowy-block", features = ["flowy_unit_test"]} +flowy-text-block = { path = "../flowy-text-block", features = ["flowy_unit_test"]} derive_more = {version = "0.99", features = ["display"]} color-eyre = { version = "0.5", default-features = false } @@ -52,5 +52,5 @@ lib-infra = { path = "../../../shared-lib/lib-infra", features = ["protobuf_file [features] http_server = [] -flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"] +flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-revision/flowy_unit_test"] dart = ["lib-infra/dart"] \ No newline at end of file diff --git a/frontend/rust-lib/flowy-block/Flowy.toml b/frontend/rust-lib/flowy-text-block/Flowy.toml similarity index 100% rename from frontend/rust-lib/flowy-block/Flowy.toml rename to frontend/rust-lib/flowy-text-block/Flowy.toml diff --git a/frontend/rust-lib/flowy-block/build.rs b/frontend/rust-lib/flowy-text-block/build.rs similarity index 100% rename from frontend/rust-lib/flowy-block/build.rs rename to frontend/rust-lib/flowy-text-block/build.rs diff --git a/frontend/rust-lib/flowy-block/src/editor.rs b/frontend/rust-lib/flowy-text-block/src/editor.rs similarity index 98% rename from frontend/rust-lib/flowy-block/src/editor.rs rename to frontend/rust-lib/flowy-text-block/src/editor.rs index 8622c60730..215c3d079d 100644 --- a/frontend/rust-lib/flowy-block/src/editor.rs +++ b/frontend/rust-lib/flowy-text-block/src/editor.rs @@ -5,16 +5,16 @@ use crate::{ TextBlockUser, }; use bytes::Bytes; -use flowy_collaboration::entities::ws_data::ServerRevisionWSData; -use flowy_collaboration::{ +use flowy_error::{internal_error, FlowyResult}; +use flowy_revision::{ + RevisionCloudService, RevisionManager, RevisionObjectBuilder, RevisionWebSocket, RevisionWebSocketManager, +}; +use flowy_sync::entities::ws_data::ServerRevisionWSData; +use flowy_sync::{ entities::{revision::Revision, text_block_info::TextBlockInfo}, errors::CollaborateResult, util::make_delta_from_revisions, }; -use flowy_error::{internal_error, FlowyResult}; -use flowy_sync::{ - RevisionCloudService, RevisionManager, RevisionObjectBuilder, RevisionWebSocket, RevisionWebSocketManager, -}; use lib_ot::{ core::{Interval, Operation}, rich_text::{RichTextAttribute, RichTextDelta}, diff --git a/frontend/rust-lib/flowy-block/src/entities.rs b/frontend/rust-lib/flowy-text-block/src/entities.rs similarity index 100% rename from frontend/rust-lib/flowy-block/src/entities.rs rename to frontend/rust-lib/flowy-text-block/src/entities.rs diff --git a/frontend/rust-lib/flowy-block/src/event_handler.rs b/frontend/rust-lib/flowy-text-block/src/event_handler.rs similarity index 94% rename from frontend/rust-lib/flowy-block/src/event_handler.rs rename to frontend/rust-lib/flowy-text-block/src/event_handler.rs index 1457fc2992..4e8b48ae05 100644 --- a/frontend/rust-lib/flowy-block/src/event_handler.rs +++ b/frontend/rust-lib/flowy-text-block/src/event_handler.rs @@ -1,7 +1,7 @@ use crate::entities::{ExportData, ExportParams, ExportPayload}; use crate::TextBlockManager; -use flowy_collaboration::entities::text_block_info::{TextBlockDelta, TextBlockId}; use flowy_error::FlowyError; +use flowy_sync::entities::text_block_info::{TextBlockDelta, TextBlockId}; use lib_dispatch::prelude::{data_result, AppData, Data, DataResult}; use std::convert::TryInto; use std::sync::Arc; diff --git a/frontend/rust-lib/flowy-block/src/event_map.rs b/frontend/rust-lib/flowy-text-block/src/event_map.rs similarity index 86% rename from frontend/rust-lib/flowy-block/src/event_map.rs rename to frontend/rust-lib/flowy-text-block/src/event_map.rs index 8342102bf5..a355af8bc3 100644 --- a/frontend/rust-lib/flowy-block/src/event_map.rs +++ b/frontend/rust-lib/flowy-text-block/src/event_map.rs @@ -19,10 +19,10 @@ pub fn create(block_manager: Arc) -> Module { #[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)] #[event_err = "FlowyError"] pub enum BlockEvent { - #[event(input = "BlockId", output = "BlockDelta")] + #[event(input = "TextBlockId", output = "TextBlockDelta")] GetBlockData = 0, - #[event(input = "BlockDelta", output = "BlockDelta")] + #[event(input = "TextBlockDelta", output = "TextBlockDelta")] ApplyDelta = 1, #[event(input = "ExportPayload", output = "ExportData")] diff --git a/frontend/rust-lib/flowy-block/src/lib.rs b/frontend/rust-lib/flowy-text-block/src/lib.rs similarity index 84% rename from frontend/rust-lib/flowy-block/src/lib.rs rename to frontend/rust-lib/flowy-text-block/src/lib.rs index b3c9de44dc..991fed8f38 100644 --- a/frontend/rust-lib/flowy-block/src/lib.rs +++ b/frontend/rust-lib/flowy-text-block/src/lib.rs @@ -15,9 +15,7 @@ pub mod errors { pub const TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS: u64 = 1000; use crate::errors::FlowyError; -use flowy_collaboration::entities::text_block_info::{ - CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo, -}; +use flowy_sync::entities::text_block_info::{CreateTextBlockParams, ResetTextBlockParams, TextBlockId, TextBlockInfo}; use lib_infra::future::FutureResult; pub trait BlockCloudService: Send + Sync { diff --git a/frontend/rust-lib/flowy-block/src/manager.rs b/frontend/rust-lib/flowy-text-block/src/manager.rs similarity index 97% rename from frontend/rust-lib/flowy-block/src/manager.rs rename to frontend/rust-lib/flowy-text-block/src/manager.rs index a08dc9b7b1..a79f5cb3f4 100644 --- a/frontend/rust-lib/flowy-block/src/manager.rs +++ b/frontend/rust-lib/flowy-text-block/src/manager.rs @@ -1,15 +1,15 @@ use crate::{editor::ClientTextBlockEditor, errors::FlowyError, BlockCloudService}; use bytes::Bytes; use dashmap::DashMap; -use flowy_collaboration::entities::{ +use flowy_database::ConnectionPool; +use flowy_error::FlowyResult; +use flowy_revision::disk::SQLiteTextBlockRevisionPersistence; +use flowy_revision::{RevisionCloudService, RevisionManager, RevisionPersistence, RevisionWebSocket}; +use flowy_sync::entities::{ revision::{md5, RepeatedRevision, Revision}, text_block_info::{TextBlockDelta, TextBlockId}, ws_data::ServerRevisionWSData, }; -use flowy_database::ConnectionPool; -use flowy_error::FlowyResult; -use flowy_sync::disk::SQLiteTextBlockRevisionPersistence; -use flowy_sync::{RevisionCloudService, RevisionManager, RevisionPersistence, RevisionWebSocket}; use lib_infra::future::FutureResult; use std::{convert::TryInto, sync::Arc}; diff --git a/frontend/rust-lib/flowy-block/src/protobuf/mod.rs b/frontend/rust-lib/flowy-text-block/src/protobuf/mod.rs similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/mod.rs rename to frontend/rust-lib/flowy-text-block/src/protobuf/mod.rs diff --git a/frontend/rust-lib/flowy-block/src/protobuf/model/entities.rs b/frontend/rust-lib/flowy-text-block/src/protobuf/model/entities.rs similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/model/entities.rs rename to frontend/rust-lib/flowy-text-block/src/protobuf/model/entities.rs diff --git a/frontend/rust-lib/flowy-block/src/protobuf/model/event_map.rs b/frontend/rust-lib/flowy-text-block/src/protobuf/model/event_map.rs similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/model/event_map.rs rename to frontend/rust-lib/flowy-text-block/src/protobuf/model/event_map.rs diff --git a/frontend/rust-lib/flowy-block/src/protobuf/model/mod.rs b/frontend/rust-lib/flowy-text-block/src/protobuf/model/mod.rs similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/model/mod.rs rename to frontend/rust-lib/flowy-text-block/src/protobuf/model/mod.rs diff --git a/frontend/rust-lib/flowy-block/src/protobuf/proto/entities.proto b/frontend/rust-lib/flowy-text-block/src/protobuf/proto/entities.proto similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/proto/entities.proto rename to frontend/rust-lib/flowy-text-block/src/protobuf/proto/entities.proto diff --git a/frontend/rust-lib/flowy-block/src/protobuf/proto/event_map.proto b/frontend/rust-lib/flowy-text-block/src/protobuf/proto/event_map.proto similarity index 100% rename from frontend/rust-lib/flowy-block/src/protobuf/proto/event_map.proto rename to frontend/rust-lib/flowy-text-block/src/protobuf/proto/event_map.proto diff --git a/frontend/rust-lib/flowy-block/src/queue.rs b/frontend/rust-lib/flowy-text-block/src/queue.rs similarity index 98% rename from frontend/rust-lib/flowy-block/src/queue.rs rename to frontend/rust-lib/flowy-text-block/src/queue.rs index f7932e0850..7c11afd0ff 100644 --- a/frontend/rust-lib/flowy-block/src/queue.rs +++ b/frontend/rust-lib/flowy-text-block/src/queue.rs @@ -2,14 +2,14 @@ use crate::web_socket::EditorCommandReceiver; use crate::TextBlockUser; use async_stream::stream; use bytes::Bytes; -use flowy_collaboration::util::make_delta_from_revisions; -use flowy_collaboration::{ +use flowy_error::{FlowyError, FlowyResult}; +use flowy_revision::{DeltaMD5, RevisionCompactor, RevisionManager, RichTextTransformDeltas, TransformDeltas}; +use flowy_sync::util::make_delta_from_revisions; +use flowy_sync::{ client_document::{history::UndoResult, ClientDocument}, entities::revision::{RevId, Revision}, errors::CollaborateError, }; -use flowy_error::{FlowyError, FlowyResult}; -use flowy_sync::{DeltaMD5, RevisionCompactor, RevisionManager, RichTextTransformDeltas, TransformDeltas}; use futures::stream::StreamExt; use lib_ot::{ core::{Interval, OperationTransformable}, diff --git a/frontend/rust-lib/flowy-block/src/web_socket.rs b/frontend/rust-lib/flowy-text-block/src/web_socket.rs similarity index 97% rename from frontend/rust-lib/flowy-block/src/web_socket.rs rename to frontend/rust-lib/flowy-text-block/src/web_socket.rs index 7450e4a6ae..8854acfd9f 100644 --- a/frontend/rust-lib/flowy-block/src/web_socket.rs +++ b/frontend/rust-lib/flowy-text-block/src/web_socket.rs @@ -1,14 +1,14 @@ use crate::{queue::EditorCommand, TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS}; use bytes::Bytes; -use flowy_collaboration::{ +use flowy_error::{internal_error, FlowyError}; +use flowy_revision::*; +use flowy_sync::{ entities::{ revision::RevisionRange, ws_data::{ClientRevisionWSData, NewDocumentUser, ServerRevisionWSDataType}, }, errors::CollaborateResult, }; -use flowy_error::{internal_error, FlowyError}; -use flowy_sync::*; use lib_infra::future::{BoxResultFuture, FutureResult}; use lib_ot::rich_text::RichTextAttributes; use lib_ot::rich_text::RichTextDelta; @@ -129,7 +129,7 @@ impl ConflictResolver for TextBlockConflictResolver { fn transform_delta( &self, delta: RichTextDelta, - ) -> BoxResultFuture { + ) -> BoxResultFuture { let tx = self.edit_cmd_tx.clone(); Box::pin(async move { let (ret, rx) = oneshot::channel::>(); diff --git a/frontend/rust-lib/flowy-block/tests/document/mod.rs b/frontend/rust-lib/flowy-text-block/tests/document/mod.rs similarity index 100% rename from frontend/rust-lib/flowy-block/tests/document/mod.rs rename to frontend/rust-lib/flowy-text-block/tests/document/mod.rs diff --git a/frontend/rust-lib/flowy-block/tests/document/script.rs b/frontend/rust-lib/flowy-text-block/tests/document/script.rs similarity index 95% rename from frontend/rust-lib/flowy-block/tests/document/script.rs rename to frontend/rust-lib/flowy-text-block/tests/document/script.rs index 2ae6e14fc9..5511896fc2 100644 --- a/frontend/rust-lib/flowy-block/tests/document/script.rs +++ b/frontend/rust-lib/flowy-text-block/tests/document/script.rs @@ -1,7 +1,7 @@ -use flowy_block::editor::ClientTextBlockEditor; -use flowy_block::TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS; -use flowy_sync::disk::RevisionState; +use flowy_revision::disk::RevisionState; use flowy_test::{helper::ViewTest, FlowySDKTest}; +use flowy_text_block::editor::ClientTextBlockEditor; +use flowy_text_block::TEXT_BLOCK_SYNC_INTERVAL_IN_MILLIS; use lib_ot::{core::Interval, rich_text::RichTextDelta}; use std::sync::Arc; use tokio::time::{sleep, Duration}; diff --git a/frontend/rust-lib/flowy-block/tests/document/text_block_test.rs b/frontend/rust-lib/flowy-text-block/tests/document/text_block_test.rs similarity index 98% rename from frontend/rust-lib/flowy-block/tests/document/text_block_test.rs rename to frontend/rust-lib/flowy-text-block/tests/document/text_block_test.rs index 93fb957cdb..30a926c3f9 100644 --- a/frontend/rust-lib/flowy-block/tests/document/text_block_test.rs +++ b/frontend/rust-lib/flowy-text-block/tests/document/text_block_test.rs @@ -1,5 +1,5 @@ use crate::document::script::{EditorScript::*, *}; -use flowy_sync::disk::RevisionState; +use flowy_revision::disk::RevisionState; use lib_ot::core::{count_utf16_code_units, Interval}; #[tokio::test] diff --git a/frontend/rust-lib/flowy-block/tests/editor/attribute_test.rs b/frontend/rust-lib/flowy-text-block/tests/editor/attribute_test.rs similarity index 99% rename from frontend/rust-lib/flowy-block/tests/editor/attribute_test.rs rename to frontend/rust-lib/flowy-text-block/tests/editor/attribute_test.rs index 264cee831b..037b36970b 100644 --- a/frontend/rust-lib/flowy-block/tests/editor/attribute_test.rs +++ b/frontend/rust-lib/flowy-text-block/tests/editor/attribute_test.rs @@ -1,6 +1,6 @@ #![cfg_attr(rustfmt, rustfmt::skip)] use crate::editor::{TestBuilder, TestOp::*}; -use flowy_collaboration::client_document::{NewlineDoc, PlainDoc}; +use flowy_sync::client_document::{NewlineDoc, PlainDoc}; use lib_ot::core::{Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr}; use unicode_segmentation::UnicodeSegmentation; use lib_ot::rich_text::RichTextDelta; diff --git a/frontend/rust-lib/flowy-block/tests/editor/mod.rs b/frontend/rust-lib/flowy-text-block/tests/editor/mod.rs similarity index 99% rename from frontend/rust-lib/flowy-block/tests/editor/mod.rs rename to frontend/rust-lib/flowy-text-block/tests/editor/mod.rs index 395629587e..d1c6f94380 100644 --- a/frontend/rust-lib/flowy-block/tests/editor/mod.rs +++ b/frontend/rust-lib/flowy-text-block/tests/editor/mod.rs @@ -4,7 +4,7 @@ mod op_test; mod serde_test; mod undo_redo_test; -use flowy_collaboration::client_document::{ClientDocument, InitialDocumentText}; +use flowy_sync::client_document::{ClientDocument, InitialDocumentText}; use lib_ot::{ core::*, rich_text::{RichTextAttribute, RichTextAttributes, RichTextDelta}, diff --git a/frontend/rust-lib/flowy-block/tests/editor/op_test.rs b/frontend/rust-lib/flowy-text-block/tests/editor/op_test.rs similarity index 99% rename from frontend/rust-lib/flowy-block/tests/editor/op_test.rs rename to frontend/rust-lib/flowy-text-block/tests/editor/op_test.rs index 7745d4b098..3f174fa3bc 100644 --- a/frontend/rust-lib/flowy-block/tests/editor/op_test.rs +++ b/frontend/rust-lib/flowy-text-block/tests/editor/op_test.rs @@ -1,6 +1,6 @@ #![allow(clippy::all)] use crate::editor::{Rng, TestBuilder, TestOp::*}; -use flowy_collaboration::client_document::{NewlineDoc, PlainDoc}; +use flowy_sync::client_document::{NewlineDoc, PlainDoc}; use lib_ot::{ core::*, rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributes, RichTextDelta}, diff --git a/frontend/rust-lib/flowy-block/tests/editor/serde_test.rs b/frontend/rust-lib/flowy-text-block/tests/editor/serde_test.rs similarity index 98% rename from frontend/rust-lib/flowy-block/tests/editor/serde_test.rs rename to frontend/rust-lib/flowy-text-block/tests/editor/serde_test.rs index 54c7f92152..87d425901b 100644 --- a/frontend/rust-lib/flowy-block/tests/editor/serde_test.rs +++ b/frontend/rust-lib/flowy-text-block/tests/editor/serde_test.rs @@ -1,4 +1,4 @@ -use flowy_collaboration::client_document::{ClientDocument, PlainDoc}; +use flowy_sync::client_document::{ClientDocument, PlainDoc}; use lib_ot::rich_text::RichTextOperation; use lib_ot::{ core::*, diff --git a/frontend/rust-lib/flowy-block/tests/editor/undo_redo_test.rs b/frontend/rust-lib/flowy-text-block/tests/editor/undo_redo_test.rs similarity index 99% rename from frontend/rust-lib/flowy-block/tests/editor/undo_redo_test.rs rename to frontend/rust-lib/flowy-text-block/tests/editor/undo_redo_test.rs index 1b08b5ca2d..e6ea9200ab 100644 --- a/frontend/rust-lib/flowy-block/tests/editor/undo_redo_test.rs +++ b/frontend/rust-lib/flowy-text-block/tests/editor/undo_redo_test.rs @@ -1,5 +1,5 @@ use crate::editor::{TestBuilder, TestOp::*}; -use flowy_collaboration::client_document::{NewlineDoc, PlainDoc, RECORD_THRESHOLD}; +use flowy_sync::client_document::{NewlineDoc, PlainDoc, RECORD_THRESHOLD}; use lib_ot::core::{Interval, NEW_LINE, WHITESPACE}; #[test] diff --git a/frontend/rust-lib/flowy-block/tests/main.rs b/frontend/rust-lib/flowy-text-block/tests/main.rs similarity index 100% rename from frontend/rust-lib/flowy-block/tests/main.rs rename to frontend/rust-lib/flowy-text-block/tests/main.rs diff --git a/shared-lib/Cargo.lock b/shared-lib/Cargo.lock index a4cde5ddf2..db2a3d9ad7 100644 --- a/shared-lib/Cargo.lock +++ b/shared-lib/Cargo.lock @@ -402,34 +402,6 @@ dependencies = [ "syn", ] -[[package]] -name = "flowy-collaboration" -version = "0.1.0" -dependencies = [ - "async-stream", - "bytes", - "chrono", - "dashmap", - "dissimilar", - "flowy-derive", - "flowy-folder-data-model", - "flowy-grid-data-model", - "futures", - "lib-infra", - "lib-ot", - "log", - "md5", - "parking_lot", - "protobuf", - "serde", - "serde_json", - "strum", - "strum_macros", - "tokio", - "tracing", - "url", -] - [[package]] name = "flowy-derive" version = "0.1.0" @@ -495,6 +467,34 @@ dependencies = [ "uuid", ] +[[package]] +name = "flowy-sync" +version = "0.1.0" +dependencies = [ + "async-stream", + "bytes", + "chrono", + "dashmap", + "dissimilar", + "flowy-derive", + "flowy-folder-data-model", + "flowy-grid-data-model", + "futures", + "lib-infra", + "lib-ot", + "log", + "md5", + "parking_lot", + "protobuf", + "serde", + "serde_json", + "strum", + "strum_macros", + "tokio", + "tracing", + "url", +] + [[package]] name = "flowy-user-data-model" version = "0.1.0" diff --git a/shared-lib/Cargo.toml b/shared-lib/Cargo.toml index 3dca4e2f6d..370c4d7f31 100644 --- a/shared-lib/Cargo.toml +++ b/shared-lib/Cargo.toml @@ -2,7 +2,7 @@ members = [ "flowy-user-data-model", "flowy-folder-data-model", - "flowy-collaboration", + "flowy-sync", "lib-ot", "lib-ws", "lib-infra", diff --git a/shared-lib/flowy-collaboration/Cargo.toml b/shared-lib/flowy-sync/Cargo.toml similarity index 94% rename from shared-lib/flowy-collaboration/Cargo.toml rename to shared-lib/flowy-sync/Cargo.toml index 4e36f0832b..6c66a21999 100644 --- a/shared-lib/flowy-collaboration/Cargo.toml +++ b/shared-lib/flowy-sync/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "flowy-collaboration" +name = "flowy-sync" version = "0.1.0" edition = "2018" diff --git a/shared-lib/flowy-collaboration/Flowy.toml b/shared-lib/flowy-sync/Flowy.toml similarity index 100% rename from shared-lib/flowy-collaboration/Flowy.toml rename to shared-lib/flowy-sync/Flowy.toml diff --git a/shared-lib/flowy-collaboration/build.rs b/shared-lib/flowy-sync/build.rs similarity index 100% rename from shared-lib/flowy-collaboration/build.rs rename to shared-lib/flowy-sync/build.rs diff --git a/shared-lib/flowy-collaboration/src/READ_ME.json b/shared-lib/flowy-sync/src/READ_ME.json similarity index 100% rename from shared-lib/flowy-collaboration/src/READ_ME.json rename to shared-lib/flowy-sync/src/READ_ME.json diff --git a/shared-lib/flowy-collaboration/src/client_document/data.rs b/shared-lib/flowy-sync/src/client_document/data.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/data.rs rename to shared-lib/flowy-sync/src/client_document/data.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/default/READ_ME.json b/shared-lib/flowy-sync/src/client_document/default/READ_ME.json similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/default/READ_ME.json rename to shared-lib/flowy-sync/src/client_document/default/READ_ME.json diff --git a/shared-lib/flowy-collaboration/src/client_document/default/mod.rs b/shared-lib/flowy-sync/src/client_document/default/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/default/mod.rs rename to shared-lib/flowy-sync/src/client_document/default/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/document_pad.rs b/shared-lib/flowy-sync/src/client_document/document_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/document_pad.rs rename to shared-lib/flowy-sync/src/client_document/document_pad.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/delete/default_delete.rs b/shared-lib/flowy-sync/src/client_document/extensions/delete/default_delete.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/delete/default_delete.rs rename to shared-lib/flowy-sync/src/client_document/extensions/delete/default_delete.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/delete/mod.rs b/shared-lib/flowy-sync/src/client_document/extensions/delete/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/delete/mod.rs rename to shared-lib/flowy-sync/src/client_document/extensions/delete/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/delete/preserve_line_format_merge.rs b/shared-lib/flowy-sync/src/client_document/extensions/delete/preserve_line_format_merge.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/delete/preserve_line_format_merge.rs rename to shared-lib/flowy-sync/src/client_document/extensions/delete/preserve_line_format_merge.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/format/format_at_position.rs b/shared-lib/flowy-sync/src/client_document/extensions/format/format_at_position.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/format/format_at_position.rs rename to shared-lib/flowy-sync/src/client_document/extensions/format/format_at_position.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/format/mod.rs b/shared-lib/flowy-sync/src/client_document/extensions/format/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/format/mod.rs rename to shared-lib/flowy-sync/src/client_document/extensions/format/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/format/resolve_block_format.rs b/shared-lib/flowy-sync/src/client_document/extensions/format/resolve_block_format.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/format/resolve_block_format.rs rename to shared-lib/flowy-sync/src/client_document/extensions/format/resolve_block_format.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/format/resolve_inline_format.rs b/shared-lib/flowy-sync/src/client_document/extensions/format/resolve_inline_format.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/format/resolve_inline_format.rs rename to shared-lib/flowy-sync/src/client_document/extensions/format/resolve_inline_format.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/helper.rs b/shared-lib/flowy-sync/src/client_document/extensions/helper.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/helper.rs rename to shared-lib/flowy-sync/src/client_document/extensions/helper.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/auto_exit_block.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/auto_exit_block.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/auto_exit_block.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/auto_exit_block.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/auto_format.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/auto_format.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/auto_format.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/auto_format.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/default_insert.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/default_insert.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/default_insert.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/default_insert.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/mod.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/mod.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/preserve_block_format.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/preserve_block_format.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/preserve_block_format.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/preserve_block_format.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/preserve_inline_format.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/preserve_inline_format.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/preserve_inline_format.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/preserve_inline_format.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/insert/reset_format_on_new_line.rs b/shared-lib/flowy-sync/src/client_document/extensions/insert/reset_format_on_new_line.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/insert/reset_format_on_new_line.rs rename to shared-lib/flowy-sync/src/client_document/extensions/insert/reset_format_on_new_line.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/extensions/mod.rs b/shared-lib/flowy-sync/src/client_document/extensions/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/extensions/mod.rs rename to shared-lib/flowy-sync/src/client_document/extensions/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/history.rs b/shared-lib/flowy-sync/src/client_document/history.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/history.rs rename to shared-lib/flowy-sync/src/client_document/history.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/mod.rs b/shared-lib/flowy-sync/src/client_document/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/mod.rs rename to shared-lib/flowy-sync/src/client_document/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_document/view.rs b/shared-lib/flowy-sync/src/client_document/view.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_document/view.rs rename to shared-lib/flowy-sync/src/client_document/view.rs diff --git a/shared-lib/flowy-collaboration/src/client_folder/builder.rs b/shared-lib/flowy-sync/src/client_folder/builder.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_folder/builder.rs rename to shared-lib/flowy-sync/src/client_folder/builder.rs diff --git a/shared-lib/flowy-collaboration/src/client_folder/folder_pad.rs b/shared-lib/flowy-sync/src/client_folder/folder_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_folder/folder_pad.rs rename to shared-lib/flowy-sync/src/client_folder/folder_pad.rs diff --git a/shared-lib/flowy-collaboration/src/client_folder/mod.rs b/shared-lib/flowy-sync/src/client_folder/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_folder/mod.rs rename to shared-lib/flowy-sync/src/client_folder/mod.rs diff --git a/shared-lib/flowy-collaboration/src/client_grid/grid_block_meta_pad.rs b/shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_grid/grid_block_meta_pad.rs rename to shared-lib/flowy-sync/src/client_grid/grid_block_meta_pad.rs diff --git a/shared-lib/flowy-collaboration/src/client_grid/grid_builder.rs b/shared-lib/flowy-sync/src/client_grid/grid_builder.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_grid/grid_builder.rs rename to shared-lib/flowy-sync/src/client_grid/grid_builder.rs diff --git a/shared-lib/flowy-collaboration/src/client_grid/grid_meta_pad.rs b/shared-lib/flowy-sync/src/client_grid/grid_meta_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_grid/grid_meta_pad.rs rename to shared-lib/flowy-sync/src/client_grid/grid_meta_pad.rs diff --git a/shared-lib/flowy-collaboration/src/client_grid/mod.rs b/shared-lib/flowy-sync/src/client_grid/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/client_grid/mod.rs rename to shared-lib/flowy-sync/src/client_grid/mod.rs diff --git a/shared-lib/flowy-collaboration/src/entities/folder_info.rs b/shared-lib/flowy-sync/src/entities/folder_info.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/folder_info.rs rename to shared-lib/flowy-sync/src/entities/folder_info.rs diff --git a/shared-lib/flowy-collaboration/src/entities/mod.rs b/shared-lib/flowy-sync/src/entities/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/mod.rs rename to shared-lib/flowy-sync/src/entities/mod.rs diff --git a/shared-lib/flowy-collaboration/src/entities/parser/doc_id.rs b/shared-lib/flowy-sync/src/entities/parser/doc_id.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/parser/doc_id.rs rename to shared-lib/flowy-sync/src/entities/parser/doc_id.rs diff --git a/shared-lib/flowy-collaboration/src/entities/parser/mod.rs b/shared-lib/flowy-sync/src/entities/parser/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/parser/mod.rs rename to shared-lib/flowy-sync/src/entities/parser/mod.rs diff --git a/shared-lib/flowy-collaboration/src/entities/revision.rs b/shared-lib/flowy-sync/src/entities/revision.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/revision.rs rename to shared-lib/flowy-sync/src/entities/revision.rs diff --git a/shared-lib/flowy-collaboration/src/entities/text_block_info.rs b/shared-lib/flowy-sync/src/entities/text_block_info.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/text_block_info.rs rename to shared-lib/flowy-sync/src/entities/text_block_info.rs diff --git a/shared-lib/flowy-collaboration/src/entities/ws_data.rs b/shared-lib/flowy-sync/src/entities/ws_data.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/entities/ws_data.rs rename to shared-lib/flowy-sync/src/entities/ws_data.rs diff --git a/shared-lib/flowy-collaboration/src/errors.rs b/shared-lib/flowy-sync/src/errors.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/errors.rs rename to shared-lib/flowy-sync/src/errors.rs diff --git a/shared-lib/flowy-collaboration/src/lib.rs b/shared-lib/flowy-sync/src/lib.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/lib.rs rename to shared-lib/flowy-sync/src/lib.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/mod.rs b/shared-lib/flowy-sync/src/protobuf/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/mod.rs rename to shared-lib/flowy-sync/src/protobuf/mod.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/model/folder_info.rs b/shared-lib/flowy-sync/src/protobuf/model/folder_info.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/model/folder_info.rs rename to shared-lib/flowy-sync/src/protobuf/model/folder_info.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/model/mod.rs b/shared-lib/flowy-sync/src/protobuf/model/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/model/mod.rs rename to shared-lib/flowy-sync/src/protobuf/model/mod.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/model/revision.rs b/shared-lib/flowy-sync/src/protobuf/model/revision.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/model/revision.rs rename to shared-lib/flowy-sync/src/protobuf/model/revision.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/model/text_block_info.rs b/shared-lib/flowy-sync/src/protobuf/model/text_block_info.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/model/text_block_info.rs rename to shared-lib/flowy-sync/src/protobuf/model/text_block_info.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/model/ws_data.rs b/shared-lib/flowy-sync/src/protobuf/model/ws_data.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/model/ws_data.rs rename to shared-lib/flowy-sync/src/protobuf/model/ws_data.rs diff --git a/shared-lib/flowy-collaboration/src/protobuf/proto/folder_info.proto b/shared-lib/flowy-sync/src/protobuf/proto/folder_info.proto similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/proto/folder_info.proto rename to shared-lib/flowy-sync/src/protobuf/proto/folder_info.proto diff --git a/shared-lib/flowy-collaboration/src/protobuf/proto/revision.proto b/shared-lib/flowy-sync/src/protobuf/proto/revision.proto similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/proto/revision.proto rename to shared-lib/flowy-sync/src/protobuf/proto/revision.proto diff --git a/shared-lib/flowy-collaboration/src/protobuf/proto/text_block_info.proto b/shared-lib/flowy-sync/src/protobuf/proto/text_block_info.proto similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/proto/text_block_info.proto rename to shared-lib/flowy-sync/src/protobuf/proto/text_block_info.proto diff --git a/shared-lib/flowy-collaboration/src/protobuf/proto/ws_data.proto b/shared-lib/flowy-sync/src/protobuf/proto/ws_data.proto similarity index 100% rename from shared-lib/flowy-collaboration/src/protobuf/proto/ws_data.proto rename to shared-lib/flowy-sync/src/protobuf/proto/ws_data.proto diff --git a/shared-lib/flowy-collaboration/src/server_document/document_manager.rs b/shared-lib/flowy-sync/src/server_document/document_manager.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_document/document_manager.rs rename to shared-lib/flowy-sync/src/server_document/document_manager.rs diff --git a/shared-lib/flowy-collaboration/src/server_document/document_pad.rs b/shared-lib/flowy-sync/src/server_document/document_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_document/document_pad.rs rename to shared-lib/flowy-sync/src/server_document/document_pad.rs diff --git a/shared-lib/flowy-collaboration/src/server_document/mod.rs b/shared-lib/flowy-sync/src/server_document/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_document/mod.rs rename to shared-lib/flowy-sync/src/server_document/mod.rs diff --git a/shared-lib/flowy-collaboration/src/server_folder/folder_manager.rs b/shared-lib/flowy-sync/src/server_folder/folder_manager.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_folder/folder_manager.rs rename to shared-lib/flowy-sync/src/server_folder/folder_manager.rs diff --git a/shared-lib/flowy-collaboration/src/server_folder/folder_pad.rs b/shared-lib/flowy-sync/src/server_folder/folder_pad.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_folder/folder_pad.rs rename to shared-lib/flowy-sync/src/server_folder/folder_pad.rs diff --git a/shared-lib/flowy-collaboration/src/server_folder/mod.rs b/shared-lib/flowy-sync/src/server_folder/mod.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/server_folder/mod.rs rename to shared-lib/flowy-sync/src/server_folder/mod.rs diff --git a/shared-lib/flowy-collaboration/src/synchronizer.rs b/shared-lib/flowy-sync/src/synchronizer.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/synchronizer.rs rename to shared-lib/flowy-sync/src/synchronizer.rs diff --git a/shared-lib/flowy-collaboration/src/util.rs b/shared-lib/flowy-sync/src/util.rs similarity index 100% rename from shared-lib/flowy-collaboration/src/util.rs rename to shared-lib/flowy-sync/src/util.rs