mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-14 21:09:58 +00:00
chore(deps): update dependency @antfu/eslint-config to v3 (#2984)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
This commit is contained in:
parent
97826c00bc
commit
320ddc0e28
65 changed files with 359 additions and 523 deletions
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
|
||||
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
|
||||
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'close'): void
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
import type { FileWithHandle } from 'browser-fs-access'
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
/** The image src before change */
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts" generic="T, O, U = T">
|
||||
import type { mastodon } from 'masto'
|
||||
// @ts-expect-error missing types
|
||||
import { DynamicScroller } from 'vue-virtual-scroller'
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const {
|
||||
paginator,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
import type { ConfirmDialogChoice } from '~/types'
|
||||
import {
|
||||
isCommandPanelOpen,
|
||||
isConfirmDialogOpen,
|
||||
|
@ -14,6 +13,7 @@ import {
|
|||
isReportDialogOpen,
|
||||
isSigninDialogOpen,
|
||||
} from '~/composables/dialog'
|
||||
import type { ConfirmDialogChoice } from '~/types'
|
||||
|
||||
const isMac = useIsMac()
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import type { Vector2 } from '@vueuse/gesture'
|
||||
import type { mastodon } from 'masto'
|
||||
import { useGesture } from '@vueuse/gesture'
|
||||
import { useReducedMotion } from '@vueuse/motion'
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const { media = [] } = defineProps<{
|
||||
media?: mastodon.v1.MediaAttachment[]
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
import type { Component } from 'vue'
|
||||
import type { NavButtonName } from '../../composables/settings'
|
||||
|
||||
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
||||
|
||||
import { NavButtonExplore, NavButtonFederated, NavButtonHome, NavButtonLocal, NavButtonMention, NavButtonMoreMenu, NavButtonNotification, NavButtonSearch } from '#components'
|
||||
|
||||
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
||||
|
||||
interface NavButton {
|
||||
name: string
|
||||
component: Component
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
// @ts-expect-error missing types
|
||||
import { DynamicScrollerItem } from 'vue-virtual-scroller'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { GroupedAccountLike, NotificationSlot } from '~/types'
|
||||
|
||||
const { paginator, stream } = defineProps<{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import importEmojiLang from 'virtual:emoji-mart-lang-importer'
|
||||
import type { Picker } from 'emoji-mart'
|
||||
import importEmojiLang from 'virtual:emoji-mart-lang-importer'
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'select', code: string): void
|
||||
|
|
|
@ -16,14 +16,13 @@ const fuse = new Fuse(languagesNameList, {
|
|||
const languages = computed(() =>
|
||||
languageKeyword.value.trim()
|
||||
? fuse.search(languageKeyword.value).map(r => r.item)
|
||||
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code))
|
||||
.sort(({ code: a }, { code: b }) => {
|
||||
// Put English on the top
|
||||
if (a === 'en')
|
||||
return -1
|
||||
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code)).sort(({ code: a }, { code: b }) => {
|
||||
// Put English on the top
|
||||
if (a === 'en')
|
||||
return -1
|
||||
|
||||
return a === modelValue.value ? -1 : b === modelValue.value ? 1 : a.localeCompare(b)
|
||||
}),
|
||||
return a === modelValue.value ? -1 : b === modelValue.value ? 1 : a.localeCompare(b)
|
||||
}),
|
||||
)
|
||||
|
||||
const preferredLanguages = computed(() => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
import { EditorContent } from '@tiptap/vue-3'
|
||||
import stringLength from 'string-length'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { DraftItem } from '~/types'
|
||||
|
||||
const {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { DEFAULT_FONT_SIZE } from '~/constants'
|
||||
import type { FontSize } from '~/composables/settings'
|
||||
import { DEFAULT_FONT_SIZE } from '~/constants'
|
||||
|
||||
const userSettings = useUserSettings()
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ useCommand({
|
|||
scope: 'Settings',
|
||||
|
||||
name: () => props.text
|
||||
?? (props.to
|
||||
? typeof props.to === 'string'
|
||||
? props.to
|
||||
: props.to.name
|
||||
: ''
|
||||
),
|
||||
?? (props.to
|
||||
? typeof props.to === 'string'
|
||||
? props.to
|
||||
: props.to.name
|
||||
: ''
|
||||
),
|
||||
description: () => props.description,
|
||||
icon: () => props.icon || '',
|
||||
visible: () => props.command && props.to,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import type { ComputedRef } from 'vue'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { ComputedRef } from 'vue'
|
||||
|
||||
const userSettings = useUserSettings()
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { clamp } from '@vueuse/core'
|
||||
import type { mastodon } from 'masto'
|
||||
import { clamp } from '@vueuse/core'
|
||||
import { decode } from 'blurhash'
|
||||
|
||||
const {
|
||||
|
|
|
@ -12,7 +12,7 @@ const expandSpoilers = computed(() => {
|
|||
|
||||
return !props.filter // always prevent expansion if filtered
|
||||
&& ((props.sensitiveNonSpoiler && expandMedia)
|
||||
|| (!props.sensitiveNonSpoiler && expandCW))
|
||||
|| (!props.sensitiveNonSpoiler && expandCW))
|
||||
})
|
||||
|
||||
const hideContent = props.enabled || props.sensitiveNonSpoiler
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
// @ts-expect-error missing types
|
||||
import { DynamicScrollerItem } from 'vue-virtual-scroller'
|
||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const { paginator, stream, account, buffer = 10, endMessage = true } = defineProps<{
|
||||
paginator: mastodon.Paginator<mastodon.v1.Status[], mastodon.rest.v1.ListAccountStatusesParams>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { NodeViewContent, NodeViewWrapper, nodeViewProps } from '@tiptap/vue-3'
|
||||
import { NodeViewContent, nodeViewProps, NodeViewWrapper } from '@tiptap/vue-3'
|
||||
|
||||
const props = defineProps(nodeViewProps)
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
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 type { CommandHandler } from '~/composables/command'
|
||||
import type { CustomEmoji, Emoji } from '~/composables/tiptap/suggestion'
|
||||
import { isCustomEmoji } from '~/composables/tiptap/suggestion'
|
||||
|
||||
const { items, command } = defineProps<{
|
||||
items: (CustomEmoji | Emoji)[]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { LRUCache } from 'lru-cache'
|
||||
import type { mastodon } from 'masto'
|
||||
import { LRUCache } from 'lru-cache'
|
||||
|
||||
const cache = new LRUCache<string, any>({
|
||||
max: 1000,
|
||||
|
@ -25,11 +25,10 @@ export function fetchStatus(id: string, force = false): Promise<mastodon.v1.Stat
|
|||
if (cached && !force)
|
||||
return Promise.resolve(cached)
|
||||
|
||||
const promise = useMastoClient().v1.statuses.$select(id).fetch()
|
||||
.then((status) => {
|
||||
cacheStatus(status)
|
||||
return status
|
||||
})
|
||||
const promise = useMastoClient().v1.statuses.$select(id).fetch().then((status) => {
|
||||
cacheStatus(status)
|
||||
return status
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
@ -46,14 +45,13 @@ export function fetchAccountById(id?: string | null): Promise<mastodon.v1.Accoun
|
|||
return Promise.resolve(cached)
|
||||
|
||||
const domain = getInstanceDomainFromServer(server)
|
||||
const promise = useMastoClient().v1.accounts.$select(id).fetch()
|
||||
.then((r) => {
|
||||
if (r.acct && !r.acct.includes('@') && domain)
|
||||
r.acct = `${r.acct}@${domain}`
|
||||
const promise = useMastoClient().v1.accounts.$select(id).fetch().then((r) => {
|
||||
if (r.acct && !r.acct.includes('@') && domain)
|
||||
r.acct = `${r.acct}@${domain}`
|
||||
|
||||
cacheAccount(r, server, true)
|
||||
return r
|
||||
})
|
||||
cacheAccount(r, server, true)
|
||||
return r
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
@ -101,11 +99,10 @@ export function fetchTag(tagName: string, force = false): Promise<mastodon.v1.Ta
|
|||
if (cached && !force)
|
||||
return Promise.resolve(cached)
|
||||
|
||||
const promise = useMastoClient().v1.tags.$select(tagName).fetch()
|
||||
.then((tag) => {
|
||||
cacheTag(tag)
|
||||
return tag
|
||||
})
|
||||
const promise = useMastoClient().v1.tags.$select(tagName).fetch().then((tag) => {
|
||||
cacheTag(tag)
|
||||
return tag
|
||||
})
|
||||
cache.set(key, promise)
|
||||
return promise
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { ComputedRef } from 'vue'
|
||||
import { defineStore } from 'pinia'
|
||||
import Fuse from 'fuse.js'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { ComputedRef } from 'vue'
|
||||
import Fuse from 'fuse.js'
|
||||
import { defineStore } from 'pinia'
|
||||
import type { SearchResult } from '~/composables/masto/search'
|
||||
|
||||
// @unocss-include
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// @unimport-disable
|
||||
import type { mastodon } from 'masto'
|
||||
import type { Node } from 'ultrahtml'
|
||||
import { DOCUMENT_NODE, ELEMENT_NODE, TEXT_NODE, h, parse, render } from 'ultrahtml'
|
||||
import { findAndReplaceEmojisInText } from '@iconify/utils'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { DOCUMENT_NODE, ELEMENT_NODE, h, parse, render, TEXT_NODE } from 'ultrahtml'
|
||||
import { emojiRegEx, getEmojiAttributes } from '../config/emojis'
|
||||
|
||||
export interface ContentParseOptions {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
|
||||
import type { ElementNode, Node } from 'ultrahtml'
|
||||
import { Fragment, h, isVNode } from 'vue'
|
||||
import type { VNode } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import { decode } from 'tiny-decode'
|
||||
import type { ContentParseOptions } from './content-parse'
|
||||
import { parseMastodonHTML } from './content-parse'
|
||||
import Emoji from '~/components/emoji/Emoji.vue'
|
||||
import ContentCode from '~/components/content/ContentCode.vue'
|
||||
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { ELEMENT_NODE, TEXT_NODE } from 'ultrahtml'
|
||||
import { Fragment, h, isVNode } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
import AccountHoverWrapper from '~/components/account/AccountHoverWrapper.vue'
|
||||
import TagHoverWrapper from '~/components/account/TagHoverWrapper.vue'
|
||||
import ContentCode from '~/components/content/ContentCode.vue'
|
||||
import ContentMentionGroup from '~/components/content/ContentMentionGroup.vue'
|
||||
import Emoji from '~/components/emoji/Emoji.vue'
|
||||
import { parseMastodonHTML } from './content-parse'
|
||||
|
||||
function getTextualAstComponents(astChildren: Node[]): string {
|
||||
return astChildren
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { mastodon } from 'masto'
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
|
||||
import { STORAGE_KEY_FIRST_VISIT } from '~/constants'
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'
|
||||
|
||||
export const confirmDialogChoice = ref<ConfirmDialogChoice>()
|
||||
export const confirmDialogLabel = ref<ConfirmDialogOptions>()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { Pausable } from '@vueuse/core'
|
||||
import type { mastodon } from 'masto'
|
||||
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
|
||||
import type { Ref } from 'vue'
|
||||
import type { ElkInstance } from '../users'
|
||||
import { createRestAPIClient, createStreamingAPIClient } from 'masto'
|
||||
import type { UserLogin } from '~/types'
|
||||
|
||||
export function createMasto() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { fileOpen } from 'browser-fs-access'
|
||||
import type { Ref } from 'vue'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { DraftItem } from '~~/types'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { Ref } from 'vue'
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
|
||||
export function usePublish(options: {
|
||||
draftItem: Ref<DraftItem>
|
||||
|
@ -45,16 +45,16 @@ export function usePublish(options: {
|
|||
|| failedMessages.value.length > 0
|
||||
|| (attachments.length > 0 && params.poll !== null && params.poll !== undefined)
|
||||
|| ((params.poll !== null && params.poll !== undefined)
|
||||
&& (
|
||||
(firstEmptyInputIndex !== -1
|
||||
&& firstEmptyInputIndex !== params.poll.options.length - 1
|
||||
)
|
||||
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
|
||||
|| (new Set(params.poll.options).size !== params.poll.options.length)
|
||||
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
|
||||
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
|
||||
)
|
||||
))
|
||||
&& (
|
||||
(firstEmptyInputIndex !== -1
|
||||
&& firstEmptyInputIndex !== params.poll.options.length - 1
|
||||
)
|
||||
|| params.poll.options.findLastIndex(option => option.trim().length > 0) + 1 < 2
|
||||
|| (new Set(params.poll.options).size !== params.poll.options.length)
|
||||
|| (currentInstance.value?.configuration?.polls.maxCharactersPerOption !== undefined
|
||||
&& params.poll.options.find(option => option.length > currentInstance.value!.configuration!.polls.maxCharactersPerOption) !== undefined
|
||||
)
|
||||
))
|
||||
})
|
||||
|
||||
watch(draftItem, () => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { withoutProtocol } from 'ufo'
|
||||
import type { mastodon } from 'masto'
|
||||
import { withoutProtocol } from 'ufo'
|
||||
|
||||
export function getAccountRoute(account: mastodon.v1.Account) {
|
||||
return useRouter().resolve({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Node } from 'ultrahtml'
|
||||
import { decode } from 'tiny-decode'
|
||||
import { TEXT_NODE, parse } from 'ultrahtml'
|
||||
import { parse, TEXT_NODE } from 'ultrahtml'
|
||||
|
||||
export const maxAccountFieldCount = computed(() => isGlitchEdition.value ? 16 : 4)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { Ref } from 'vue'
|
||||
import type { LocaleObject } from '@nuxtjs/i18n'
|
||||
import type { Ref } from 'vue'
|
||||
import type { FontSize, OldFontSize, PreferencesSettings, UserSettings } from './definition'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
import { oldFontSizeMap } from '~~/constants/options'
|
||||
import { STORAGE_KEY_SETTINGS } from '~/constants'
|
||||
|
||||
export function useUserSettings() {
|
||||
const { locales } = useNuxtApp().$i18n
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import type { Editor } from '@tiptap/vue-3'
|
||||
import { Extension, useEditor } from '@tiptap/vue-3'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import Mention from '@tiptap/extension-mention'
|
||||
import HardBreak from '@tiptap/extension-hard-break'
|
||||
import Bold from '@tiptap/extension-bold'
|
||||
import Italic from '@tiptap/extension-italic'
|
||||
import Code from '@tiptap/extension-code'
|
||||
import History from '@tiptap/extension-history'
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
|
||||
import type { Ref } from 'vue'
|
||||
import { TiptapEmojiSuggestion, TiptapHashtagSuggestion, TiptapMentionSuggestion } from './tiptap/suggestion'
|
||||
import { TiptapPluginCodeBlockShiki } from './tiptap/shiki'
|
||||
import Bold from '@tiptap/extension-bold'
|
||||
import Code from '@tiptap/extension-code'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import HardBreak from '@tiptap/extension-hard-break'
|
||||
import History from '@tiptap/extension-history'
|
||||
import Italic from '@tiptap/extension-italic'
|
||||
import Mention from '@tiptap/extension-mention'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Placeholder from '@tiptap/extension-placeholder'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import { Extension, useEditor } from '@tiptap/vue-3'
|
||||
|
||||
import { Plugin } from 'prosemirror-state'
|
||||
import { TiptapPluginCustomEmoji } from './tiptap/custom-emoji'
|
||||
import { TiptapPluginEmoji } from './tiptap/emoji'
|
||||
import { TiptapPluginCodeBlockShiki } from './tiptap/shiki'
|
||||
import { TiptapEmojiSuggestion, TiptapHashtagSuggestion, TiptapMentionSuggestion } from './tiptap/suggestion'
|
||||
|
||||
export interface UseTiptapOptions {
|
||||
content: Ref<string>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
Node,
|
||||
mergeAttributes,
|
||||
Node,
|
||||
nodeInputRule,
|
||||
} from '@tiptap/core'
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { ExtendedRegExpMatchArray, InputRuleFinder, nodeInputRule } from '@tiptap/core'
|
||||
import type { NodeType } from '@tiptap/pm/model'
|
||||
import {
|
||||
InputRule,
|
||||
Node,
|
||||
callOrReturn,
|
||||
InputRule,
|
||||
mergeAttributes,
|
||||
Node,
|
||||
nodePasteRule,
|
||||
} from '@tiptap/core'
|
||||
import { emojiRegEx, getEmojiAttributes } from '~/config/emojis'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { type Parser, createParser } from 'prosemirror-highlight/shiki'
|
||||
import type { BuiltinLanguage } from 'shiki'
|
||||
import { createParser, type Parser } from 'prosemirror-highlight/shiki'
|
||||
|
||||
let parser: Parser | undefined
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ import CodeBlock from '@tiptap/extension-code-block'
|
|||
import { VueNodeViewRenderer } from '@tiptap/vue-3'
|
||||
|
||||
import { createHighlightPlugin } from 'prosemirror-highlight'
|
||||
import { shikiParser } from './shiki-parser'
|
||||
import TiptapCodeBlock from '~/components/tiptap/TiptapCodeBlock.vue'
|
||||
import { shikiParser } from './shiki-parser'
|
||||
|
||||
export const TiptapPluginCodeBlockShiki = CodeBlock.extend({
|
||||
addOptions() {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import type { GetReferenceClientRect, Instance } from 'tippy.js'
|
||||
import tippy from 'tippy.js'
|
||||
import { VueRenderer } from '@tiptap/vue-3'
|
||||
import type { SuggestionOptions } from '@tiptap/suggestion'
|
||||
import { PluginKey } from 'prosemirror-state'
|
||||
import type { Component } from 'vue'
|
||||
import type { Emoji, EmojiMartData } from '@emoji-mart/data'
|
||||
import type { SuggestionOptions } from '@tiptap/suggestion'
|
||||
import type { mastodon } from 'masto'
|
||||
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
|
||||
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
||||
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
||||
import type { GetReferenceClientRect, Instance } from 'tippy.js'
|
||||
import type { Component } from 'vue'
|
||||
import { VueRenderer } from '@tiptap/vue-3'
|
||||
import { PluginKey } from 'prosemirror-state'
|
||||
import tippy from 'tippy.js'
|
||||
import TiptapEmojiList from '~/components/tiptap/TiptapEmojiList.vue'
|
||||
import TiptapHashtagList from '~/components/tiptap/TiptapHashtagList.vue'
|
||||
import TiptapMentionList from '~/components/tiptap/TiptapMentionList.vue'
|
||||
import { currentCustomEmojis, updateCustomEmojis } from '~/composables/emojis'
|
||||
|
||||
export type { Emoji }
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import { withoutProtocol } from 'ufo'
|
||||
import type { MaybeRefOrGetter, RemovableRef } from '@vueuse/core'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { EffectScope, Ref } from 'vue'
|
||||
import type { MaybeRefOrGetter, RemovableRef } from '@vueuse/core'
|
||||
import type { ElkMasto } from './masto/masto'
|
||||
import type { UserLogin } from '~/types'
|
||||
import type { Overwrite } from '~/types/utils'
|
||||
import { withoutProtocol } from 'ufo'
|
||||
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
|
||||
import {
|
||||
DEFAULT_POST_CHARS_LIMIT,
|
||||
STORAGE_KEY_CURRENT_USER_HANDLE,
|
||||
|
@ -13,7 +12,8 @@ import {
|
|||
STORAGE_KEY_NOTIFICATION_POLICY,
|
||||
STORAGE_KEY_SERVERS,
|
||||
} from '~/constants'
|
||||
import type { PushNotificationPolicy, PushNotificationRequest } from '~/composables/push-notifications/types'
|
||||
import type { UserLogin } from '~/types'
|
||||
import type { Overwrite } from '~/types/utils'
|
||||
|
||||
const mock = process.mock
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { SchemaAugmentations } from '@unhead/schema'
|
||||
import type { ActiveHeadEntry, UseHeadInput, UseHeadOptions } from '@unhead/vue'
|
||||
import type { ComponentInternalInstance } from 'vue'
|
||||
import { onActivated, onDeactivated, ref } from 'vue'
|
||||
import type { ActiveHeadEntry, UseHeadInput, UseHeadOptions } from '@unhead/vue'
|
||||
import type { SchemaAugmentations } from '@unhead/schema'
|
||||
|
||||
export const isHydrated = ref(false)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// @unimport-disabled
|
||||
import { emojiFilename, emojiPrefix, emojiRegEx } from '@iconify-emoji/twemoji'
|
||||
import type { EmojiRegexMatch } from '@iconify/utils/lib/emoji/replace/find'
|
||||
import { getEmojiMatchesInText } from '@iconify/utils/lib/emoji/replace/find'
|
||||
// @unimport-disabled
|
||||
import { emojiFilename, emojiPrefix, emojiRegEx } from '@iconify-emoji/twemoji'
|
||||
|
||||
// Re-export everything from package
|
||||
export * from '@iconify-emoji/twemoji'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { isCI, isDevelopment } from 'std-env'
|
||||
import type { VitePWANuxtOptions } from '../modules/pwa/types'
|
||||
import { isCI, isDevelopment } from 'std-env'
|
||||
|
||||
export const pwa: VitePWANuxtOptions = {
|
||||
mode: isCI ? 'production' : 'development',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { createResolver, defineNuxtModule } from '@nuxt/kit'
|
||||
import { isCI } from 'std-env'
|
||||
import { getEnv, version } from '../config/env'
|
||||
import type { BuildInfo } from '~/types'
|
||||
import { getEnv, version } from '../config/env'
|
||||
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { ManifestOptions } from 'vite-plugin-pwa'
|
||||
import { Buffer } from 'node:buffer'
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import type { ManifestOptions } from 'vite-plugin-pwa'
|
||||
import { getEnv } from '../../config/env'
|
||||
import { currentLocales } from '../../config/i18n'
|
||||
import { THEME_COLORS } from '../../constants/index'
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import type { Buffer } from 'node:buffer'
|
||||
import type { Plugin } from 'vite'
|
||||
import type { VitePluginPWAAPI } from 'vite-plugin-pwa'
|
||||
import type { VitePWANuxtOptions } from './types'
|
||||
import { mkdir, readFile, writeFile } from 'node:fs/promises'
|
||||
import { dirname } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'
|
||||
import type { VitePluginPWAAPI } from 'vite-plugin-pwa'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import type { Plugin } from 'vite'
|
||||
import { join, resolve } from 'pathe'
|
||||
import type { VitePWANuxtOptions } from './types'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import { configurePWAOptions } from './config'
|
||||
import { type LocalizedWebManifest, createI18n, pwaLocales } from './i18n'
|
||||
import { createI18n, type LocalizedWebManifest, pwaLocales } from './i18n'
|
||||
|
||||
export * from './types'
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
||||
import type { UnwrapNestedRefs } from 'vue'
|
||||
import type { PwaInjection } from './types'
|
||||
import { useRegisterSW } from 'virtual:pwa-register/vue'
|
||||
import { STORAGE_KEY_PWA_HIDE_INSTALL } from '~/constants'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { FetchResponse } from 'ofetch'
|
||||
import {
|
||||
createApp,
|
||||
createRouter,
|
||||
defineLazyEventHandler,
|
||||
toNodeListener,
|
||||
} from 'h3'
|
||||
import type { FetchResponse } from 'ofetch'
|
||||
import { createFetch } from 'ofetch'
|
||||
import {
|
||||
createCall,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createStorage } from 'unstorage'
|
||||
import { Store } from 'tauri-plugin-store-api'
|
||||
import { createStorage } from 'unstorage'
|
||||
|
||||
const store = new Store('.servers.dat')
|
||||
const storage = createStorage()
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import type { BuildInfo } from './types'
|
||||
import { createResolver, useNuxt } from '@nuxt/kit'
|
||||
import { isCI, isDevelopment, isWindows } from 'std-env'
|
||||
import { isPreview } from './config/env'
|
||||
import { pwa } from './config/pwa'
|
||||
import type { BuildInfo } from './types'
|
||||
import { currentLocales } from './config/i18n'
|
||||
import { pwa } from './config/pwa'
|
||||
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
"ws": "^8.15.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^2.27.3",
|
||||
"@antfu/eslint-config": "^3.7.3",
|
||||
"@antfu/ni": "^0.23.0",
|
||||
"@types/chroma-js": "^2.4.4",
|
||||
"@types/file-saver": "^2.0.7",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { ComponentPublicInstance } from 'vue'
|
||||
// @ts-expect-error missing types
|
||||
import { DynamicScroller, DynamicScrollerItem } from 'vue-virtual-scroller'
|
||||
import type { ComponentPublicInstance } from 'vue'
|
||||
|
||||
definePageMeta({
|
||||
name: 'status',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { useAsyncIDBKeyval } from '~/composables/idb'
|
||||
import type { UserLogin } from '~/types'
|
||||
import { STORAGE_KEY_USERS } from '~/constants'
|
||||
import type { UserLogin } from '~/types'
|
||||
|
||||
const mock = process.mock
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import FloatingVue from 'floating-vue'
|
||||
import { defineNuxtPlugin } from '#imports'
|
||||
import FloatingVue from 'floating-vue'
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.vueApp.use(FloatingVue)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { OldFontSize } from '~/composables/settings'
|
||||
import { oldFontSizeMap } from '~/constants/options'
|
||||
import { DEFAULT_FONT_SIZE } from '~/constants'
|
||||
import { oldFontSizeMap } from '~/constants/options'
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const userSettings = useUserSettings()
|
||||
|
|
549
pnpm-lock.yaml
549
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,7 @@
|
|||
import { writeFile } from 'node:fs/promises'
|
||||
import { join, resolve } from 'pathe'
|
||||
import fs from 'fs-extra'
|
||||
import { ofetch } from 'ofetch'
|
||||
import { join, resolve } from 'pathe'
|
||||
import { elkTeamMembers } from '../composables/about'
|
||||
|
||||
const avatarsDir = resolve('./public/avatars/')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Buffer } from 'node:buffer'
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { flatten, unflatten } from 'flat'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import { flatten, unflatten } from 'flat'
|
||||
import { currentLocales } from '../config/i18n'
|
||||
|
||||
const resolver = createResolver(import.meta.url)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { PngOptions, ResizeOptions } from 'sharp'
|
||||
import { rm, writeFile } from 'node:fs/promises'
|
||||
import process from 'node:process'
|
||||
import { resolve } from 'pathe'
|
||||
import type { PngOptions, ResizeOptions } from 'sharp'
|
||||
import sharp from 'sharp'
|
||||
import ico from 'sharp-ico'
|
||||
|
||||
|
@ -103,7 +103,8 @@ async function generateTransparentIcons(icons: ResolvedIcons, svgLogo: string, f
|
|||
Math.round(size * (1 - padding)),
|
||||
Math.round(size * (1 - padding)),
|
||||
resizeOptions,
|
||||
).toBuffer(),
|
||||
)
|
||||
.toBuffer(),
|
||||
}]).toFile(filePath)
|
||||
await optimizePng(filePath, icons.png)
|
||||
}))
|
||||
|
@ -126,7 +127,8 @@ async function generateMaskableIcons(type: IconType, icons: ResolvedIcons, svgLo
|
|||
Math.round(size * (1 - padding)),
|
||||
Math.round(size * (1 - padding)),
|
||||
resizeOptions,
|
||||
).toBuffer(),
|
||||
)
|
||||
.toBuffer(),
|
||||
}]).toFile(filePath)
|
||||
await optimizePng(filePath, icons.png)
|
||||
}))
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { LocaleEntry } from '../docs/types'
|
||||
import { Buffer } from 'node:buffer'
|
||||
import { readFile, writeFile } from 'node:fs/promises'
|
||||
import { flatten } from 'flat'
|
||||
import { createResolver } from '@nuxt/kit'
|
||||
import { countryLocaleVariants, currentLocales } from '../config/i18n'
|
||||
import type { LocaleEntry } from '../docs/types'
|
||||
import { flatten } from 'flat'
|
||||
import type { ElkTranslationStatus } from '~/types/translation-status'
|
||||
import { countryLocaleVariants, currentLocales } from '../config/i18n'
|
||||
|
||||
export const localeData: [code: string, file: string[], title: string][]
|
||||
= currentLocales.map((l: any) => [l.code, l.files ? l.files : [l.file!], l.name ?? l.code])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Driver } from 'unstorage'
|
||||
import memory from 'unstorage/drivers/memory'
|
||||
import { defineDriver } from 'unstorage'
|
||||
import memory from 'unstorage/drivers/memory'
|
||||
|
||||
export interface CacheDriverOptions {
|
||||
driver: Driver
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { $fetch } from 'ofetch'
|
||||
import kv from 'unstorage/drivers/cloudflare-kv-http'
|
||||
import fs from 'unstorage/drivers/fs'
|
||||
import memory from 'unstorage/drivers/memory'
|
||||
import kv from 'unstorage/drivers/cloudflare-kv-http'
|
||||
import vercelKVDriver from 'unstorage/drivers/vercel-kv'
|
||||
|
||||
import { $fetch } from 'ofetch'
|
||||
import vercelKVDriver from 'unstorage/drivers/vercel-kv'
|
||||
|
||||
import cached from '../cache-driver'
|
||||
|
||||
|
@ -13,8 +13,8 @@ import { env } from '#build-info'
|
|||
// @ts-expect-error virtual import
|
||||
import { driver } from '#storage-config'
|
||||
|
||||
import type { AppInfo } from '~/types'
|
||||
import { APP_NAME } from '~/constants'
|
||||
import type { AppInfo } from '~/types'
|
||||
|
||||
const storage = useStorage<AppInfo>()
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
/// <reference lib="WebWorker" />
|
||||
/// <reference types="vite/client" />
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
|
||||
import { ExpirationPlugin } from 'workbox-expiration'
|
||||
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
|
||||
import { NavigationRoute, registerRoute } from 'workbox-routing'
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
|
||||
import { NetworkFirst, StaleWhileRevalidate } from 'workbox-strategies'
|
||||
import { ExpirationPlugin } from 'workbox-expiration'
|
||||
|
||||
import { onNotificationClick, onPush } from './web-push-notifications'
|
||||
import { onShareTarget } from './share-target'
|
||||
import { onNotificationClick, onPush } from './web-push-notifications'
|
||||
|
||||
declare const self: ServiceWorkerGlobalScope
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { closeDatabases, get } from '../utils/elk-idb'
|
||||
import type { MastoNotification, NotificationInfo, PushPayload, UserLogin } from './types'
|
||||
import { closeDatabases, get } from '../utils/elk-idb'
|
||||
|
||||
export async function findNotification({ access_token, notification_id/* , notification_type */ }: PushPayload): Promise<NotificationInfo | undefined> {
|
||||
const users = await get<UserLogin[]>('elk-users')
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/// <reference lib="WebWorker" />
|
||||
/// <reference types="vite/client" />
|
||||
import type { PushPayload } from '~/service-worker/types'
|
||||
import { ELK_PAGE_LIFECYCLE_FROZEN } from '../constants'
|
||||
import {
|
||||
closeDatabaseConnections,
|
||||
createNotificationOptions,
|
||||
findNotification,
|
||||
} from './notification'
|
||||
import type { PushPayload } from '~/service-worker/types'
|
||||
|
||||
declare const self: ServiceWorkerGlobalScope
|
||||
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { renderToString } from 'vue/server-renderer'
|
||||
import { format } from 'prettier'
|
||||
/* eslint perfectionist/sort-imports: "off" */
|
||||
// to prevent error when importing '@nuxt/test-utils/runtime' before 'vitest'
|
||||
// ref. #2984 chore(deps): update dependency @antfu/eslint-config to v3 by renovate[bot]
|
||||
// https://github.com/elk-zone/elk/pull/2984
|
||||
|
||||
import type { mastodon } from 'masto'
|
||||
import { format } from 'prettier'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { mockComponent } from '@nuxt/test-utils/runtime'
|
||||
import { contentToVNode } from '~/composables/content-render'
|
||||
import { renderToString } from 'vue/server-renderer'
|
||||
import type { ContentParseOptions } from '~/composables/content-parse'
|
||||
import { contentToVNode } from '~/composables/content-render'
|
||||
|
||||
beforeEach(() => {
|
||||
publicServer.value = useRuntimeConfig().public.defaultServer
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import { format } from 'prettier'
|
||||
import { render as renderTree } from 'ultrahtml'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import type { ContentParseOptions } from '~/composables/content-parse'
|
||||
|
||||
describe('html-parse', () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { RouteLocationRaw } from '#vue-router'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { MarkNonNullable, Mutable } from './utils'
|
||||
import type { RouteLocationRaw } from '#vue-router'
|
||||
|
||||
export interface AppInfo {
|
||||
id: string
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import process from 'node:process'
|
||||
import type { Variant } from 'unocss'
|
||||
import process from 'node:process'
|
||||
import { variantParentMatcher } from '@unocss/preset-mini/utils'
|
||||
|
||||
import {
|
||||
defineConfig,
|
||||
presetAttributify,
|
||||
|
@ -11,8 +13,6 @@ import {
|
|||
transformerVariantGroup,
|
||||
} from 'unocss'
|
||||
|
||||
import { variantParentMatcher } from '@unocss/preset-mini/utils'
|
||||
|
||||
export default defineConfig({
|
||||
shortcuts: [
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
type UseStore,
|
||||
del as delIdb,
|
||||
get as getIdb,
|
||||
promisifyRequest,
|
||||
set as setIdb,
|
||||
update as updateIdb,
|
||||
type UseStore,
|
||||
} from 'idb-keyval'
|
||||
|
||||
const databases: IDBOpenDBRequest[] = []
|
||||
|
|
Loading…
Reference in a new issue