mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
feat: implement textAlign property (#11790)
for paragraph blocks, image blocks, list blocks, and table blocks Should fix #8617 and #11254. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added text alignment options (left, center, right) for paragraph, list, image, note, and table blocks. - Introduced alignment controls in toolbars and slash menus for easier formatting. - Enabled keyboard shortcuts for quick text alignment changes (supports Mac and Windows). - **Localization** - Added English, Simplified Chinese, and Traditional Chinese translations for new alignment commands and shortcuts. - **Style** - Blocks now visually reflect selected text alignment in their layout. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: L-Sun <zover.v@gmail.com>
This commit is contained in:
@@ -38,6 +38,9 @@ type KeyboardShortcutsI18NKeys =
|
||||
| 'bodyText'
|
||||
| 'increaseIndent'
|
||||
| 'reduceIndent'
|
||||
| 'alignLeft'
|
||||
| 'alignCenter'
|
||||
| 'alignRight'
|
||||
| 'groupDatabase'
|
||||
| 'moveUp'
|
||||
| 'moveDown'
|
||||
@@ -185,6 +188,9 @@ export const useMacPageKeyboardShortcuts = (): ShortcutMap => {
|
||||
[tH('6')]: ['⌘', '⌥', '6'],
|
||||
[t('increaseIndent')]: ['Tab'],
|
||||
[t('reduceIndent')]: ['⇧', 'Tab'],
|
||||
[t('alignLeft')]: ['⌘', '⇧', 'L'],
|
||||
[t('alignCenter')]: ['⌘', '⇧', 'E'],
|
||||
[t('alignRight')]: ['⌘', '⇧', 'R'],
|
||||
[t('groupDatabase')]: ['⌘', 'G'],
|
||||
[t('switch')]: ['⌥', 'S'],
|
||||
// not implement yet
|
||||
@@ -242,6 +248,9 @@ export const useWinPageKeyboardShortcuts = (): ShortcutMap => {
|
||||
[tH('6')]: ['Ctrl', 'Shift', '6'],
|
||||
[t('increaseIndent')]: ['Tab'],
|
||||
[t('reduceIndent')]: ['Shift+Tab'],
|
||||
[t('alignLeft')]: ['Ctrl', 'Shift', 'L'],
|
||||
[t('alignCenter')]: ['Ctrl', 'Shift', 'E'],
|
||||
[t('alignRight')]: ['Ctrl', 'Shift', 'R'],
|
||||
[t('groupDatabase')]: ['Ctrl + G'],
|
||||
['Switch']: ['Alt + S'],
|
||||
// not implement yet
|
||||
|
||||
@@ -2509,6 +2509,18 @@ export function useAFFiNEI18N(): {
|
||||
* `Just now`
|
||||
*/
|
||||
["com.affine.just-now"](): string;
|
||||
/**
|
||||
* `Align center`
|
||||
*/
|
||||
["com.affine.keyboardShortcuts.alignCenter"](): string;
|
||||
/**
|
||||
* `Align left`
|
||||
*/
|
||||
["com.affine.keyboardShortcuts.alignLeft"](): string;
|
||||
/**
|
||||
* `Align right`
|
||||
*/
|
||||
["com.affine.keyboardShortcuts.alignRight"](): string;
|
||||
/**
|
||||
* `Append to daily note`
|
||||
*/
|
||||
|
||||
@@ -626,6 +626,9 @@
|
||||
"com.affine.journal.placeholder.title": "No Journal",
|
||||
"com.affine.journal.placeholder.create": "Create Daily Journal",
|
||||
"com.affine.just-now": "Just now",
|
||||
"com.affine.keyboardShortcuts.alignCenter": "Align center",
|
||||
"com.affine.keyboardShortcuts.alignLeft": "Align left",
|
||||
"com.affine.keyboardShortcuts.alignRight": "Align right",
|
||||
"com.affine.keyboardShortcuts.appendDailyNote": "Append to daily note",
|
||||
"com.affine.keyboardShortcuts.bodyText": "Body text",
|
||||
"com.affine.keyboardShortcuts.bold": "Bold",
|
||||
|
||||
@@ -623,6 +623,9 @@
|
||||
"com.affine.journal.daily-count-updated-empty-tips": "你还没有任何更新",
|
||||
"com.affine.journal.updated-today": "更新",
|
||||
"com.affine.just-now": "就是现在",
|
||||
"com.affine.keyboardShortcuts.alignCenter": "居中对齐",
|
||||
"com.affine.keyboardShortcuts.alignLeft": "左对齐",
|
||||
"com.affine.keyboardShortcuts.alignRight": "右对齐",
|
||||
"com.affine.keyboardShortcuts.appendDailyNote": "添加日常笔记快捷键",
|
||||
"com.affine.keyboardShortcuts.bodyText": "正文",
|
||||
"com.affine.keyboardShortcuts.bold": "粗体",
|
||||
|
||||
@@ -623,6 +623,9 @@
|
||||
"com.affine.journal.daily-count-updated-empty-tips": "你還沒有任何更新",
|
||||
"com.affine.journal.updated-today": "更新",
|
||||
"com.affine.just-now": "就是現在",
|
||||
"com.affine.keyboardShortcuts.alignCenter": "置中對齊",
|
||||
"com.affine.keyboardShortcuts.alignLeft": "靠左對齊",
|
||||
"com.affine.keyboardShortcuts.alignRight": "靠右對齊",
|
||||
"com.affine.keyboardShortcuts.appendDailyNote": "附加到隨筆",
|
||||
"com.affine.keyboardShortcuts.bodyText": "正文",
|
||||
"com.affine.keyboardShortcuts.bold": "粗體",
|
||||
|
||||
Reference in New Issue
Block a user