refactor(command): use dialog (#352)

This commit is contained in:
QiroNT 2022-12-10 05:18:21 +08:00 committed by GitHub
parent f249087a95
commit 462e85dad0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 110 additions and 131 deletions

View file

@ -8,6 +8,8 @@ export const mediaPreviewIndex = ref(0)
export const statusEdit = ref<StatusEdit>()
export const dialogDraftKey = ref<string>()
export const commandPanelInput = ref('')
export const isFirstVisit = useLocalStorage(STORAGE_KEY_FIRST_VISIT, !process.mock)
export const isZenMode = useLocalStorage(STORAGE_KEY_ZEN_MODE, false)
@ -16,6 +18,7 @@ export const isPublishDialogOpen = ref(false)
export const isMediaPreviewOpen = ref(false)
export const isEditHistoryDialogOpen = ref(false)
export const isPreviewHelpOpen = ref(isFirstVisit.value)
export const isCommandPanelOpen = ref(false)
export const toggleZenMode = useToggle(isZenMode)
@ -72,3 +75,12 @@ export function openPreviewHelp() {
export function closePreviewHelp() {
isPreviewHelpOpen.value = false
}
export function openCommandPanel(isCommandMode = false) {
commandPanelInput.value = isCommandMode ? '>' : ''
isCommandPanelOpen.value = true
}
export function closeCommandPanel() {
isCommandPanelOpen.value = false
}