diff --git a/app.vue b/app.vue index d8319048..d2ba216a 100644 --- a/app.vue +++ b/app.vue @@ -1,6 +1,7 @@ - - - - + + + + - - - - + {{ scope.display }} + / + + + - - - - - {{ scope.display }} - / - + + - + + + + + + {{ scope }} + + + + + - - - - - - - - - - {{ scope }} + + + {{ cmd.name }} + + + {{ cmd.description }} + - - - - - - - {{ cmd.name }} - - - {{ cmd.description }} - - - - - - {{ $t('command.complete') }} - - - - - - {{ $t('command.activate') }} - - - + + + {{ $t('command.complete') }} - - - - - - - - - Tip: Use - - to activate command mode. - - + + + + + {{ $t('command.activate') }} + + + + + + - + + + + + + Tip: Use + + to activate command mode. + + diff --git a/components/command/CommandRoot.vue b/components/command/CommandRoot.vue deleted file mode 100644 index 79a660b7..00000000 --- a/components/command/CommandRoot.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/components/modal/ModalContainer.vue b/components/modal/ModalContainer.vue index 24f179c4..56e3dfb2 100644 --- a/components/modal/ModalContainer.vue +++ b/components/modal/ModalContainer.vue @@ -1,11 +1,23 @@ @@ -30,4 +42,7 @@ import { + + + diff --git a/composables/command.ts b/composables/command.ts index 44cfe24b..34644ed6 100644 --- a/composables/command.ts +++ b/composables/command.ts @@ -281,7 +281,7 @@ export const provideGlobalCommands = () => { visible: () => users.value.length > 1, name: () => t('action.switch_account'), - description: t('command.switch_account_desc'), + description: () => t('command.switch_account_desc'), icon: 'i-ri:user-shared-line', onComplete: () => ({ diff --git a/composables/dialog.ts b/composables/dialog.ts index 9dbe5e82..0afd2df5 100644 --- a/composables/dialog.ts +++ b/composables/dialog.ts @@ -8,6 +8,8 @@ export const mediaPreviewIndex = ref(0) export const statusEdit = ref() export const dialogDraftKey = ref() +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 +} diff --git a/layouts/default.vue b/layouts/default.vue index 8a9b887f..0c62c1e7 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -51,6 +51,5 @@ -