diff --git a/components/admin/AdminMarkdownEditor.vue b/components/admin/AdminMarkdownEditor.vue index 7eacc05..5b194dc 100644 --- a/components/admin/AdminMarkdownEditor.vue +++ b/components/admin/AdminMarkdownEditor.vue @@ -168,6 +168,16 @@ const liveSlashVisible = computed(() => liveSlashSourceLine.value !== null) const liveSlashSuppressedLineList = computed(() => [...liveSlashSuppressedLines.value]) const visibleLiveSlashCommands = computed(() => filterSlashCommands(liveSlashQuery.value)) + +/** + * 슬래시 메뉴 입력 상태를 초기화한다. + * @returns {void} + */ +const clearLiveSlashState = () => { + liveSlashSourceLine.value = null + liveSlashQuery.value = '' + liveSlashHighlightedIndex.value = 0 +} /** 되돌리기 히스토리 최대 보관 개수 */ const EDITOR_UNDO_LIMIT = 100 /** @type {import('vue').Ref>} 본문 되돌리기 스택 */ @@ -1039,9 +1049,7 @@ const syncWriteSlashState = () => { if (liveSlashSuppressedLines.value.has(line)) { if (liveSlashSourceLine.value !== null) { - liveSlashSourceLine.value = null - liveSlashQuery.value = '' - liveSlashHighlightedIndex.value = 0 + clearLiveSlashState() } return @@ -2532,9 +2540,7 @@ const onLiveSlashUpdate = (payload) => { if (liveSlashSuppressedLines.value.has(payload.sourceLine)) { if (liveSlashSourceLine.value !== null) { - liveSlashSourceLine.value = null - liveSlashQuery.value = '' - liveSlashHighlightedIndex.value = 0 + clearLiveSlashState() } return @@ -2594,9 +2600,7 @@ const onLiveSlashEnd = (payload) => { liveSlashSuppressedLines.value = next } - liveSlashSourceLine.value = null - liveSlashQuery.value = '' - liveSlashHighlightedIndex.value = 0 + clearLiveSlashState() } /** @@ -2610,9 +2614,7 @@ const cancelLiveSlashCommand = () => { liveSlashSuppressedLines.value = new Set([...liveSlashSuppressedLines.value, line]) } - liveSlashSourceLine.value = null - liveSlashQuery.value = '' - liveSlashHighlightedIndex.value = 0 + clearLiveSlashState() } /** @@ -2678,9 +2680,7 @@ const applyLiveSlashCommand = (command) => { nextSuppressed.delete(line) liveSlashSuppressedLines.value = nextSuppressed replaceLineRange(line, line, replacementLines, false) - liveSlashSourceLine.value = null - liveSlashQuery.value = '' - liveSlashHighlightedIndex.value = 0 + clearLiveSlashState() if (activeMode.value === 'write') { focusTextareaAfterSlashCommand(line, replacementLines) diff --git a/docs/update.md b/docs/update.md index ad4897a..6b990ba 100644 --- a/docs/update.md +++ b/docs/update.md @@ -1,5 +1,10 @@ # 업데이트 이력 +## v1.11.86 + +- 관리자 Markdown 에디터의 슬래시 메뉴 상태 초기화 로직을 `clearLiveSlashState`로 통합. +- 소스·라이브 슬래시 입력 종료 경로의 상태 정리 방식을 일관되게 정리. + ## v1.11.85 - 관리자 Markdown 에디터의 슬래시 메뉴 선택 항목 스크롤 계산을 `markdown-slash-menu-scroll` helper로 분리. diff --git a/package-lock.json b/package-lock.json index 1feff03..65bac5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sori.studio", - "version": "1.11.85", + "version": "1.11.86", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sori.studio", - "version": "1.11.85", + "version": "1.11.86", "hasInstallScript": true, "dependencies": { "@nuxtjs/tailwindcss": "^6.14.0", diff --git a/package.json b/package.json index 3a2a891..3d2a3d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sori.studio", - "version": "1.11.85", + "version": "1.11.86", "private": true, "type": "module", "imports": {