feat(outliner): indent and outdent entire subtree with all children on Tab and Shift+Tab
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 1m2s

This commit is contained in:
sandrodach committed 2026-10-27 16:06:31 +01:00
1 parent 1bdd7d245d
commit aea05e868a
2 files changed
+57 -11

No files matched your search

@@ -1029,6 +1029,25 @@ export const DocumentEditor: React.FC<DocumentEditorProps> = ({
[effectiveCanEdit, isLiveEnabled, sendBlockUpdated]
);
const handleUpdateBlocks = useCallback(
(updatedBlocks: DocumentBlock[]) => {
if (!effectiveCanEdit || updatedBlocks.length === 0) return;
const map = new Map<string, DocumentBlock>();
for (const b of updatedBlocks) {
map.set(b.id, b);
}
setBlocks((prev) =>
prev.map((b) => map.get(b.id) || b)
);
if (isLiveEnabled) {
for (const b of updatedBlocks) {
sendBlockUpdated(b);
}
}
},
[effectiveCanEdit, isLiveEnabled, sendBlockUpdated]
);
const handleCreateBlock = useCallback(
(newBlock: DocumentBlock, afterBlockId?: string) => {
if (!effectiveCanEdit) return;
@@ -1531,6 +1550,7 @@ export const DocumentEditor: React.FC<DocumentEditorProps> = ({
remoteCursors={remoteCursors}
sendCursorMoved={sendCursorMoved}
onUpdateBlock={handleUpdateBlock}
onUpdateBlocks={handleUpdateBlocks}
onCreateBlock={handleCreateBlock}
onDeleteBlock={handleDeleteBlock}
onMoveBlock={handleMoveBlock}
@@ -1599,6 +1619,7 @@ export const DocumentEditor: React.FC<DocumentEditorProps> = ({
remoteCursors={remoteCursors}
sendCursorMoved={sendCursorMoved}
onUpdateBlock={handleUpdateBlock}
onUpdateBlocks={handleUpdateBlocks}
onCreateBlock={handleCreateBlock}
onDeleteBlock={handleDeleteBlock}
onMoveBlock={handleMoveBlock}