feat: blocs Callout (encadrés colorés) + Outline (sommaire auto)
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m11s
CI / Deploy production (on server) (push) Has been skipped

- Callout : 5 types (info, alerte, astuce, succès, danger), icône cliquable pour changer de type, unwrap + supprimer, i18n FR/EN
- Outline : table des matières auto-générée depuis H1/H2/H3, design hiérarchique (disque/cercle/point), cliquable pour naviguer, i18n FR/EN
- Accessibles depuis slash menu + drag handle
- Raccourcis: Mod+Shift+C (callout), Mod+Shift+O (outline)
This commit is contained in:
Antigravity
2026-06-14 16:43:43 +00:00
parent fccad72d47
commit 2723e06b80
6 changed files with 413 additions and 2 deletions

View File

@@ -14,10 +14,12 @@ import {
Heading1, Heading2, Heading3, List, ListOrdered,
CheckSquare, Quote, CodeXml, Database,
ArrowUp, ArrowDown, AlignLeft, ClipboardCopy, Sparkles,
ChevronsRightLeft,
ChevronsRightLeft, MessageSquareWarning, ListTree,
} from 'lucide-react'
import { replaceBlockWithStructuredView } from '@/components/tiptap-structured-view-block-extension'
import { insertToggleBlock, turnIntoToggleBlock } from '@/components/tiptap-toggle-extension'
import { turnIntoCalloutBlock } from '@/components/tiptap-callout-extension'
import { insertOutlineBlock } from '@/components/tiptap-outline-extension'
interface BlockActionMenuProps {
editor: Editor
@@ -377,6 +379,18 @@ export function BlockActionMenu({
<span>{t('richTextEditor.blockActionInsertToggle')}</span>
</button>
{/* Encadré */}
<button type="button" className="block-action-item" onClick={() => { turnIntoCalloutBlock(editor, blockPos, blockNode, 'info'); onClose() }}>
<MessageSquareWarning size={16} />
<span>{t('richTextEditor.blockActionInsertCallout')}</span>
</button>
{/* Sommaire */}
<button type="button" className="block-action-item" onClick={() => { insertOutlineBlock(editor); onClose() }}>
<ListTree size={16} />
<span>{t('richTextEditor.slashOutline')}</span>
</button>
<div className="block-action-separator" />
{/* Création de diagramme */}