mirror of
https://github.com/elk-zone/elk.git
synced 2025-03-28 04:21:37 +03:00
refactor: remove redundant imports
This commit is contained in:
parent
0fe159c761
commit
5122a9706f
34 changed files with 1 additions and 70 deletions
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
|
|
||||||
|
|
||||||
const { account, command, context, ...props } = defineProps<{
|
const { account, command, context, ...props } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { fetchAccountByHandle } from '~/composables/cache'
|
|
||||||
|
|
||||||
type WatcherType = [acc?: mastodon.v1.Account | null, h?: string, v?: boolean]
|
type WatcherType = [acc?: mastodon.v1.Account | null, h?: string, v?: boolean]
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~~/composables/masto/relationship'
|
|
||||||
|
|
||||||
const { account } = defineProps<{
|
const { account } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||||
import type { AriaAnnounceType, AriaLive } from '~/composables/aria'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const { t, locale, locales } = useI18n()
|
const { t, locale, locales } = useI18n()
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AriaLive } from '~/composables/aria'
|
|
||||||
|
|
||||||
// tsc complaining when using $defineProps
|
// tsc complaining when using $defineProps
|
||||||
withDefaults(defineProps<{
|
withDefaults(defineProps<{
|
||||||
title: string
|
title: string
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AriaLive } from '~/composables/aria'
|
|
||||||
|
|
||||||
// tsc complaining when using $defineProps
|
// tsc complaining when using $defineProps
|
||||||
withDefaults(defineProps<{
|
withDefaults(defineProps<{
|
||||||
ariaLive?: AriaLive
|
ariaLive?: AriaLive
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { ResolvedCommand } from '~/composables/command'
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
cmd,
|
cmd,
|
||||||
index,
|
index,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
|
type SearchResultType = SearchResult
|
||||||
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'close'): void
|
(event: 'close'): void
|
||||||
|
|
|
@ -1,19 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import type { ConfirmDialogChoice } from '~/types'
|
import type { ConfirmDialogChoice } from '~/types'
|
||||||
import {
|
|
||||||
isCommandPanelOpen,
|
|
||||||
isConfirmDialogOpen,
|
|
||||||
isEditHistoryDialogOpen,
|
|
||||||
isErrorDialogOpen,
|
|
||||||
isFavouritedBoostedByDialogOpen,
|
|
||||||
isKeyboardShortcutsDialogOpen,
|
|
||||||
isMediaPreviewOpen,
|
|
||||||
isPreviewHelpOpen,
|
|
||||||
isPublishDialogOpen,
|
|
||||||
isReportDialogOpen,
|
|
||||||
isSigninDialogOpen,
|
|
||||||
} from '~/composables/dialog'
|
|
||||||
|
|
||||||
const isMac = useIsMac()
|
const isMac = useIsMac()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
import type { NavButtonName } from '../../composables/settings'
|
|
||||||
|
|
||||||
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { toggleBlockAccount, toggleFollowAccount, toggleMuteAccount, useRelationship } from '~~/composables/masto/relationship'
|
|
||||||
|
|
||||||
const { account, status } = defineProps<{
|
const { account, status } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SearchResult } from '~/composables/masto/search'
|
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
result: SearchResult
|
result: SearchResult
|
||||||
active: boolean
|
active: boolean
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NavButtonName } from '~/composables/settings'
|
|
||||||
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
||||||
|
|
||||||
interface NavButton {
|
interface NavButton {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ColorMode } from '~/composables/settings'
|
|
||||||
|
|
||||||
const colorMode = useColorMode()
|
const colorMode = useColorMode()
|
||||||
|
|
||||||
function setColorMode(mode: ColorMode) {
|
function setColorMode(mode: ColorMode) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DEFAULT_FONT_SIZE } from '~/constants'
|
import { DEFAULT_FONT_SIZE } from '~/constants'
|
||||||
import type { FontSize } from '~/composables/settings'
|
|
||||||
|
|
||||||
const userSettings = useUserSettings()
|
const userSettings = useUserSettings()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ThemeColors } from '~/composables/settings'
|
|
||||||
|
|
||||||
const themes = await import('~/constants/themes.json').then(r => r.default) as [string, ThemeColors][]
|
const themes = await import('~/constants/themes.json').then(r => r.default) as [string, ThemeColors][]
|
||||||
const settings = useUserSettings()
|
const settings = useUserSettings()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { toggleBlockAccount, toggleMuteAccount, useRelationship } from '~~/composables/masto/relationship'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
status: mastodon.v1.Status
|
status: mastodon.v1.Status
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { favouritedBoostedByStatusId } from '~/composables/dialog'
|
|
||||||
|
|
||||||
const type = ref<'favourited-by' | 'boosted-by'>('favourited-by')
|
const type = ref<'favourited-by' | 'boosted-by'>('favourited-by')
|
||||||
|
|
||||||
const { client } = useMasto()
|
const { client } = useMasto()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { fetchAccountById } from '~/composables/cache'
|
|
||||||
|
|
||||||
type WatcherType = [status?: mastodon.v1.Status, v?: boolean]
|
type WatcherType = [status?: mastodon.v1.Status, v?: boolean]
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
|
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
|
||||||
import type { CustomEmoji, Emoji } from '~/composables/tiptap/suggestion'
|
|
||||||
import { isCustomEmoji } from '~/composables/tiptap/suggestion'
|
|
||||||
import { emojiFilename, emojiPrefix, emojiRegEx } from '~~/config/emojis'
|
import { emojiFilename, emojiPrefix, emojiRegEx } from '~~/config/emojis'
|
||||||
import type { CommandHandler } from '~/composables/command'
|
|
||||||
|
|
||||||
const { items, command } = defineProps<{
|
const { items, command } = defineProps<{
|
||||||
items: (CustomEmoji | Emoji)[]
|
items: (CustomEmoji | Emoji)[]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import type { CommandHandler } from '~/composables/command'
|
|
||||||
|
|
||||||
const { items, command } = defineProps<{
|
const { items, command } = defineProps<{
|
||||||
items: mastodon.v1.Tag[]
|
items: mastodon.v1.Tag[]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import type { CommandHandler } from '~/composables/command'
|
|
||||||
|
|
||||||
const { items, command } = defineProps<{
|
const { items, command } = defineProps<{
|
||||||
items: mastodon.v1.Account[]
|
items: mastodon.v1.Account[]
|
||||||
|
|
|
@ -2,7 +2,6 @@ import type { ComputedRef } from 'vue'
|
||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import Fuse from 'fuse.js'
|
import Fuse from 'fuse.js'
|
||||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||||
import type { SearchResult } from '~/composables/masto/search'
|
|
||||||
|
|
||||||
// @unocss-include
|
// @unocss-include
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import type {
|
|
||||||
CreatePushNotification,
|
|
||||||
PushManagerSubscriptionInfo,
|
|
||||||
RequiredUserLogin,
|
|
||||||
} from '~/composables/push-notifications/types'
|
|
||||||
import { PushSubscriptionError } from '~/composables/push-notifications/types'
|
|
||||||
|
|
||||||
export async function createPushSubscription(
|
export async function createPushSubscription(
|
||||||
user: RequiredUserLogin,
|
user: RequiredUserLogin,
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
import type {
|
|
||||||
CreatePushNotification,
|
|
||||||
PushNotificationPolicy,
|
|
||||||
PushNotificationRequest,
|
|
||||||
SubscriptionResult,
|
|
||||||
} from '~/composables/push-notifications/types'
|
|
||||||
import { STORAGE_KEY_NOTIFICATION, STORAGE_KEY_NOTIFICATION_POLICY } from '~/constants'
|
import { STORAGE_KEY_NOTIFICATION, STORAGE_KEY_NOTIFICATION_POLICY } from '~/constants'
|
||||||
|
|
||||||
const supportsPushNotifications = typeof window !== 'undefined'
|
const supportsPushNotifications = typeof window !== 'undefined'
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { PluginKey } from 'prosemirror-state'
|
||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
|
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
|
|
||||||
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
||||||
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
||||||
import TiptapEmojiList from '~/components/tiptap/TiptapEmojiList.vue'
|
import TiptapEmojiList from '~/components/tiptap/TiptapEmojiList.vue'
|
||||||
|
|
|
@ -14,8 +14,6 @@ import {
|
||||||
STORAGE_KEY_SERVERS,
|
STORAGE_KEY_SERVERS,
|
||||||
STORAGE_KEY_USERS,
|
STORAGE_KEY_USERS,
|
||||||
} from '~/constants'
|
} from '~/constants'
|
||||||
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
|
|
||||||
import { useAsyncIDBKeyval } from '~/composables/idb'
|
|
||||||
|
|
||||||
const mock = process.mock
|
const mock = process.mock
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { usePreferences } from '~/composables/settings'
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const info = useBuildInfo()
|
const info = useBuildInfo()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
import type { RouteLocationRaw } from 'vue-router'
|
import type { RouteLocationRaw } from 'vue-router'
|
||||||
import { useMagicSequence } from '~/composables/magickeys'
|
|
||||||
import { currentUser, getInstanceDomain } from '~/composables/users'
|
|
||||||
|
|
||||||
export default defineNuxtPlugin(({ $scrollToTop }) => {
|
export default defineNuxtPlugin(({ $scrollToTop }) => {
|
||||||
const keys = useMagicKeys()
|
const keys = useMagicKeys()
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import type { OldFontSize } from '~/composables/settings'
|
|
||||||
import { oldFontSizeMap } from '~/constants/options'
|
import { oldFontSizeMap } from '~/constants/options'
|
||||||
import { DEFAULT_FONT_SIZE } from '~/constants'
|
import { DEFAULT_FONT_SIZE } from '~/constants'
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Buffer } from 'node:buffer'
|
||||||
import { join, resolve } from 'pathe'
|
import { join, resolve } from 'pathe'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import { ofetch } from 'ofetch'
|
import { ofetch } from 'ofetch'
|
||||||
import { elkTeamMembers } from '../composables/about'
|
|
||||||
|
|
||||||
const avatarsDir = resolve('./public/avatars/')
|
const avatarsDir = resolve('./public/avatars/')
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import chroma from 'chroma-js'
|
import chroma from 'chroma-js'
|
||||||
import type { ThemeColors } from '~/composables/settings'
|
|
||||||
|
|
||||||
// #cc7d24 -> hcl(67.14,62.19,59.56)
|
// #cc7d24 -> hcl(67.14,62.19,59.56)
|
||||||
export const themesColor = Array.from(
|
export const themesColor = Array.from(
|
||||||
|
|
|
@ -3,8 +3,6 @@ import { renderToString } from 'vue/server-renderer'
|
||||||
import { format } from 'prettier'
|
import { format } from 'prettier'
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
import { mockComponent } from '@nuxt/test-utils/runtime'
|
import { mockComponent } from '@nuxt/test-utils/runtime'
|
||||||
import { contentToVNode } from '~/composables/content-render'
|
|
||||||
import type { ContentParseOptions } from '~/composables/content-parse'
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
publicServer.value = useRuntimeConfig().public.defaultServer
|
publicServer.value = useRuntimeConfig().public.defaultServer
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import { format } from 'prettier'
|
import { format } from 'prettier'
|
||||||
import { render as renderTree } from 'ultrahtml'
|
import { render as renderTree } from 'ultrahtml'
|
||||||
import type { ContentParseOptions } from '~/composables/content-parse'
|
|
||||||
|
|
||||||
describe('html-parse', () => {
|
describe('html-parse', () => {
|
||||||
it('empty', async () => {
|
it('empty', async () => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue