onDragOverBlock?.(e, index)}
onDrop={() => onDropBlock?.(index)}
>
{/* Indentation Guide Line */}
{visualLevel > 0 &&
Array.from({ length: visualLevel }).map((_, lvlIdx) => (
))}
{/* Bullet Controls: Collapse Toggle & Bullet (Drag-Handle & Zoom) / Checkbox */}
{hasChildren ? (
) : (
)}
{block.type === 'todo' ? (
) : (
)}
{/* Main Block Content */}
{block.type === 'divider' ? (
) : block.type === 'code' ? (
Code
) : block.type === 'callout' ? (
) : (
)}
{/* Rich Tokens Bar (Wiki-Links & #Tags) if present */}
{hasSpecialTokens && !isFocused && (
{tokens.map((part, idx) => {
if (part.startsWith('#') && part.length > 1) {
const tag = part.slice(1);
return (
);
}
if (part.startsWith('[[') && part.endsWith(']]')) {
const page = part.slice(2, -2).trim();
return (
);
}
const mdMatch = part.match(/^\[(.*?)\]\((https?:\/\/.*?)\)$/);
if (mdMatch) {
const label = mdMatch[1];
const url = mdMatch[2];
return (
{label || url}
);
}
if (/^https?:\/\//.test(part)) {
return (
{part}
);
}
return null;
})}
)}
{/* Floating Slash Commands Menu */}
{slashSearch !== null && canEdit && (
Befehl auswählen
{filteredSlashCommands.map((cmd, i) => (
))}
{filteredSlashCommands.length === 0 && (
Kein Befehl gefunden
)}
)}
{/* Zoom / Focus button on hover */}
{/* Delete button on hover */}
{canEdit && (
)}
{/* Link Insertion Modal */}
{showLinkModal && (
setShowLinkModal(false)}
onInsertLink={handleInsertLink}
/>
)}
);
};