refactor(web): group shared components by directory

Move each shared component into a named directory with an index.vue entry. Update consumers and relative imports while preserving component behavior.
This commit is contained in:
eezd committed 2026-10-26 11:53:11 +08:00
1 parent 6ea46f99cf
commit cef0298c34
30 files changed
+42 -42

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { Captcha } from '@@/apis/auth'
import { authApi } from '@@/apis/auth'
import AppStatus from '@@/components/AppStatus.vue'
import AppStatus from '@@/components/AppStatus/index.vue'
import { isCancel } from 'axios'
import { computed, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
@@ -3,7 +3,7 @@ import type { InstalledPlugin } from '@@/apis/plugins/type'
import { pluginsApi } from '@@/apis/plugins'
import { computed, ref } from 'vue'
import { ApiError } from '@/http/axios'
import PluginMount from '../../../common/components/PluginMount.vue'
import PluginMount from '../../../common/components/PluginMount/index.vue'
import { pluginState, refreshPlugins, retryPlugin } from '../../../common/plugins/host'
import { pluginsPaused, settingTabs } from '../../../common/plugins/registry'
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { SettingId } from '../settings-catalog'
import { computed } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { SETTING_ITEMS } from '../settings-catalog'
const props = defineProps<{ id: SettingId, control?: string, resettable?: boolean }>()
@@ -2,7 +2,7 @@
import type { Command } from '../../../common/utils/commands'
import { toast } from '@@/utils/notifications'
import { computed, nextTick, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { allCommands, commandKeys, formatKeys, shortcutConflict } from '../../../common/utils/commands'
import { recordedKeys } from '../../../common/utils/keys'
import { loadSettings, settings, SettingsAppearanceError, updateSettings } from '../../../pinia/stores/settings'
@@ -5,7 +5,7 @@ import { isCancel } from 'axios'
import { onMounted, ref } from 'vue'
import { ApiError } from '@/http/axios'
import { settingsApi } from '@/pages/settings/apis'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { copyText } from '../../../common/utils/clipboard'
const tokens = ref<ApiToken[] | null>(null)
@@ -5,7 +5,7 @@ import { toast } from '@@/utils/notifications'
import { isCancel } from 'axios'
import { onMounted, ref } from 'vue'
import { useUserStore } from '@/pinia/stores/user'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { isImage } from '../../../common/utils/paths'
import { DEFAULTS, loadSettings, settings, SettingsAppearanceError, updateSettings } from '../../../pinia/stores/settings'
import SettingRow from './SettingRow.vue'
+2 -2
View File
@@ -9,8 +9,8 @@ import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue'
import { ApiError } from '@/http/axios'
import { settingsApi } from '@/pages/settings/apis'
import { UI_FONT_SIZE } from '../../common/appearance/typography'
import FontPicker from '../../common/components/FontPicker.vue'
import Icon from '../../common/components/Icon.vue'
import FontPicker from '../../common/components/FontPicker/index.vue'
import Icon from '../../common/components/Icon/index.vue'
import { runCommand } from '../../common/utils/commands'
import { installApp, installPrompt } from '../../common/utils/pwa'
import { CONTENT_WIDTHS, DEFAULTS, loadSettings, settings, SettingsAppearanceError, settingsSave, TAB_SIZES, updateSettings } from '../../pinia/stores/settings'
+1 -1
View File
@@ -1,4 +1,4 @@
import type { IconName } from '../../common/components/Icon.vue'
import type { IconName } from '../../common/components/Icon/index.vue'
import type { SettingsSection } from '@/pinia/stores/settings'
export const SETTINGS_SECTIONS: { id: SettingsSection, title: string, icon: IconName, description: string }[] = [
@@ -1,5 +1,5 @@
<script setup lang="ts">
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { runCommand } from '../../../common/utils/commands'
import { toggleSourceMode, ws } from '../workspace'
</script>
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'
import { ApiError } from '@/http/axios'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { basename, dirname, isImage, joinPath } from '../../../common/utils/paths'
import { imageUrl, move, remove, replaceImage, ws } from '../workspace'
@@ -2,7 +2,7 @@
import type { Entry } from '@@/apis/vault/type'
import { toast } from '@@/utils/notifications'
import { computed, onMounted, ref } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { basename, hiddenAssetPath, imageInFolder, isImage } from '../../../common/utils/paths'
import { metadata, refreshMetadata } from '../metadata'
import { cleanupImages, imageUrl, openReference, uploadFolderImages, ws } from '../workspace'
@@ -2,7 +2,7 @@
import type { ImportResult } from '@/pages/workspace/apis/type'
import { computed, onMounted, ref } from 'vue'
import { ApiError } from '@/http/axios'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { dirname } from '../../../common/utils/paths'
import { expanded } from '../tree'
import { importNotes } from '../workspace'
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { metadata, refreshMetadata } from '../metadata'
import { openNote, openReference, ws } from '../workspace'
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { basename, dirname, inAssetDir, joinPath, noteTitle } from '../../../common/utils/paths'
import { batchFiles } from '../batch'
import { fuzzyMatch, segments } from '../fuzzy'
@@ -3,7 +3,7 @@ import type { EditorState } from '@codemirror/state'
import { ensureSyntaxTree, syntaxTree } from '@codemirror/language'
import { EditorView } from '@codemirror/view'
import { onBeforeUnmount, onMounted, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { activeTab, editorView, onEditorUpdate, ws } from '../workspace'
// 大纲:当前笔记的标题列表,点击跳转;高亮光标所在的章节
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { availableCommands, commandKeys, formatKeys } from '../../../common/utils/commands'
import { dirname, NOTE_EXT, noteTitle } from '../../../common/utils/paths'
import { fuzzyMatch, segments } from '../fuzzy'
@@ -3,7 +3,7 @@ import type { SearchResult } from '@/pages/workspace/apis/type'
import { toast } from '@@/utils/notifications'
import { computed, onMounted, ref, watch } from 'vue'
import { workspaceApi } from '@/pages/workspace/apis'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { dirname, noteTitle } from '../../../common/utils/paths'
import { openAt, ws } from '../workspace'
@@ -3,8 +3,8 @@ import type { EditorSelection } from '@codemirror/state'
import type { InlineStyles } from '../../../common/markdown/inline-styles'
import type { FormatCommand } from '../editor/format'
import { nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import InlineAppearance from '../../../common/components/InlineAppearance.vue'
import Icon from '../../../common/components/Icon/index.vue'
import InlineAppearance from '../../../common/components/InlineAppearance/index.vue'
import { settings } from '../../../pinia/stores/settings'
import { insertLink } from '../editor/format'
import { applyInlineStyles, canFormatSelection, clearInlineStyles, selectionAppearance, toggleSelectionMark, toggleUnderline } from '../editor/inline-styles'
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import PluginMount from '../../../common/components/PluginMount.vue'
import Icon from '../../../common/components/Icon/index.vue'
import PluginMount from '../../../common/components/PluginMount/index.vue'
import { sidebarViews } from '../../../common/plugins/registry'
import { commandTitle } from '../../../common/utils/commands'
import { basename } from '../../../common/utils/paths'
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { Tab } from '../workspace'
import { nextTick, ref } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { commandTitle } from '../../../common/utils/commands'
import { noteTitle } from '../../../common/utils/paths'
import { closeTab, createNote, ws } from '../workspace'
@@ -3,7 +3,7 @@ import type { TreeIcon } from '@@/apis/vault/type'
import type { Gemoji } from 'gemoji'
import type { IconName } from '../../../common/utils/icons'
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { iconPaths } from '../../../common/utils/icons'
import { basename } from '../../../common/utils/paths'
import { treeIconTarget } from '../tree'
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { TreeNode } from '../tree'
import { computed, nextTick, ref, watch } from 'vue'
import Icon from '../../../common/components/Icon.vue'
import Icon from '../../../common/components/Icon/index.vue'
import { basename, dirname, inAssetDir, isImage, joinPath } from '../../../common/utils/paths'
import { batchFiles, exportFiles } from '../batch'
import { contextSelection, dropDirectory, expanded, selectedPaths, selectPath, treeIconTarget } from '../tree'
+2 -2
View File
@@ -1,12 +1,12 @@
<script setup lang="ts">
import AppStatus from '@@/components/AppStatus.vue'
import AppStatus from '@@/components/AppStatus/index.vue'
import { toast } from '@@/utils/notifications'
import { isCancel } from 'axios'
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { ApiError } from '@/http/axios'
import { useUserStore } from '@/pinia/stores/user'
import Icon from '../../common/components/Icon.vue'
import Icon from '../../common/components/Icon/index.vue'
import { registerCommand } from '../../common/utils/commands'
import { noteTitle } from '../../common/utils/paths'
import { settings, SettingsAppearanceError, SIDEBAR_WIDTH, updateSettings } from '../../pinia/stores/settings'