mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 16:19:43 +08:00
refactor(editor): narrow text format parameter (#12946)
#### PR Dependency Tree * **PR #12946** 👈 * **PR #12947** * **PR #12948** This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated terminology and types from "text style" to "text attributes" throughout the text formatting features for improved clarity and consistency. * Separated style-specific attributes (like bold, italic, color, and background) from other text metadata. * Renamed relevant commands and updated menu and toolbar configurations to use the new attribute structure. * **New Features** * Added support for color and background properties in text style attributes. * **Bug Fixes** * Improved consistency and reliability in text formatting and highlighting behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -35,27 +35,30 @@ export type IndentContext = {
|
||||
type: 'indent' | 'dedent';
|
||||
};
|
||||
|
||||
export interface AffineTextAttributes {
|
||||
export type AffineTextStyleAttributes = {
|
||||
bold?: true | null;
|
||||
italic?: true | null;
|
||||
underline?: true | null;
|
||||
strike?: true | null;
|
||||
code?: true | null;
|
||||
color?: string | null;
|
||||
background?: string | null;
|
||||
};
|
||||
|
||||
export type AffineTextAttributes = AffineTextStyleAttributes & {
|
||||
link?: string | null;
|
||||
reference?:
|
||||
| ({
|
||||
type: 'Subpage' | 'LinkedPage';
|
||||
} & ReferenceInfo)
|
||||
| null;
|
||||
background?: string | null;
|
||||
color?: string | null;
|
||||
latex?: string | null;
|
||||
footnote?: FootNote | null;
|
||||
mention?: {
|
||||
member: string;
|
||||
notification?: string;
|
||||
} | null;
|
||||
}
|
||||
};
|
||||
|
||||
export type AffineInlineEditor = InlineEditor<AffineTextAttributes>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user