feat: move handles to flowy-block crate

This commit is contained in:
appflowy 2022-03-05 21:15:10 +08:00
parent 11ceb96f65
commit 5c155a07bf
48 changed files with 370 additions and 101 deletions

View file

@ -23,8 +23,6 @@ use crate::{
};
use flowy_block::BlockManager;
use flowy_database::kv::KV;
use flowy_folder_data_model::entities::share::{ExportData, ExportParams};
use lib_infra::uuid;
const LATEST_VIEW_ID: &str = "latest_view_id";
@ -179,16 +177,6 @@ impl ViewController {
Ok(())
}
#[tracing::instrument(level = "debug", skip(self, params), err)]
pub(crate) async fn export_view(&self, params: ExportParams) -> Result<ExportData, FlowyError> {
let editor = self.block_manager.open_block(&params.view_id).await?;
let delta_json = editor.block_json().await?;
Ok(ExportData {
data: delta_json,
export_type: params.export_type,
})
}
// belong_to_id will be the app_id or view_id.
#[tracing::instrument(level = "debug", skip(self), err)]
pub(crate) async fn read_views_belong_to(&self, belong_to_id: &str) -> Result<RepeatedView, FlowyError> {