라이브 인용 콜아웃 입력 보정

This commit is contained in:
2026-06-04 15:00:39 +09:00
parent 675e6bca78
commit 35b9893eab
12 changed files with 204 additions and 66 deletions

View File

@@ -13,7 +13,6 @@ import {
hasListMarker,
hasQuoteMarker,
isEmptyListMarkerLine,
isEmptyQuoteMarkerLine,
parseOrderedListMarker,
stripListMarker,
stripQuoteMarker
@@ -1291,6 +1290,21 @@ const onCalloutBlockInsertBelow = (block, payload) => {
onInsertBelowBlock(block, { lines: [''] })
}
/**
* 자식 편집기가 요청한 원본 줄에 포커스를 둔다.
* @param {{ line?: number, position?: 'start'|'end'|'auto', offset?: number|null }} payload - 포커스 요청
* @returns {void}
*/
const onEditorFocusLine = (payload) => {
if (typeof payload?.line !== 'number') {
return
}
pendingFocusLine.value = payload.line
pendingFocusPosition.value = payload.position || 'auto'
pendingFocusOffset.value = typeof payload.offset === 'number' ? payload.offset : null
}
/**
* 토글 편집 반영
* @param {Object} block - 토글 블록
@@ -1751,16 +1765,6 @@ const onQuoteLineInsertBelow = (block, lineIndex, payload) => {
nextLines[lineIndex] = formatQuoteLine(value, raw)
}
const committedLine = nextLines[lineIndex] ?? ''
if (isEmptyQuoteMarkerLine(committedLine)) {
nextLines[lineIndex] = ''
pendingFocusLine.value = block.meta.startLine + lineIndex
pendingFocusPosition.value = 'start'
commitInlineBlockLines(block, nextLines)
return
}
nextLines.splice(lineIndex + 1, 0, '> ')
pendingFocusLine.value = block.meta.startLine + lineIndex + 1
pendingFocusPosition.value = 'start'
@@ -2610,7 +2614,8 @@ onBeforeUnmount(() => {
@commit="onCalloutBlockCommit(block, $event)"
@delete-line="onDeleteLine"
@insert-below="onCalloutBlockInsertBelow(block, $event)"
@merge-with-previous="onMergeWithPreviousLine(block.meta.startLine + 1, $event)"
@merge-with-previous="onMergeWithPreviousLine"
@focus-line="onEditorFocusLine"
/>
<ProseCallout
v-else-if="block.type === 'callout'"