add rich_text crate

This commit is contained in:
appflowy
2021-12-07 19:59:08 +08:00
parent 2f413a8e67
commit 8a9a23ddbe
44 changed files with 296 additions and 280 deletions

View File

@ -1,8 +1,9 @@
#![cfg_attr(rustfmt, rustfmt::skip)]
use crate::editor::{TestBuilder, TestOp::*};
use flowy_document_infra::core::{FlowyDoc, PlainDoc};
use lib_ot::core::{Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr, RichTextDelta};
use lib_ot::core::{Interval, OperationTransformable, NEW_LINE, WHITESPACE, FlowyStr};
use unicode_segmentation::UnicodeSegmentation;
use lib_ot::rich_text::RichTextDelta;
#[test]
fn attributes_bold_added() {

View File

@ -6,7 +6,10 @@ mod undo_redo_test;
use derive_more::Display;
use flowy_document_infra::core::{CustomDocument, Document};
use lib_ot::core::*;
use lib_ot::{
core::*,
rich_text::{RichTextAttribute, RichTextAttributes, RichTextDelta},
};
use rand::{prelude::*, Rng as WrappedRng};
use std::{sync::Once, time::Duration};

View File

@ -1,7 +1,10 @@
#![allow(clippy::all)]
use crate::editor::{Rng, TestBuilder, TestOp::*};
use flowy_document_infra::core::{FlowyDoc, PlainDoc};
use lib_ot::core::*;
use lib_ot::{
core::*,
rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributes, RichTextDelta},
};
#[test]
fn attributes_insert_text() {

View File

@ -1,5 +1,8 @@
use flowy_document_infra::core::{Document, PlainDoc};
use lib_ot::core::*;
use lib_ot::{
core::*,
rich_text::{AttributeBuilder, RichTextAttribute, RichTextAttributeValue, RichTextDelta},
};
#[test]
fn operation_insert_serialize_test() {