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