feat: blocs Callout (encadrés colorés) + Outline (sommaire auto)
- 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:
@@ -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 */}
|
||||
|
||||
Reference in New Issue
Block a user