슬래시 메뉴 상태 초기화 정리

This commit is contained in:
2026-07-27 10:43:49 +09:00
parent 3cc99ebeec
commit 736f7d24ec
4 changed files with 23 additions and 18 deletions

View File

@@ -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<Array<string|{ value: string, selectionStart: number, selectionEnd: number }>>} 본문 되돌리기 스택 */
@@ -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)

View File

@@ -1,5 +1,10 @@
# 업데이트 이력
## v1.11.86
- 관리자 Markdown 에디터의 슬래시 메뉴 상태 초기화 로직을 `clearLiveSlashState`로 통합.
- 소스·라이브 슬래시 입력 종료 경로의 상태 정리 방식을 일관되게 정리.
## v1.11.85
- 관리자 Markdown 에디터의 슬래시 메뉴 선택 항목 스크롤 계산을 `markdown-slash-menu-scroll` helper로 분리.

4
package-lock.json generated
View File

@@ -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",

View File

@@ -1,6 +1,6 @@
{
"name": "sori.studio",
"version": "1.11.85",
"version": "1.11.86",
"private": true,
"type": "module",
"imports": {