Skip to content

Commit

Permalink
chore: import style
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed May 4, 2024
1 parent b53b893 commit 0c0cf27
Show file tree
Hide file tree
Showing 100 changed files with 430 additions and 420 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PortalInjectKey } from 'hooks/use-portal-element'
import { PortalInjectKey } from '~/hooks/use-portal-element'
import {
NConfigProvider,
NDialogProvider,
Expand Down
4 changes: 2 additions & 2 deletions src/components/button/parallax-button.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { useStoreRef } from 'hooks/use-store-ref'
import { UIStore } from 'stores/ui'
import { useStoreRef } from '~/hooks/use-store-ref'
import { UIStore } from '~/stores/ui'
import { defineComponent, onMounted, ref } from 'vue'
import type { PropType } from 'vue'
Expand Down
6 changes: 3 additions & 3 deletions src/components/config-form/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { useStoreRef } from '~/hooks/use-store-ref'
import { get, set } from 'lodash-es'
import { marked } from 'marked'
import {
Expand All @@ -14,8 +14,8 @@ import {
NSwitch,
NText,
} from 'naive-ui'
import { UIStore } from 'stores/ui'
import { uuid } from 'utils'
import { UIStore } from '~/stores/ui'
import { uuid } from '~/utils'
import type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'

const NFormPrefixCls = 'mt-6'
Expand Down
6 changes: 3 additions & 3 deletions src/components/drawer/components/image-detail-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
NInput,
NInputNumber,
} from 'naive-ui'
import { getDominantColor } from 'utils/image'
import { isVideoExt, pickImagesFromMarkdown } from 'utils/markdown'
import type { Image as ImageModel } from 'models/base'
import { getDominantColor } from '~/utils/image'
import { isVideoExt, pickImagesFromMarkdown } from '~/utils/markdown'
import type { Image as ImageModel } from '~/models/base'
import type { PropType } from 'vue'

export const ImageDetailSection = defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion src/components/drawer/components/json-editor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useAsyncLoadMonaco } from 'hooks/use-async-monaco'
import { useAsyncLoadMonaco } from '~/hooks/use-async-monaco'
import { NButton } from 'naive-ui'
import type { PropType } from 'vue'

Expand Down
4 changes: 2 additions & 2 deletions src/components/drawer/text-base-drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isURL } from 'class-validator'
import { JSONHighlight } from 'components/json-highlight'
import { JSONHighlight } from '~/components/json-highlight'
import { isObject, isUndefined } from 'lodash-es'
import {
NButton,
Expand All @@ -20,7 +20,7 @@ import {
NSwitch,
NTooltip,
} from 'naive-ui'
import { JSONParseReturnOriginal } from 'utils/json'
import { JSONParseReturnOriginal } from '~/utils/json'
import { ImageDetailSection } from './components/image-detail-section'
import { JSONEditor } from './components/json-editor'
import type { Image } from '@mx-space/api-client'
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/codemirror/codemirror.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable vue/no-setup-props-destructure */
import { useSaveConfirm } from 'hooks/use-save-confirm'
import { useSaveConfirm } from '~/hooks/use-save-confirm'
import { defineComponent } from 'vue'
import type { EditorState } from '@codemirror/state'
import type { PropType } from 'vue'
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/codemirror/use-auto-theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { UIStore } from 'stores/ui'
import { useStoreRef } from '~/hooks/use-store-ref'
import { UIStore } from '~/stores/ui'

import { oneDark } from '@codemirror/theme-one-dark'
import { githubLight } from '@ddietr/codemirror-themes/theme/github-light'
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/monaco/use-define-theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { UIStore } from 'stores/ui'
import { useStoreRef } from '~/hooks/use-store-ref'
import { UIStore } from '~/stores/ui'

import Dark from './theme/dark.json'
import Light from './theme/light.json'
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/plain/plain.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSaveConfirm } from 'hooks/use-save-confirm'
import { useSaveConfirm } from '~/hooks/use-save-confirm'
import { NInput } from 'naive-ui'
import { defineComponent, ref, toRaw, watch } from 'vue'

Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/universal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
*/

import { SettingsIcon } from 'components/icons'
import { useLayout } from 'layouts/content'
import { SettingsIcon } from '~/components/icons'
import { useLayout } from '~/layouts/content'
import { NCard, NElement, NForm, NModal } from 'naive-ui'
import { defineComponent, ref } from 'vue'

Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/universal/reset-icon-button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RefreshCircle } from 'components/icons'
import { RefreshCircle } from '~/components/icons'
import { NButton, NPopover } from 'naive-ui'

import { Icon } from '@vicons/utils'
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/universal/use-editor-setting.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useStorageObject } from 'hooks/use-storage'
import { useStorageObject } from '~/hooks/use-storage'
import { NFormItem, NH5, NInput, NInputNumber, NSwitch } from 'naive-ui'

import { GeneralSettingDto } from './editor-config'
Expand Down
4 changes: 2 additions & 2 deletions src/components/function-editor/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useAsyncLoadMonaco } from 'hooks/use-async-monaco'
import { RESTManager } from 'utils'
import { useAsyncLoadMonaco } from '~/hooks/use-async-monaco'
import { RESTManager } from '~/utils'

import * as typeDefines from './libs/lib.declare'
import { NodeDeclare } from './libs/node.declare'
Expand Down
2 changes: 1 addition & 1 deletion src/components/function-editor/libs/node/constants.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
declare module 'constants' {
declare module '~/constants' {
import { constants as osConstants, SignalConstants } from 'os'
import { constants as cryptoConstants } from 'crypto'
import { constants as fsConstants } from 'fs'
Expand Down
2 changes: 1 addition & 1 deletion src/components/ip-info/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NPopover } from 'naive-ui'
import { RESTManager } from 'utils'
import { RESTManager } from '~/utils'
import { defineComponent, ref } from 'vue'
import type { PopoverTrigger } from 'naive-ui'
import type { PropType } from 'vue'
Expand Down
12 changes: 6 additions & 6 deletions src/components/link/title-link.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { WEB_URL } from 'node:constants/env'
import { ExternalLinkIcon, OpenAIIcon } from 'components/icons'
import { IframePreviewButton } from 'components/special-button/iframe-preview'
import { useStoreRef } from 'hooks/use-store-ref'
import { WEB_URL } from '~/constants/env'
import { ExternalLinkIcon, OpenAIIcon } from '~/components/icons'
import { IframePreviewButton } from '~/components/special-button/iframe-preview'
import { useStoreRef } from '~/hooks/use-store-ref'
import { NButton, NEllipsis, NPopover } from 'naive-ui'
import { UIStore } from 'stores/ui'
import { buildMarkdownRenderUrl } from 'utils/endpoint'
import { UIStore } from '~/stores/ui'
import { buildMarkdownRenderUrl } from '~/utils/endpoint'
import { defineComponent } from 'vue'
import { RouterLink, useRouter } from 'vue-router'

Expand Down
6 changes: 3 additions & 3 deletions src/components/location/get-location-button.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { LocationIcon } from 'components/icons'
import { LocationIcon } from '~/components/icons'
import { NButton, useMessage } from 'naive-ui'
import { RESTManager } from 'utils/rest'
import { RESTManager } from '~/utils/rest'
import { defineComponent, ref } from 'vue'
import { Icon } from '@vicons/utils'
import type { Amap, Regeocode } from 'models/amap'
import type { Amap, Regeocode } from '~/models/amap'
import type { PropType } from 'vue'

export const GetLocationButton = defineComponent({
Expand Down
6 changes: 3 additions & 3 deletions src/components/location/search-button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SearchIcon } from 'components/icons'
import { SearchIcon } from '~/components/icons'
import { debounce } from 'lodash-es'
import {
NAutoComplete,
Expand All @@ -9,10 +9,10 @@ import {
NModal,
NSpace,
} from 'naive-ui'
import { RESTManager } from 'utils/rest'
import { RESTManager } from '~/utils/rest'
import { defineComponent, ref, watch } from 'vue'
import { Icon } from '@vicons/utils'
import type { AMapSearch } from 'models/amap'
import type { AMapSearch } from '~/models/amap'
import type { AutoCompleteOption } from 'naive-ui/lib/auto-complete/src/interface'
import type { PropType } from 'vue'

Expand Down
2 changes: 1 addition & 1 deletion src/components/output-modal/normal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { AnsiUp } from 'ansi_up'
import { EventSourcePolyfill } from 'event-source-polyfill'
import { NCard, NModal } from 'naive-ui'
import { getToken } from 'utils'
import { getToken } from '~/utils'

const ansi_up = new AnsiUp()
export const ShellOutputNormal = defineComponent({
Expand Down
4 changes: 2 additions & 2 deletions src/components/output-modal/xterm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// 展示 Shell 输出的 xterm
import { Xterm } from 'components/xterm'
import { Xterm } from '~/components/xterm'
import { EventSourcePolyfill } from 'event-source-polyfill'
import { NCard, NModal, NSpin } from 'naive-ui'
import { getToken } from 'utils'
import { getToken } from '~/utils'
import type { Terminal } from '@xterm/xterm'

export const ShellOutputXterm = defineComponent({
Expand Down
4 changes: 2 additions & 2 deletions src/components/shorthand/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NButton, NInput, NSpace, useDialog } from 'naive-ui'
import { RESTManager } from 'utils'
import { RESTManager } from '~/utils'
import { ref } from 'vue'
import type { RecentlyModel } from 'models/recently'
import type { RecentlyModel } from '~/models/recently'

export const useShorthand = () => {
const modal = useDialog()
Expand Down
12 changes: 6 additions & 6 deletions src/components/sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { WEB_URL } from 'node:constants/env'
import { WEB_URL } from '~/constants/env'
import {
LogoutIcon,
MoonIcon,
SidebarCloseIcon,
SunIcon,
} from 'components/icons'
} from '~/components/icons'
import { NIcon, NLayoutContent } from 'naive-ui'
import { RouteName } from 'router/name'
import { AppStore } from 'stores/app'
import { UIStore } from 'stores/ui'
import { RESTManager } from 'utils'
import { RouteName } from '~/router/name'
import { AppStore } from '~/stores/app'
import { UIStore } from '~/stores/ui'
import { RESTManager } from '~/utils'
import { computed, defineComponent, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'

Expand Down
4 changes: 2 additions & 2 deletions src/components/special-button/delete-confirm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HeaderActionButton } from 'components/button/rounded-button'
import { DeleteIcon } from 'components/icons'
import { HeaderActionButton } from '~/components/button/rounded-button'
import { DeleteIcon } from '~/components/icons'
import { useDialog, useMessage } from 'naive-ui'
import type { PropType, Ref } from 'vue'

Expand Down
8 changes: 4 additions & 4 deletions src/components/special-button/fetch-github-repo.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HeaderActionButton } from 'components/button/rounded-button'
import { GithubIcon } from 'components/icons'
import { getRepoDetail, getRepoReadme } from 'external/api/github-repo'
import { HeaderActionButton } from '~/components/button/rounded-button'
import { GithubIcon } from '~/components/icons'
import { getRepoDetail, getRepoReadme } from '~/external/api/github-repo'
import { NButton, NInput, useDialog } from 'naive-ui'
import type { IGithubRepo } from 'external/api/github-repo'
import type { IGithubRepo } from '~/external/api/github-repo'
import type { PropType } from 'vue'

export const FetchGithubRepoButton = defineComponent({
Expand Down
4 changes: 2 additions & 2 deletions src/components/special-button/iframe-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MagnifyIcon } from 'components/icons'
import { ArticlePreview } from 'components/preview'
import { MagnifyIcon } from '~/components/icons'
import { ArticlePreview } from '~/components/preview'
import { NButton, NPopover } from 'naive-ui'

import { Icon } from '@vicons/utils'
Expand Down
6 changes: 3 additions & 3 deletions src/components/special-button/parse-content.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HeaderActionButton } from 'components/button/rounded-button'
import { PlainEditor } from 'components/editor/plain/plain'
import { QuestionCircleIcon, SlackHashIcon } from 'components/icons'
import { HeaderActionButton } from '~/components/button/rounded-button'
import { PlainEditor } from '~/components/editor/plain/plain'
import { QuestionCircleIcon, SlackHashIcon } from '~/components/icons'
import { load } from 'js-yaml'
import {
NButton,
Expand Down
4 changes: 2 additions & 2 deletions src/components/table/edit-column.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { useStoreRef } from '~/hooks/use-store-ref'
import { NInput, NSelect, useMessage } from 'naive-ui'
import { CategoryStore } from 'stores/category'
import { CategoryStore } from '~/stores/category'
import { defineComponent, ref, watch } from 'vue'
import type { SelectMixedOption } from 'naive-ui/lib/select/src/interface'
import type { PropType } from 'vue'
Expand Down
6 changes: 3 additions & 3 deletions src/components/table/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { useStoreRef } from '~/hooks/use-store-ref'
import { NDataTable } from 'naive-ui'
import { UIStore } from 'stores/ui'
import { UIStore } from '~/stores/ui'
import { defineComponent, reactive, ref, watch } from 'vue'
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
import styles from './index.module.css'
import type { Pager } from 'models/base'
import type { Pager } from '~/models/base'
import type dataTableProps from 'naive-ui/lib/data-table/src/DataTable'
import type {
RowKey,
Expand Down
2 changes: 1 addition & 1 deletion src/components/time/relative-time.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NPopover } from 'naive-ui'
import { parseDate, relativeTimeFromNow } from 'utils/time'
import { parseDate, relativeTimeFromNow } from '~/utils/time'
import { defineComponent, onBeforeUnmount, onMounted, ref } from 'vue'

const _RelativeTime = defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion src/components/upload/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NUpload } from 'naive-ui'
import { RESTManager, getToken } from 'utils'
import { RESTManager, getToken } from '~/utils'
import type { OnError, OnFinish } from 'naive-ui/es/upload/src/interface'
import type { PropType } from 'vue'

Expand Down
6 changes: 3 additions & 3 deletions src/components/xlog-connect/class.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Indexer, createContract } from 'crossbell.js'
import Unidata from 'unidata.js'
import { RESTManager } from 'utils'
import { RESTManager } from '~/utils'
import { showConfetti } from '~/utils/confetti'
import type { Contract } from 'crossbell.js'
import type { NoteModel } from 'models/note'
import type { PostModel } from 'models/post'
import type { NoteModel } from '~/models/note'
import type { PostModel } from '~/models/post'

const unidata = new Unidata()

Expand Down
2 changes: 1 addition & 1 deletion src/components/xlog-connect/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RESTManager } from 'utils'
import { RESTManager } from '~/utils'

export const CrossBellConnectorIndirector = defineComponent({
setup() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/xterm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useStoreRef } from 'hooks/use-store-ref'
import { UIStore } from 'stores/ui'
import { useStoreRef } from '~/hooks/use-store-ref'
import { UIStore } from '~/stores/ui'
import { Material, MaterialDark } from 'xterm-theme'
import { useMountAndUnmount } from '~/hooks/use-lifecycle'
import type { ITerminalOptions, Terminal } from '@xterm/xterm'
Expand Down
2 changes: 1 addition & 1 deletion src/external/api/npm.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extend } from 'umi-request'
import type { NpmPKGInfo } from 'external/types/npm-pkg'
import type { NpmPKGInfo } from '~/external/types/npm-pkg'

export const getNpmPKGLatest = async (name: string) => {
return extend({}).get<NpmPKGInfo>(`https://registry.npmjs.org/${name}/latest`)
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/use-async-monaco.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useDefineMyThemes } from 'components/editor/monaco/use-define-theme'
import { CenterSpin } from 'components/spin'
import { useDefineMyThemes } from '~/components/editor/monaco/use-define-theme'
import { CenterSpin } from '~/components/spin'
import { AutoTypings, LocalStorageCache } from 'monaco-editor-auto-typings'
import { UIStore } from 'stores/ui'
import { UIStore } from '~/stores/ui'
import { useSaveConfirm } from './use-save-confirm'
import { useStoreRef } from './use-store-ref'
import type { IKeyboardEvent, editor } from 'monaco-editor'
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-table.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import qs from 'qs'
import { reactive, ref } from 'vue'
import type { Pager } from 'models/base'
import type { Pager } from '~/models/base'
import type { Ref } from 'vue'
import type { LocationQueryValue } from 'vue-router'

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/setup-view.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { bgUrl } from 'node:constants/env'
import { bgUrl } from '~/constants/env'
export default defineComponent({
setup() {
Expand Down
8 changes: 4 additions & 4 deletions src/layouts/sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { GATEWAY_URL } from 'node:constants/env'
import { KBarWrapper } from 'components/k-bar'
import $RouterView from 'layouts/router-view'
import { GATEWAY_URL } from '~/constants/env'
import { KBarWrapper } from '~/components/k-bar'
import $RouterView from '~/layouts/router-view'
import { NLayoutContent } from 'naive-ui'
import { RESTManager } from 'utils'
import { RESTManager } from '~/utils'
import { computed, defineComponent, watchEffect } from 'vue'
import { RouterLink } from 'vue-router'

Expand Down
Loading

0 comments on commit 0c0cf27

Please sign in to comment.