mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-04 19:11:57 +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:
@@ -9,6 +9,7 @@ import {
|
||||
promptDocTitle,
|
||||
} from '@blocksuite/affine-block-embed';
|
||||
import { updateBlockType } from '@blocksuite/affine-block-note';
|
||||
import type { HighlightType } from '@blocksuite/affine-components/highlight-dropdown-menu';
|
||||
import { toast } from '@blocksuite/affine-components/toast';
|
||||
import { EditorChevronDown } from '@blocksuite/affine-components/toolbar';
|
||||
import {
|
||||
@@ -38,7 +39,6 @@ import type {
|
||||
ToolbarModuleConfig,
|
||||
} from '@blocksuite/affine-shared/services';
|
||||
import { ActionPlacement } from '@blocksuite/affine-shared/services';
|
||||
import type { AffineTextAttributes } from '@blocksuite/affine-shared/types';
|
||||
import { tableViewMeta } from '@blocksuite/data-view/view-presets';
|
||||
import {
|
||||
CopyIcon,
|
||||
@@ -140,7 +140,7 @@ const highlightActionGroup = {
|
||||
id: 'c.highlight',
|
||||
when: ({ chain }) => isFormatSupported(chain).run()[0],
|
||||
content({ chain }) {
|
||||
const updateHighlight = (styles: AffineTextAttributes) => {
|
||||
const updateHighlight = (styles: HighlightType) => {
|
||||
const payload = { styles };
|
||||
chain
|
||||
.try(chain => [
|
||||
|
||||
Reference in New Issue
Block a user