mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
add flowy-collaboration crate
This commit is contained in:
parent
69ee8aff55
commit
d80061461b
15
backend/Cargo.lock
generated
15
backend/Cargo.lock
generated
@ -457,7 +457,7 @@ dependencies = [
|
||||
"derive_more",
|
||||
"flowy-core-infra",
|
||||
"flowy-document",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"flowy-sdk",
|
||||
"flowy-test",
|
||||
"flowy-user",
|
||||
@ -1213,7 +1213,7 @@ dependencies = [
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-document",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"futures",
|
||||
"futures-core",
|
||||
"lazy_static",
|
||||
@ -1240,7 +1240,7 @@ dependencies = [
|
||||
"chrono",
|
||||
"derive_more",
|
||||
"flowy-derive",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"log",
|
||||
"protobuf",
|
||||
"strum",
|
||||
@ -1286,7 +1286,7 @@ dependencies = [
|
||||
"diesel_derives",
|
||||
"flowy-database",
|
||||
"flowy-derive",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"futures",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
@ -1310,7 +1310,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-document-infra"
|
||||
name = "flowy-ot"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
@ -1319,6 +1319,7 @@ dependencies = [
|
||||
"lib-ot",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"strum",
|
||||
@ -1338,7 +1339,7 @@ dependencies = [
|
||||
"flowy-core",
|
||||
"flowy-database",
|
||||
"flowy-document",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"flowy-user",
|
||||
"futures-core",
|
||||
"lib-dispatch",
|
||||
@ -1361,7 +1362,7 @@ dependencies = [
|
||||
"claim",
|
||||
"flowy-core",
|
||||
"flowy-document",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"flowy-sdk",
|
||||
"flowy-user",
|
||||
"futures-util",
|
||||
|
@ -61,7 +61,7 @@ async-stream = "0.3.2"
|
||||
|
||||
flowy-user-infra = { path = "../shared-lib/flowy-user-infra" }
|
||||
flowy-core-infra = { path = "../shared-lib/flowy-core-infra" }
|
||||
flowy-document-infra = { path = "../shared-lib/flowy-document-infra" }
|
||||
flowy-collaboration = { path = "../shared-lib/flowy-collaboration" }
|
||||
lib-ws = { path = "../shared-lib/lib-ws" }
|
||||
lib-ot = { path = "../shared-lib/lib-ot" }
|
||||
backend-service = { path = "../shared-lib/backend-service", features = ["http_server"] }
|
||||
|
@ -1,4 +1,4 @@
|
||||
use flowy_document_infra::protobuf::Doc;
|
||||
use flowy_collaboration::protobuf::Doc;
|
||||
|
||||
pub(crate) const DOC_TABLE: &str = "doc_table";
|
||||
|
||||
|
@ -4,7 +4,7 @@ use crate::{
|
||||
};
|
||||
use anyhow::Context;
|
||||
use backend_service::errors::ServerError;
|
||||
use flowy_document_infra::protobuf::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use flowy_collaboration::protobuf::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use sqlx::{postgres::PgArguments, PgPool, Postgres};
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -5,7 +5,7 @@ use crate::{
|
||||
use actix_web::web::Data;
|
||||
use async_stream::stream;
|
||||
use backend_service::errors::{internal_error, Result as DocResult, ServerError};
|
||||
use flowy_document_infra::protobuf::Doc;
|
||||
use flowy_collaboration::protobuf::Doc;
|
||||
use futures::stream::StreamExt;
|
||||
use lib_ot::protobuf::Revision;
|
||||
use sqlx::PgPool;
|
||||
|
@ -8,8 +8,8 @@ use crate::{
|
||||
use actix_web::web::Data;
|
||||
use backend_service::errors::{internal_error, ServerError};
|
||||
use dashmap::DashMap;
|
||||
use flowy_document_infra::{
|
||||
core::Document,
|
||||
use flowy_collaboration::{
|
||||
core::document::Document,
|
||||
entities::ws::{WsDataType, WsDocumentData},
|
||||
protobuf::{Doc, UpdateDocParams},
|
||||
};
|
||||
@ -102,8 +102,9 @@ impl ServerDocEditor {
|
||||
let next_rev_id = next(cur_rev_id);
|
||||
if cur_rev_id == revision.base_rev_id || next_rev_id == revision.base_rev_id {
|
||||
// The rev is in the right order, just compose it.
|
||||
let _ = self.compose_revision(&revision, pg_pool).await?;
|
||||
let _ = self.compose_revision(&revision).await?;
|
||||
let _ = send_acked_msg(&user.socket, &revision)?;
|
||||
let _ = self.save_revision(&revision, pg_pool).await?;
|
||||
} else {
|
||||
// The server document is outdated, pull the missing revision from the client.
|
||||
let _ = send_pull_message(&user.socket, &self.doc_id, next_rev_id, revision.rev_id)?;
|
||||
@ -126,11 +127,10 @@ impl ServerDocEditor {
|
||||
|
||||
pub fn document_json(&self) -> String { self.document.read().to_json() }
|
||||
|
||||
async fn compose_revision(&self, revision: &Revision, pg_pool: Data<PgPool>) -> Result<(), ServerError> {
|
||||
async fn compose_revision(&self, revision: &Revision) -> Result<(), ServerError> {
|
||||
let delta = RichTextDelta::from_bytes(&revision.delta_data).map_err(internal_error)?;
|
||||
let _ = self.compose_delta(delta)?;
|
||||
let _ = self.rev_id.fetch_update(SeqCst, SeqCst, |_e| Some(revision.rev_id));
|
||||
let _ = self.save_revision(&revision, pg_pool).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ use crate::{
|
||||
use actix_web::web::Data;
|
||||
use backend_service::errors::{internal_error, Result as DocResult, ServerError};
|
||||
use dashmap::DashMap;
|
||||
use flowy_document_infra::protobuf::{Doc, DocIdentifier};
|
||||
use flowy_collaboration::protobuf::{Doc, DocIdentifier};
|
||||
use lib_ot::protobuf::Revision;
|
||||
use sqlx::PgPool;
|
||||
use std::sync::Arc;
|
||||
|
@ -8,7 +8,7 @@ use actix_web::{
|
||||
};
|
||||
use anyhow::Context;
|
||||
use backend_service::{errors::ServerError, response::FlowyResponse};
|
||||
use flowy_document_infra::protobuf::{CreateDocParams, DocIdentifier, UpdateDocParams};
|
||||
use flowy_collaboration::protobuf::{CreateDocParams, DocIdentifier, UpdateDocParams};
|
||||
use sqlx::PgPool;
|
||||
|
||||
pub async fn create_handler(payload: Payload, pool: Data<PgPool>) -> Result<HttpResponse, ServerError> {
|
||||
|
@ -9,7 +9,7 @@ use actix_rt::task::spawn_blocking;
|
||||
use actix_web::web::Data;
|
||||
use async_stream::stream;
|
||||
use backend_service::errors::{internal_error, Result as DocResult, ServerError};
|
||||
use flowy_document_infra::protobuf::{NewDocUser, WsDataType, WsDocumentData};
|
||||
use flowy_collaboration::protobuf::{NewDocUser, WsDataType, WsDocumentData};
|
||||
use futures::stream::StreamExt;
|
||||
use lib_ot::protobuf::Revision;
|
||||
use sqlx::PgPool;
|
||||
|
@ -9,8 +9,8 @@ use crate::{
|
||||
use crate::services::view::{create_view_with_args, sql_builder::NewViewSqlBuilder};
|
||||
use backend_service::errors::ServerError;
|
||||
use chrono::Utc;
|
||||
use flowy_collaboration::user_default::doc_initial_string;
|
||||
use flowy_core_infra::protobuf::Workspace;
|
||||
use flowy_document_infra::user_default::doc_initial_string;
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
@ -10,6 +10,7 @@ use crate::{
|
||||
};
|
||||
use backend_service::errors::{invalid_params, ServerError};
|
||||
use chrono::Utc;
|
||||
use flowy_collaboration::protobuf::CreateDocParams;
|
||||
use flowy_core_infra::{
|
||||
parser::{
|
||||
app::AppId,
|
||||
@ -17,7 +18,6 @@ use flowy_core_infra::{
|
||||
},
|
||||
protobuf::{CreateViewParams, RepeatedView, View},
|
||||
};
|
||||
use flowy_document_infra::protobuf::CreateDocParams;
|
||||
use sqlx::{postgres::PgArguments, Postgres};
|
||||
use uuid::Uuid;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use actix::Message;
|
||||
use bytes::Bytes;
|
||||
use flowy_document_infra::entities::ws::WsDocumentData;
|
||||
use flowy_collaboration::entities::ws::WsDocumentData;
|
||||
use lib_ws::{WsMessage, WsModule};
|
||||
use std::convert::TryInto;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::util::helper::ViewTest;
|
||||
use flowy_collaboration::entities::doc::DocIdentifier;
|
||||
use flowy_core_infra::entities::view::ViewIdentifiers;
|
||||
use flowy_document_infra::entities::doc::DocIdentifier;
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn doc_read() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::document::helper::{DocScript, DocumentTest};
|
||||
use flowy_document_infra::core::{Document, FlowyDoc};
|
||||
use flowy_collaboration::core::document::{Document, FlowyDoc};
|
||||
use lib_ot::{core::Interval, rich_text::RichTextAttribute};
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
@ -11,7 +11,7 @@ use std::sync::Arc;
|
||||
use tokio::time::{sleep, Duration};
|
||||
// use crate::helper::*;
|
||||
use crate::util::helper::{spawn_server, TestServer};
|
||||
use flowy_document_infra::{entities::doc::DocIdentifier, protobuf::UpdateDocParams};
|
||||
use flowy_collaboration::{entities::doc::DocIdentifier, protobuf::UpdateDocParams};
|
||||
use lib_ot::rich_text::{RichTextAttribute, RichTextDelta};
|
||||
use parking_lot::RwLock;
|
||||
use lib_ot::core::Interval;
|
||||
|
@ -9,9 +9,9 @@ use backend_service::{
|
||||
user_request::*,
|
||||
workspace_request::*,
|
||||
};
|
||||
use flowy_collaboration::entities::doc::{Doc, DocIdentifier};
|
||||
use flowy_core_infra::entities::prelude::*;
|
||||
use flowy_document::services::server::read_doc_request;
|
||||
use flowy_document_infra::entities::doc::{Doc, DocIdentifier};
|
||||
use flowy_user_infra::entities::*;
|
||||
use sqlx::{Connection, Executor, PgConnection, PgPool};
|
||||
use uuid::Uuid;
|
||||
|
@ -11,7 +11,6 @@ import 'package:app_flowy/workspace/application/home/home_bloc.dart';
|
||||
import 'package:app_flowy/workspace/application/home/home_listen_bloc.dart';
|
||||
import 'package:app_flowy/workspace/domain/i_user.dart';
|
||||
import 'package:app_flowy/workspace/infrastructure/i_user_impl.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-infra/protobuf.dart' show UserProfile;
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
import 'network_monitor.dart';
|
||||
@ -34,11 +33,9 @@ class UserDepsResolver {
|
||||
getIt.registerFactory<EditPannelBloc>(() => EditPannelBloc());
|
||||
getIt.registerFactory<SplashBloc>(() => SplashBloc(getIt<ISplashUser>()));
|
||||
|
||||
getIt.registerFactoryParam<HomeListenBloc, UserProfile, void>(
|
||||
(user, _) => HomeListenBloc(
|
||||
getIt<IUserListener>(param1: user),
|
||||
),
|
||||
);
|
||||
getIt.registerFactoryParam<HomeListenBloc, UserProfile, void>((user, _) => HomeListenBloc(
|
||||
getIt<IUserListener>(param1: user),
|
||||
));
|
||||
|
||||
getIt.registerLazySingleton<NetworkMonitor>(() => NetworkMonitor());
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import 'package:flowy_log/flowy_log.dart';
|
||||
import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-infra/protobuf.dart' show UserProfile;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:app_flowy/workspace/domain/edit_context.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
// ignore: import_of_legacy_library_into_null_safe
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@ -27,8 +26,7 @@ class EditPannelBloc extends Bloc<EditPannelEvent, EditPannelState> {
|
||||
|
||||
@freezed
|
||||
class EditPannelEvent with _$EditPannelEvent {
|
||||
const factory EditPannelEvent.startEdit(EditPannelContext context) =
|
||||
_StartEdit;
|
||||
const factory EditPannelEvent.startEdit(EditPannelContext context) = _StartEdit;
|
||||
|
||||
const factory EditPannelEvent.endEdit(EditPannelContext context) = _EndEdit;
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_log/flowy_log.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/app_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'package:app_flowy/workspace/domain/i_user.dart';
|
||||
import 'package:flowy_log/flowy_log.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-infra/protobuf.dart' show UserProfile;
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/workspace_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/app_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/view_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/protobuf.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
|
||||
abstract class IDoc {
|
||||
|
@ -2,7 +2,6 @@ import 'package:flowy_infra/notifier.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:app_flowy/startup/startup.dart';
|
||||
import 'package:app_flowy/workspace/presentation/stack_page/blank/blank_page.dart';
|
||||
import 'package:app_flowy/workspace/presentation/stack_page/home_stack.dart';
|
||||
import 'package:app_flowy/workspace/presentation/widgets/prelude.dart';
|
||||
|
||||
|
@ -4,7 +4,7 @@ import 'dart:typed_data';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:app_flowy/workspace/domain/i_doc.dart';
|
||||
import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
|
||||
class IDocImpl extends IDoc {
|
||||
|
@ -9,7 +9,6 @@ import 'package:flowy_sdk/protobuf/flowy-core-infra/app_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/app_query.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/app_update.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/view_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/view_create.pbenum.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/observable.pb.dart';
|
||||
import 'package:flowy_sdk/rust_stream.dart';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-document-infra/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/doc.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/view_query.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core/errors.pb.dart';
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
import 'dart:async';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:flowy_sdk/dispatch/dispatch.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user/errors.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-infra/protobuf.dart' show UserProfile;
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/workspace_create.pb.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/workspace_query.pb.dart';
|
||||
import 'package:app_flowy/workspace/domain/i_user.dart';
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter_quill/flutter_quill.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_quill/models/documents/style.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
@ -14,7 +14,6 @@ import 'package:flowy_infra_ui/style_widget/button.dart';
|
||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:app_flowy/generated/locale_keys.g.dart';
|
||||
|
||||
|
@ -5,7 +5,6 @@ import 'package:flowy_infra/image.dart';
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/extension.dart';
|
||||
import 'package:app_flowy/generated/locale_keys.g.dart';
|
||||
// ignore: implementation_imports
|
||||
|
@ -11,7 +11,6 @@ import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/view_create.pb.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:styled_widget/styled_widget.dart';
|
||||
import 'package:app_flowy/workspace/domain/image.dart';
|
||||
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/app/menu_app.dart';
|
||||
|
@ -7,7 +7,6 @@ import 'package:flowy_infra/image.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:app_flowy/generated/locale_keys.g.dart';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
class ColorUtils {
|
||||
@ -8,18 +6,14 @@ class ColorUtils {
|
||||
return hslc.withLightness((hslc.lightness + amt).clamp(0.0, 1.0)).toColor();
|
||||
}
|
||||
|
||||
static Color parseHex(String value) =>
|
||||
Color(int.parse(value.substring(1, 7), radix: 16) + 0xFF000000);
|
||||
static Color parseHex(String value) => Color(int.parse(value.substring(1, 7), radix: 16) + 0xFF000000);
|
||||
|
||||
static Color blend(Color dst, Color src, double opacity) {
|
||||
return Color.fromARGB(
|
||||
255,
|
||||
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity)
|
||||
.toInt(),
|
||||
(dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity)
|
||||
.toInt(),
|
||||
(dst.blue.toDouble() * (1.0 - opacity) + src.blue.toDouble() * opacity)
|
||||
.toInt(),
|
||||
(dst.red.toDouble() * (1.0 - opacity) + src.red.toDouble() * opacity).toInt(),
|
||||
(dst.green.toDouble() * (1.0 - opacity) + src.green.toDouble() * opacity).toInt(),
|
||||
(dst.blue.toDouble() * (1.0 - opacity) + src.blue.toDouble() * opacity).toInt(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flowy_infra/color.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
enum ThemeType {
|
||||
|
@ -1,8 +1,5 @@
|
||||
import 'dart:math' as math;
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'flowy_overlay.dart';
|
||||
|
||||
class OverlayLayoutDelegate extends SingleChildLayoutDelegate {
|
||||
|
@ -3,7 +3,6 @@ import 'package:flowy_infra_ui/style_widget/hover.dart';
|
||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||
import 'package:flowy_infra_ui/widget/spacing.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class FlowyButton extends StatelessWidget {
|
||||
final Widget text;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
export 'package:styled_widget/styled_widget.dart';
|
||||
|
||||
extension FlowyStyledWidget on Widget {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:loading_indicator/loading_indicator.dart';
|
||||
|
||||
List<Color> _kDefaultRainbowColors = const [
|
||||
|
@ -1,9 +1,7 @@
|
||||
import 'package:flowy_infra/size.dart';
|
||||
import 'package:flowy_infra/text_style.dart';
|
||||
import 'package:flowy_infra/theme.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class BaseStyledButton extends StatefulWidget {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
extension ClickableExtensions on Widget {
|
||||
Widget clickable(void Function() action, {bool opaque = true}) {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
|
||||
typedef HoverBuilder = Widget Function(BuildContext context, bool onHover);
|
||||
|
||||
|
@ -19,7 +19,7 @@ import 'package:flowy_sdk/ffi.dart' as ffi;
|
||||
import 'package:flowy_sdk/protobuf/flowy-user-infra/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/dart-ffi/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-core-infra/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-document-infra/protobuf.dart';
|
||||
import 'package:flowy_sdk/protobuf/flowy-collaboration/protobuf.dart';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'package:flowy_sdk/protobuf/lib-infra/protobuf.dart';
|
||||
|
@ -7,7 +7,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
flowy-core-infra = { path = "../../../shared-lib/flowy-core-infra" }
|
||||
flowy-document-infra = { path = "../../../shared-lib/flowy-document-infra" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-sqlite = { path = "../../../shared-lib/lib-sqlite" }
|
||||
|
@ -6,8 +6,8 @@ use crate::{
|
||||
services::{server::Server, AppController, TrashController, ViewController, WorkspaceController},
|
||||
};
|
||||
use chrono::Utc;
|
||||
use flowy_collaboration::{entities::doc::DocDelta, user_default::initial_read_me};
|
||||
use flowy_core_infra::user_default;
|
||||
use flowy_document_infra::{entities::doc::DocDelta, user_default::initial_read_me};
|
||||
use lazy_static::lazy_static;
|
||||
use lib_infra::entities::network_state::NetworkType;
|
||||
use parking_lot::RwLock;
|
||||
|
@ -1,5 +1,5 @@
|
||||
use flowy_collaboration::entities::doc::{DocDelta, DocIdentifier};
|
||||
use flowy_database::SqliteConnection;
|
||||
use flowy_document_infra::entities::doc::{DocDelta, DocIdentifier};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
|
@ -15,8 +15,8 @@ use crate::{
|
||||
errors::WorkspaceError,
|
||||
services::{TrashController, ViewController},
|
||||
};
|
||||
use flowy_collaboration::entities::doc::DocDelta;
|
||||
use flowy_core_infra::entities::share::{ExportData, ExportParams, ExportRequest};
|
||||
use flowy_document_infra::entities::doc::DocDelta;
|
||||
use lib_dispatch::prelude::{data_result, Data, DataResult, Unit};
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
|
||||
|
@ -7,7 +7,7 @@ edition = "2018"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
flowy-document-infra = { path = "../../../shared-lib/flowy-document-infra" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
|
@ -92,8 +92,8 @@ impl std::convert::From<lib_ot::errors::OTError> for DocError {
|
||||
fn from(error: lib_ot::errors::OTError) -> Self { DocError::internal().context(error) }
|
||||
}
|
||||
|
||||
impl std::convert::From<flowy_document_infra::errors::DocumentError> for DocError {
|
||||
fn from(error: flowy_document_infra::errors::DocumentError) -> Self { DocError::internal().context(error) }
|
||||
impl std::convert::From<flowy_collaboration::errors::DocumentError> for DocError {
|
||||
fn from(error: flowy_collaboration::errors::DocumentError) -> Self { DocError::internal().context(error) }
|
||||
}
|
||||
|
||||
impl std::convert::From<std::io::Error> for DocError {
|
||||
|
@ -7,8 +7,8 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use backend_service::configuration::ClientServerConfiguration;
|
||||
use flowy_collaboration::entities::doc::{DocDelta, DocIdentifier};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_document_infra::entities::doc::{DocDelta, DocIdentifier};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub trait DocumentUser: Send + Sync {
|
||||
|
@ -12,8 +12,8 @@ use crate::{
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use dashmap::DashMap;
|
||||
use flowy_collaboration::entities::doc::{Doc, DocDelta, DocIdentifier};
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_document_infra::entities::doc::{Doc, DocDelta, DocIdentifier};
|
||||
use lib_infra::future::ResultFuture;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -10,12 +10,12 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_document_infra::{
|
||||
core::history::UndoResult,
|
||||
use flowy_collaboration::{
|
||||
core::document::history::UndoResult,
|
||||
entities::{doc::DocDelta, ws::WsDocumentData},
|
||||
errors::DocumentResult,
|
||||
};
|
||||
use flowy_database::ConnectionPool;
|
||||
use lib_infra::retry::{ExponentialBackoff, Retry};
|
||||
use lib_ot::{
|
||||
core::Interval,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{errors::DocError, services::ws::DocumentWebSocket};
|
||||
use flowy_document_infra::entities::doc::NewDocUser;
|
||||
use flowy_collaboration::entities::doc::NewDocUser;
|
||||
use futures::future::BoxFuture;
|
||||
use lib_infra::retry::Action;
|
||||
use lib_ot::revision::RevId;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use async_stream::stream;
|
||||
use bytes::Bytes;
|
||||
use flowy_document_infra::{
|
||||
core::{history::UndoResult, Document},
|
||||
use flowy_collaboration::{
|
||||
core::document::{history::UndoResult, Document},
|
||||
errors::DocumentError,
|
||||
};
|
||||
use futures::stream::StreamExt;
|
||||
|
@ -3,8 +3,8 @@ use crate::{
|
||||
services::doc::revision::RevisionServer,
|
||||
sql_tables::RevTableSql,
|
||||
};
|
||||
use flowy_collaboration::entities::doc::Doc;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_document_infra::entities::doc::Doc;
|
||||
use lib_infra::future::ResultFuture;
|
||||
use lib_ot::{
|
||||
core::{Operation, OperationTransformable},
|
||||
|
@ -5,7 +5,7 @@ use crate::{
|
||||
ws::DocumentWebSocket,
|
||||
},
|
||||
};
|
||||
use flowy_document_infra::{entities::doc::Doc, util::RevIdCounter};
|
||||
use flowy_collaboration::{entities::doc::Doc, util::RevIdCounter};
|
||||
use lib_infra::future::ResultFuture;
|
||||
use lib_ot::{
|
||||
core::OperationTransformable,
|
||||
|
@ -10,12 +10,12 @@ use crate::{
|
||||
};
|
||||
use async_stream::stream;
|
||||
use bytes::Bytes;
|
||||
use flowy_document_infra::entities::ws::{WsDataType, WsDocumentData};
|
||||
use flowy_collaboration::entities::ws::{WsDataType, WsDocumentData};
|
||||
use futures::stream::StreamExt;
|
||||
use lib_ot::revision::{RevId, RevisionRange};
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
use tokio::{
|
||||
sync::{broadcast, mpsc},
|
||||
sync::{broadcast, mpsc, mpsc::error::SendError},
|
||||
task::spawn_blocking,
|
||||
time::{interval, Duration},
|
||||
};
|
||||
@ -175,7 +175,7 @@ impl RevisionUpStream {
|
||||
match self.revisions.next().await? {
|
||||
None => Ok(()),
|
||||
Some(record) => {
|
||||
tracing::debug!(
|
||||
tracing::trace!(
|
||||
"[RevisionUpStream]: processes revision: {}:{:?}",
|
||||
record.revision.doc_id,
|
||||
record.revision.rev_id
|
||||
@ -193,7 +193,9 @@ async fn tick(sender: mpsc::UnboundedSender<UpStreamMsg>) {
|
||||
loop {
|
||||
match sender.send(UpStreamMsg::Tick) {
|
||||
Ok(_) => {},
|
||||
Err(e) => log::error!("RevisionUploadStream tick error: {}", e),
|
||||
Err(_e) => {
|
||||
break;
|
||||
},
|
||||
}
|
||||
i.tick().await;
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ pub use server_api::*;
|
||||
// TODO: ignore mock files in production
|
||||
use crate::errors::DocError;
|
||||
use backend_service::configuration::ClientServerConfiguration;
|
||||
use flowy_document_infra::entities::doc::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use lib_infra::future::ResultFuture;
|
||||
pub use server_api_mock::*;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{errors::DocError, services::server::DocumentServerAPI};
|
||||
use backend_service::{configuration::*, request::HttpRequestBuilder};
|
||||
use flowy_document_infra::entities::doc::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use flowy_collaboration::entities::doc::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams};
|
||||
use lib_infra::future::ResultFuture;
|
||||
|
||||
pub struct DocServer {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{errors::DocError, services::server::DocumentServerAPI};
|
||||
use flowy_document_infra::{
|
||||
use flowy_collaboration::{
|
||||
entities::doc::{CreateDocParams, Doc, DocIdentifier, UpdateDocParams},
|
||||
user_default::doc_initial_string,
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::errors::DocError;
|
||||
use bytes::Bytes;
|
||||
use dashmap::DashMap;
|
||||
use flowy_document_infra::entities::ws::WsDocumentData;
|
||||
use flowy_collaboration::entities::ws::WsDocumentData;
|
||||
use lib_ws::WsConnectState;
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use diesel::sql_types::Integer;
|
||||
use flowy_database::schema::rev_table;
|
||||
|
||||
use flowy_document_infra::util::md5;
|
||||
use flowy_collaboration::util::md5;
|
||||
use lib_ot::revision::{RevId, RevState, RevType, Revision};
|
||||
|
||||
#[derive(PartialEq, Clone, Debug, Queryable, Identifiable, Insertable, Associations)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![cfg_attr(rustfmt, rustfmt::skip)]
|
||||
use crate::editor::{TestBuilder, TestOp::*};
|
||||
use flowy_document_infra::core::{FlowyDoc, PlainDoc};
|
||||
use flowy_collaboration::core::document::{FlowyDoc, PlainDoc};
|
||||
use lib_ot::core::{Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr};
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use lib_ot::rich_text::RichTextDelta;
|
||||
|
@ -6,7 +6,7 @@ mod serde_test;
|
||||
mod undo_redo_test;
|
||||
|
||||
use derive_more::Display;
|
||||
use flowy_document_infra::core::{CustomDocument, Document};
|
||||
use flowy_collaboration::core::document::{CustomDocument, Document};
|
||||
use lib_ot::{
|
||||
core::*,
|
||||
rich_text::{RichTextAttribute, RichTextAttributes, RichTextDelta},
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![allow(clippy::all)]
|
||||
use crate::editor::{Rng, TestBuilder, TestOp::*};
|
||||
use flowy_document_infra::core::{FlowyDoc, PlainDoc};
|
||||
use flowy_collaboration::core::document::{FlowyDoc, PlainDoc};
|
||||
use lib_ot::{
|
||||
core::*,
|
||||
rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributes, RichTextDelta},
|
||||
|
@ -1,4 +1,4 @@
|
||||
use flowy_document_infra::core::{Document, PlainDoc};
|
||||
use flowy_collaboration::core::document::{Document, PlainDoc};
|
||||
use lib_ot::{
|
||||
core::*,
|
||||
rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributeValue, RichTextDelta},
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::editor::{TestBuilder, TestOp::*};
|
||||
use flowy_document_infra::core::{FlowyDoc, PlainDoc, RECORD_THRESHOLD};
|
||||
use flowy_collaboration::core::document::{FlowyDoc, PlainDoc, RECORD_THRESHOLD};
|
||||
use lib_ot::core::{Interval, NEW_LINE, WHITESPACE};
|
||||
|
||||
#[test]
|
||||
|
@ -22,7 +22,7 @@ tokio = { version = "1", features = ["rt"] }
|
||||
parking_lot = "0.11"
|
||||
|
||||
|
||||
flowy-document-infra = { path = "../../../shared-lib/flowy-document-infra" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
lib-ws = { path = "../../../shared-lib/lib-ws" }
|
||||
backend-service = { path = "../../../shared-lib/backend-service" }
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::ws::WsDocumentData;
|
||||
use flowy_database::ConnectionPool;
|
||||
use flowy_document::{
|
||||
errors::{internal_error, DocError},
|
||||
module::DocumentUser,
|
||||
services::ws::{DocumentWebSocket, WsDocumentManager, WsStateReceiver},
|
||||
};
|
||||
use flowy_document_infra::entities::ws::WsDocumentData;
|
||||
use flowy_user::{
|
||||
errors::{ErrorCode, UserError},
|
||||
services::user::UserSession,
|
||||
|
@ -13,7 +13,7 @@ flowy-document = { path = "../flowy-document"}
|
||||
lib-dispatch = { path = "../lib-dispatch" }
|
||||
lib-infra = { path = "../lib-infra" }
|
||||
|
||||
flowy-document-infra = { path = "../../../shared-lib/flowy-document-infra" }
|
||||
flowy-collaboration = { path = "../../../shared-lib/flowy-collaboration" }
|
||||
backend-service = { path = "../../../shared-lib/backend-service" }
|
||||
lib-ot = { path = "../../../shared-lib/lib-ot" }
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
use crate::{helper::ViewTest, FlowySDKTest};
|
||||
use flowy_document::services::doc::{edit::ClientDocEditor, revision::RevisionIterator};
|
||||
use flowy_document_infra::entities::{
|
||||
use flowy_collaboration::entities::{
|
||||
doc::DocIdentifier,
|
||||
ws::{WsDocumentData, WsDocumentDataBuilder},
|
||||
};
|
||||
use flowy_document::services::doc::{edit::ClientDocEditor, revision::RevisionIterator};
|
||||
use lib_ot::{
|
||||
core::Interval,
|
||||
revision::{RevState, RevType, Revision, RevisionRange},
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crate::prelude::*;
|
||||
use bytes::Bytes;
|
||||
use flowy_collaboration::entities::doc::Doc;
|
||||
use flowy_core::{
|
||||
entities::{
|
||||
app::*,
|
||||
@ -10,7 +11,6 @@ use flowy_core::{
|
||||
errors::{ErrorCode, WorkspaceError},
|
||||
event::WorkspaceEvent::{CreateWorkspace, OpenWorkspace, *},
|
||||
};
|
||||
use flowy_document_infra::entities::doc::Doc;
|
||||
use flowy_user::{
|
||||
entities::{SignInRequest, SignUpRequest, UserProfile},
|
||||
errors::UserError,
|
||||
|
@ -103,7 +103,7 @@ impl std::default::Default for WsManager {
|
||||
let ws: Arc<dyn FlowyWebSocket> = if cfg!(feature = "http_server") {
|
||||
Arc::new(Arc::new(WsController::new()))
|
||||
} else {
|
||||
mock::MockWebSocket::new()
|
||||
Arc::new(Arc::new(mock::MockWebSocket::new()))
|
||||
};
|
||||
|
||||
WsManager {
|
||||
@ -181,10 +181,13 @@ mod mock {
|
||||
}
|
||||
|
||||
impl MockWebSocket {
|
||||
pub fn new() -> Arc<MockWebSocket> {
|
||||
let ws = Arc::new(MockWebSocket::default());
|
||||
let mut ws_receiver = ws.ws_sender.subscribe();
|
||||
let cloned_ws = ws.clone();
|
||||
pub fn new() -> MockWebSocket { MockWebSocket::default() }
|
||||
}
|
||||
|
||||
impl FlowyWebSocket for Arc<MockWebSocket> {
|
||||
fn start_connect(&self, _addr: String) -> ResultFuture<(), UserError> {
|
||||
let mut ws_receiver = self.ws_sender.subscribe();
|
||||
let cloned_ws = self.clone();
|
||||
tokio::spawn(async move {
|
||||
while let Ok(message) = ws_receiver.recv().await {
|
||||
match cloned_ws.handlers.get(&message.module) {
|
||||
@ -193,12 +196,9 @@ mod mock {
|
||||
}
|
||||
}
|
||||
});
|
||||
ws
|
||||
}
|
||||
}
|
||||
|
||||
impl FlowyWebSocket for MockWebSocket {
|
||||
fn start_connect(&self, _addr: String) -> ResultFuture<(), UserError> { ResultFuture::new(async { Ok(()) }) }
|
||||
ResultFuture::new(async { Ok(()) })
|
||||
}
|
||||
|
||||
fn conn_state_subscribe(&self) -> Receiver<WsConnectState> { self.state_sender.subscribe() }
|
||||
|
||||
|
5
shared-lib/Cargo.lock
generated
5
shared-lib/Cargo.lock
generated
@ -665,7 +665,7 @@ dependencies = [
|
||||
"chrono",
|
||||
"derive_more",
|
||||
"flowy-derive",
|
||||
"flowy-document-infra",
|
||||
"flowy-ot",
|
||||
"log",
|
||||
"protobuf",
|
||||
"strum",
|
||||
@ -688,7 +688,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flowy-document-infra"
|
||||
name = "flowy-ot"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
@ -697,6 +697,7 @@ dependencies = [
|
||||
"lib-ot",
|
||||
"log",
|
||||
"md5",
|
||||
"parking_lot",
|
||||
"protobuf",
|
||||
"serde",
|
||||
"strum",
|
||||
|
@ -2,7 +2,7 @@
|
||||
members = [
|
||||
"flowy-user-infra",
|
||||
"flowy-core-infra",
|
||||
"flowy-document-infra",
|
||||
"flowy-collaboration",
|
||||
"lib-ot",
|
||||
"lib-ws",
|
||||
"lib-sqlite",
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "flowy-document-infra"
|
||||
name = "flowy-collaboration"
|
||||
version = "0.1.0"
|
||||
edition = "2018"
|
||||
|
||||
@ -18,4 +18,5 @@ tracing = { version = "0.1", features = ["log"] }
|
||||
url = "2.2"
|
||||
strum = "0.21"
|
||||
strum_macros = "0.21"
|
||||
chrono = "0.4.19"
|
||||
chrono = "0.4.19"
|
||||
parking_lot = "0.11"
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
core::{
|
||||
core::document::{
|
||||
history::{History, UndoResult},
|
||||
view::{View, RECORD_THRESHOLD},
|
||||
},
|
@ -1,4 +1,4 @@
|
||||
use crate::core::extensions::DeleteExt;
|
||||
use crate::core::document::DeleteExt;
|
||||
use lib_ot::{
|
||||
core::{DeltaBuilder, Interval},
|
||||
rich_text::RichTextDelta,
|
@ -1,4 +1,4 @@
|
||||
use crate::{core::extensions::DeleteExt, util::is_newline};
|
||||
use crate::{core::document::DeleteExt, util::is_newline};
|
||||
use lib_ot::{
|
||||
core::{Attributes, CharMetric, DeltaBuilder, DeltaIter, Interval, NEW_LINE},
|
||||
rich_text::{plain_attributes, RichTextDelta},
|
@ -1,8 +1,8 @@
|
||||
mod format_at_position;
|
||||
mod helper;
|
||||
mod resolve_block_format;
|
||||
mod resolve_inline_format;
|
||||
|
||||
pub use format_at_position::*;
|
||||
pub use resolve_block_format::*;
|
||||
pub use resolve_inline_format::*;
|
||||
|
||||
mod format_at_position;
|
||||
mod resolve_block_format;
|
||||
mod resolve_inline_format;
|
||||
|
@ -1,12 +1,14 @@
|
||||
use crate::{
|
||||
core::extensions::{format::helper::line_break, FormatExt},
|
||||
util::find_newline,
|
||||
};
|
||||
use lib_ot::{
|
||||
core::{DeltaBuilder, DeltaIter, Interval},
|
||||
rich_text::{plain_attributes, AttributeScope, RichTextAttribute, RichTextDelta},
|
||||
rich_text::{AttributeScope, plain_attributes, RichTextAttribute, RichTextDelta},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
core::document::FormatExt,
|
||||
util::find_newline,
|
||||
};
|
||||
use crate::core::document::extensions::helper::line_break;
|
||||
|
||||
pub struct ResolveBlockFormat {}
|
||||
impl FormatExt for ResolveBlockFormat {
|
||||
fn ext_name(&self) -> &str { std::any::type_name::<ResolveBlockFormat>() }
|
@ -1,12 +1,14 @@
|
||||
use crate::{
|
||||
core::extensions::{format::helper::line_break, FormatExt},
|
||||
util::find_newline,
|
||||
};
|
||||
use lib_ot::{
|
||||
core::{DeltaBuilder, DeltaIter, Interval},
|
||||
rich_text::{AttributeScope, RichTextAttribute, RichTextDelta},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
core::document::FormatExt,
|
||||
util::find_newline,
|
||||
};
|
||||
use crate::core::document::extensions::helper::line_break;
|
||||
|
||||
pub struct ResolveInlineFormat {}
|
||||
impl FormatExt for ResolveInlineFormat {
|
||||
fn ext_name(&self) -> &str { std::any::type_name::<ResolveInlineFormat>() }
|
@ -1,4 +1,4 @@
|
||||
use crate::{core::extensions::InsertExt, util::is_newline};
|
||||
use crate::{core::document::InsertExt, util::is_newline};
|
||||
use lib_ot::{
|
||||
core::{is_empty_line_at_index, DeltaBuilder, DeltaIter},
|
||||
rich_text::{attributes_except_header, RichTextAttributeKey, RichTextDelta},
|
@ -1,4 +1,4 @@
|
||||
use crate::{core::extensions::InsertExt, util::is_whitespace};
|
||||
use crate::{core::document::InsertExt, util::is_whitespace};
|
||||
use lib_ot::{
|
||||
core::{count_utf16_code_units, DeltaBuilder, DeltaIter},
|
||||
rich_text::{plain_attributes, RichTextAttribute, RichTextAttributes, RichTextDelta},
|
@ -1,4 +1,4 @@
|
||||
use crate::core::extensions::InsertExt;
|
||||
use crate::core::document::InsertExt;
|
||||
use lib_ot::{
|
||||
core::{Attributes, DeltaBuilder, DeltaIter, NEW_LINE},
|
||||
rich_text::{RichTextAttributeKey, RichTextAttributes, RichTextDelta},
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user