mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: rename crates
This commit is contained in:
168
frontend/rust-lib/Cargo.lock
generated
168
frontend/rust-lib/Cargo.lock
generated
@ -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"
|
||||
|
@ -11,9 +11,9 @@ members = [
|
||||
"flowy-database",
|
||||
"flowy-folder",
|
||||
"dart-notify",
|
||||
"flowy-block",
|
||||
"flowy-text-block",
|
||||
"flowy-error",
|
||||
"flowy-sync",
|
||||
"flowy-revision",
|
||||
"flowy-grid",
|
||||
]
|
||||
|
||||
|
@ -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"]
|
||||
|
@ -1,9 +1,9 @@
|
||||
use crate::FlowyError;
|
||||
|
||||
use flowy_collaboration::errors::ErrorCode;
|
||||
use flowy_sync::errors::ErrorCode;
|
||||
|
||||
impl std::convert::From<flowy_collaboration::errors::CollaborateError> for FlowyError {
|
||||
fn from(error: flowy_collaboration::errors::CollaborateError) -> Self {
|
||||
impl std::convert::From<flowy_sync::errors::CollaborateError> 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),
|
||||
|
@ -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"]
|
@ -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};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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";
|
||||
|
@ -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::*};
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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]
|
||||
|
@ -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;
|
||||
|
@ -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"]
|
||||
flowy_unit_test = ["flowy-revision/flowy_unit_test"]
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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())
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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},
|
||||
|
@ -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,
|
||||
|
@ -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" }
|
@ -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 {
|
@ -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 {
|
@ -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 {
|
@ -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 {
|
@ -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};
|
||||
|
@ -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;
|
@ -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;
|
||||
|
@ -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;
|
@ -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;
|
@ -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"]
|
||||
|
@ -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};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<GridManager>) -> Module {
|
||||
}
|
||||
|
||||
fn mk_text_block_module(text_block_manager: Arc<TextBlockManager>) -> Module {
|
||||
flowy_block::event_map::create(text_block_manager)
|
||||
flowy_text_block::event_map::create(text_block_manager)
|
||||
}
|
||||
|
@ -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" }
|
||||
|
||||
|
@ -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"]
|
@ -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},
|
@ -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;
|
@ -19,10 +19,10 @@ pub fn create(block_manager: Arc<TextBlockManager>) -> 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")]
|
@ -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 {
|
@ -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};
|
||||
|
@ -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},
|
@ -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<RichTextAttributes> for TextBlockConflictResolver {
|
||||
fn transform_delta(
|
||||
&self,
|
||||
delta: RichTextDelta,
|
||||
) -> BoxResultFuture<flowy_sync::RichTextTransformDeltas, FlowyError> {
|
||||
) -> BoxResultFuture<flowy_revision::RichTextTransformDeltas, FlowyError> {
|
||||
let tx = self.edit_cmd_tx.clone();
|
||||
Box::pin(async move {
|
||||
let (ret, rx) = oneshot::channel::<CollaborateResult<RichTextTransformDeltas>>();
|
@ -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};
|
@ -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]
|
@ -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;
|
@ -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},
|
@ -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},
|
@ -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::*,
|
@ -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]
|
Reference in New Issue
Block a user