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:
L-Sun
2025-07-02 14:55:14 +08:00
committed by GitHub
parent 423c5bd711
commit bcd6a70b59
9 changed files with 82 additions and 68 deletions
+7 -4
View File
@@ -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>;