feat(editor): implement US-EDITOR-UX with global block selection, redesigned slash menu (favorites & preview), contextual placeholders, smart paste extended, turn into and undo/redo toasts

This commit is contained in:
Antigravity
2026-05-27 21:47:50 +00:00
parent e3cb1307d3
commit ad8b8b815e
9 changed files with 1112 additions and 157 deletions

View File

@@ -0,0 +1,27 @@
import { Extension } from '@tiptap/core'
/**
* Extension TipTap qui permet de transformer instantanément le bloc sous le curseur
* en cyclant entre Titre 1, Titre 2, Titre 3 et Paragraphe normal via le raccourci clavier Cmd+Shift+H (ou Ctrl+Shift+H).
*/
export const TurnIntoShortcutExtension = Extension.create({
name: 'turnIntoShortcut',
addKeyboardShortcuts() {
return {
'Mod-Shift-h': () => {
const { editor } = this
if (editor.isActive('heading', { level: 1 })) {
return editor.chain().focus().toggleHeading({ level: 2 }).run()
} else if (editor.isActive('heading', { level: 2 })) {
return editor.chain().focus().toggleHeading({ level: 3 }).run()
} else if (editor.isActive('heading', { level: 3 })) {
return editor.chain().focus().setParagraph().run()
} else {
return editor.chain().focus().toggleHeading({ level: 1 }).run()
}
},
}
},
})