chore(deps): update dependency @antfu/eslint-config to ^2.19.0 (#2726)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
This commit is contained in:
parent
23f82d3296
commit
0fba07e6e5
@ -38,12 +38,14 @@ onMounted(() => {
|
|||||||
announce(t('a11y.loading_page'))
|
announce(t('a11y.loading_page'))
|
||||||
})
|
})
|
||||||
router.afterEach((to, from) => {
|
router.afterEach((to, from) => {
|
||||||
from && setTimeout(() => {
|
if (from) {
|
||||||
requestAnimationFrame(() => {
|
setTimeout(() => {
|
||||||
const title = document.title.trim().split('|')
|
requestAnimationFrame(() => {
|
||||||
announce(t('a11y.route_loaded', [title[0]]))
|
const title = document.title.trim().split('|')
|
||||||
})
|
announce(t('a11y.route_loaded', [title[0]]))
|
||||||
}, 512)
|
})
|
||||||
|
}, 512)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -20,7 +20,7 @@ const tabs = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function toValidName(option: string) {
|
function toValidName(option: string) {
|
||||||
return option.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
|
return option.toLowerCase().replace(/[^a-z0-9]/gi, '-')
|
||||||
}
|
}
|
||||||
|
|
||||||
useCommands(() => command
|
useCommands(() => command
|
||||||
|
@ -15,9 +15,10 @@ const isRemoved = ref(false)
|
|||||||
|
|
||||||
async function edit() {
|
async function edit() {
|
||||||
try {
|
try {
|
||||||
isRemoved.value
|
if (isRemoved.value)
|
||||||
? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
|
await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
|
||||||
: await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
|
else
|
||||||
|
await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
|
||||||
isRemoved.value = !isRemoved.value
|
isRemoved.value = !isRemoved.value
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
@ -32,9 +32,10 @@ async function openEmojiPicker() {
|
|||||||
picker.value = new Picker({
|
picker.value = new Picker({
|
||||||
data: () => dataPromise,
|
data: () => dataPromise,
|
||||||
onEmojiSelect({ native, src, alt, name }: any) {
|
onEmojiSelect({ native, src, alt, name }: any) {
|
||||||
native
|
if (native)
|
||||||
? emit('select', native)
|
emit('select', native)
|
||||||
: emit('selectCustom', { src, alt, 'data-emoji-id': name })
|
else
|
||||||
|
emit('selectCustom', { src, alt, 'data-emoji-id': name })
|
||||||
},
|
},
|
||||||
set: 'twitter',
|
set: 'twitter',
|
||||||
theme: colorMode,
|
theme: colorMode,
|
||||||
|
@ -85,10 +85,12 @@ function trimPollOptions() {
|
|||||||
const trimmedOptions = draft.value.params.poll!.options.slice(0, indexLastNonEmpty + 1)
|
const trimmedOptions = draft.value.params.poll!.options.slice(0, indexLastNonEmpty + 1)
|
||||||
|
|
||||||
if (currentInstance.value?.configuration
|
if (currentInstance.value?.configuration
|
||||||
&& trimmedOptions.length >= currentInstance.value?.configuration?.polls.maxOptions)
|
&& trimmedOptions.length >= currentInstance.value?.configuration?.polls.maxOptions) {
|
||||||
draft.value.params.poll!.options = trimmedOptions
|
draft.value.params.poll!.options = trimmedOptions
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
draft.value.params.poll!.options = [...trimmedOptions, '']
|
draft.value.params.poll!.options = [...trimmedOptions, '']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function editPollOptionDraft(event: Event, index: number) {
|
function editPollOptionDraft(event: Event, index: number) {
|
||||||
@ -135,10 +137,10 @@ const characterCount = computed(() => {
|
|||||||
let length = stringLength(text)
|
let length = stringLength(text)
|
||||||
|
|
||||||
// taken from https://github.com/mastodon/mastodon/blob/07f8b4d1b19f734d04e69daeb4c3421ef9767aac/app/lib/text_formatter.rb
|
// taken from https://github.com/mastodon/mastodon/blob/07f8b4d1b19f734d04e69daeb4c3421ef9767aac/app/lib/text_formatter.rb
|
||||||
const linkRegex = /(https?:\/\/(www\.)?|xmpp:)\S+/g
|
const linkRegex = /(https?:\/\/|xmpp:)\S+/g
|
||||||
|
|
||||||
// taken from https://github.com/mastodon/mastodon/blob/af578e/app/javascript/mastodon/features/compose/util/counter.js
|
// taken from https://github.com/mastodon/mastodon/blob/af578e/app/javascript/mastodon/features/compose/util/counter.js
|
||||||
const countableMentionRegex = /(^|[^/\w])@(([a-z0-9_]+)@[a-z0-9.-]+[a-z0-9]+)/ig
|
const countableMentionRegex = /(^|[^/\w])@((\w+)@[a-z0-9.-]+[a-z0-9])/gi
|
||||||
|
|
||||||
// maximum of 23 chars per link
|
// maximum of 23 chars per link
|
||||||
// https://github.com/elk-zone/elk/issues/1651
|
// https://github.com/elk-zone/elk/issues/1651
|
||||||
|
@ -83,7 +83,8 @@ useIntersectionObserver(video, (entries) => {
|
|||||||
|
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
if (entry.intersectionRatio <= 0.75) {
|
if (entry.intersectionRatio <= 0.75) {
|
||||||
ready && !video.value?.paused && video.value?.pause()
|
if (ready && !video.value?.paused)
|
||||||
|
video.value?.pause()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
video.value?.play().then(() => {
|
video.value?.play().then(() => {
|
||||||
|
@ -26,7 +26,7 @@ async function toggleFollowTag() {
|
|||||||
|
|
||||||
emit('change')
|
emit('change')
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch {
|
||||||
// eslint-disable-next-line vue/no-mutating-props
|
// eslint-disable-next-line vue/no-mutating-props
|
||||||
tag.following = previousFollowingState
|
tag.following = previousFollowingState
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ function isValidUrl(str: string) {
|
|||||||
new URL(str)
|
new URL(str)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,13 +42,16 @@ async function handleInput() {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
isValidUrl(`https://${input}`)
|
isValidUrl(`https://${input}`)
|
||||||
&& input.match(/^[a-z0-9-]+(\.[a-z0-9-]+)+(:[0-9]+)?$/i)
|
&& input.match(/^[a-z0-9-]+(\.[a-z0-9-]+)+(:\d+)?$/i)
|
||||||
// Do not hide the autocomplete if a result has an exact substring match on the input
|
// Do not hide the autocomplete if a result has an exact substring match on the input
|
||||||
&& !filteredServers.value.some(s => s.includes(input))
|
&& !filteredServers.value.some(s => s.includes(input))
|
||||||
)
|
) {
|
||||||
autocompleteShow.value = false
|
autocompleteShow.value = false
|
||||||
else
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
autocompleteShow.value = true
|
autocompleteShow.value = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toSelector(server: string) {
|
function toSelector(server: string) {
|
||||||
|
@ -19,7 +19,7 @@ export interface ContentParseOptions {
|
|||||||
inReplyToStatus?: mastodon.v1.Status
|
inReplyToStatus?: mastodon.v1.Status
|
||||||
}
|
}
|
||||||
|
|
||||||
const sanitizerBasicClasses = filterClasses(/^(h-\S*|p-\S*|u-\S*|dt-\S*|e-\S*|mention|hashtag|ellipsis|invisible)$/u)
|
const sanitizerBasicClasses = filterClasses(/^h-\S*|p-\S*|u-\S*|dt-\S*|e-\S*|mention|hashtag|ellipsis|invisible$/u)
|
||||||
const sanitizer = sanitize({
|
const sanitizer = sanitize({
|
||||||
// Allow basic elements as seen in https://github.com/mastodon/mastodon/blob/17f79082b098e05b68d6f0d38fabb3ac121879a9/lib/sanitize_ext/sanitize_config.rb
|
// Allow basic elements as seen in https://github.com/mastodon/mastodon/blob/17f79082b098e05b68d6f0d38fabb3ac121879a9/lib/sanitize_ext/sanitize_config.rb
|
||||||
br: {},
|
br: {},
|
||||||
@ -93,6 +93,7 @@ export function parseMastodonHTML(
|
|||||||
if (markdown) {
|
if (markdown) {
|
||||||
// Handle code blocks
|
// Handle code blocks
|
||||||
html = html
|
html = html
|
||||||
|
/* eslint-disable regexp/no-super-linear-backtracking, regexp/no-misleading-capturing-group */
|
||||||
.replace(/>(```|~~~)(\w*)([\s\S]+?)\1/g, (_1, _2, lang: string, raw: string) => {
|
.replace(/>(```|~~~)(\w*)([\s\S]+?)\1/g, (_1, _2, lang: string, raw: string) => {
|
||||||
const code = htmlToText(raw)
|
const code = htmlToText(raw)
|
||||||
.replace(/</g, '<')
|
.replace(/</g, '<')
|
||||||
@ -191,7 +192,7 @@ export function recursiveTreeToText(input: Node): string {
|
|||||||
return treeToText(input)
|
return treeToText(input)
|
||||||
}
|
}
|
||||||
|
|
||||||
const emojiIdNeedsWrappingRE = /^(\d|\w|-|_)+$/
|
const emojiIdNeedsWrappingRE = /^([\w\-])+$/
|
||||||
|
|
||||||
export function treeToText(input: Node): string {
|
export function treeToText(input: Node): string {
|
||||||
let pre = ''
|
let pre = ''
|
||||||
@ -417,7 +418,7 @@ function removeCustomEmoji(customEmojis: Record<string, mastodon.v1.CustomEmoji>
|
|||||||
if (node.type !== TEXT_NODE)
|
if (node.type !== TEXT_NODE)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
const split = node.value.split(/\s?:([\w-]+?):/g)
|
const split = node.value.split(/\s?:([\w-]+):/g)
|
||||||
if (split.length === 1)
|
if (split.length === 1)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
@ -439,7 +440,7 @@ function replaceCustomEmoji(customEmojis: Record<string, mastodon.v1.CustomEmoji
|
|||||||
if (node.type !== TEXT_NODE)
|
if (node.type !== TEXT_NODE)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
const split = node.value.split(/:([\w-]+?):/g)
|
const split = node.value.split(/:([\w-]+):/g)
|
||||||
if (split.length === 1)
|
if (split.length === 1)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
@ -484,9 +485,9 @@ const _markdownReplacements: [RegExp, (c: (string | Node)[]) => Node][] = [
|
|||||||
[/\*\*(.*?)\*\*/g, c => h('b', null, c)],
|
[/\*\*(.*?)\*\*/g, c => h('b', null, c)],
|
||||||
[/\*(.*?)\*/g, c => h('em', null, c)],
|
[/\*(.*?)\*/g, c => h('em', null, c)],
|
||||||
[/~~(.*?)~~/g, c => h('del', null, c)],
|
[/~~(.*?)~~/g, c => h('del', null, c)],
|
||||||
[/`([^`]+?)`/g, c => h('code', null, c)],
|
[/`([^`]+)`/g, c => h('code', null, c)],
|
||||||
// transform @username@twitter.com as links
|
// transform @username@twitter.com as links
|
||||||
[/\B@([a-zA-Z0-9_]+)@twitter\.com\b/gi, c => h('a', { href: `https://twitter.com/${c}`, target: '_blank', rel: 'nofollow noopener noreferrer', class: 'mention external' }, `@${c}@twitter.com`)],
|
[/\B@(\w+)@twitter\.com\b/gi, c => h('a', { href: `https://twitter.com/${c}`, target: '_blank', rel: 'nofollow noopener noreferrer', class: 'mention external' }, `@${c}@twitter.com`)],
|
||||||
]
|
]
|
||||||
|
|
||||||
function _markdownProcess(value: string) {
|
function _markdownProcess(value: string) {
|
||||||
|
@ -4,7 +4,7 @@ export function getDisplayName(account: mastodon.v1.Account, options?: { rich?:
|
|||||||
const displayName = account.displayName || account.username || account.acct || ''
|
const displayName = account.displayName || account.username || account.acct || ''
|
||||||
if (options?.rich)
|
if (options?.rich)
|
||||||
return displayName
|
return displayName
|
||||||
return displayName.replace(/:([\w-]+?):/g, '')
|
return displayName.replace(/:([\w-]+):/g, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function accountToShortHandle(acct: string) {
|
export function accountToShortHandle(acct: string) {
|
||||||
|
@ -80,8 +80,9 @@ export function usePublish(options: {
|
|||||||
options.length < currentInstance.value.configuration.polls.maxOptions
|
options.length < currentInstance.value.configuration.polls.maxOptions
|
||||||
|| options[options.length - 1].trim().length === 0
|
|| options[options.length - 1].trim().length === 0
|
||||||
)
|
)
|
||||||
)
|
) {
|
||||||
options = options.slice(0, options.length - 1)
|
options = options.slice(0, options.length - 1)
|
||||||
|
}
|
||||||
|
|
||||||
poll = { ...draftItem.value.params.poll, options }
|
poll = { ...draftItem.value.params.poll, options }
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,9 @@ export function usePaginator<T, P, U = T>(
|
|||||||
&& state.value === 'idle'
|
&& state.value === 'idle'
|
||||||
// No new content is loaded when the keepAlive page enters the background
|
// No new content is loaded when the keepAlive page enters the background
|
||||||
&& deactivated.value === false
|
&& deactivated.value === false
|
||||||
)
|
) {
|
||||||
loadNext()
|
loadNext()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,8 @@ async function unsubscribeFromBackend(fromSWPushManager: boolean, removePushNoti
|
|||||||
const cu = currentUser.value
|
const cu = currentUser.value
|
||||||
if (cu) {
|
if (cu) {
|
||||||
await removePushNotifications(cu)
|
await removePushNotifications(cu)
|
||||||
removePushNotification && await removePushNotificationData(cu, fromSWPushManager)
|
if (removePushNotification)
|
||||||
|
await removePushNotificationData(cu, fromSWPushManager)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,8 @@ export function usePushManager() {
|
|||||||
else
|
else
|
||||||
currentUser.value.pushSubscription = await client.value.v1.push.subscription.update({ data })
|
currentUser.value.pushSubscription = await client.value.v1.push.subscription.update({ data })
|
||||||
|
|
||||||
policyChanged && await nextTick()
|
if (policyChanged)
|
||||||
|
await nextTick()
|
||||||
|
|
||||||
// force change policy when changed: watch is resetting it on push subscription update
|
// force change policy when changed: watch is resetting it on push subscription update
|
||||||
await saveSettings(policyChanged ? policy : undefined)
|
await saveSettings(policyChanged ? policy : undefined)
|
||||||
|
@ -29,7 +29,7 @@ declare module '@tiptap/core' {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/
|
const inputRegex = /(?:^|\s)(!\[(.+|:?)\]\((\S+)(?:\s+["'](\S+)["'])?\))$/
|
||||||
|
|
||||||
export const TiptapPluginCustomEmoji = Node.create<EmojiOptions>({
|
export const TiptapPluginCustomEmoji = Node.create<EmojiOptions>({
|
||||||
name: 'custom-emoji',
|
name: 'custom-emoji',
|
||||||
|
@ -14,7 +14,7 @@ function wrapHandler<T extends (...args: any[]) => any>(handler: T): T {
|
|||||||
try {
|
try {
|
||||||
return handler(...args)
|
return handler(...args)
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -119,7 +119,8 @@ function createSuggestionRenderer(component: Component): SuggestionOptions['rend
|
|||||||
|
|
||||||
// Use arrow function here because Nuxt will transform it incorrectly as Vue hook causing the build to fail
|
// Use arrow function here because Nuxt will transform it incorrectly as Vue hook causing the build to fail
|
||||||
onBeforeUpdate: (props) => {
|
onBeforeUpdate: (props) => {
|
||||||
props.editor.isFocused && renderer.updateProps({ ...props, isPending: true })
|
if (props.editor.isFocused)
|
||||||
|
renderer.updateProps({ ...props, isPending: true })
|
||||||
},
|
},
|
||||||
|
|
||||||
onUpdate(props) {
|
onUpdate(props) {
|
||||||
|
@ -83,7 +83,8 @@ export const isGlitchEdition = computed(() => currentInstance.value?.version?.in
|
|||||||
// when multiple tabs: we need to reload window when sign in, switch account or sign out
|
// when multiple tabs: we need to reload window when sign in, switch account or sign out
|
||||||
if (import.meta.client) {
|
if (import.meta.client) {
|
||||||
const windowReload = () => {
|
const windowReload = () => {
|
||||||
document.visibilityState === 'visible' && window.location.reload()
|
if (document.visibilityState === 'visible')
|
||||||
|
window.location.reload()
|
||||||
}
|
}
|
||||||
watch(currentUserHandle, async (handle, oldHandle) => {
|
watch(currentUserHandle, async (handle, oldHandle) => {
|
||||||
// when sign in or switch account
|
// when sign in or switch account
|
||||||
|
@ -26,7 +26,7 @@ export const STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE = 'elk-last-accessed-n
|
|||||||
export const STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE = 'elk-last-accessed-explore-route'
|
export const STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE = 'elk-last-accessed-explore-route'
|
||||||
export const STORAGE_KEY_BOTTOM_NAV_BUTTONS = 'elk-bottom-nav-buttons'
|
export const STORAGE_KEY_BOTTOM_NAV_BUTTONS = 'elk-bottom-nav-buttons'
|
||||||
|
|
||||||
export const HANDLED_MASTO_URLS = /^(https?:\/\/)?([\w\d-]+\.)+\w+\/(@[@\w\d-\.]+)(\/objects)?(\/\d+)?$/
|
export const HANDLED_MASTO_URLS = /^(https?:\/\/)?([\w\-]+\.)+\w+\/(@[@\w\-.]+)(\/objects)?(\/\d+)?$/
|
||||||
|
|
||||||
export const NOTIFICATION_FILTER_TYPES: mastodon.v1.NotificationType[] = ['status', 'reblog', 'follow', 'follow_request', 'favourite', 'poll', 'update', 'admin.sign_up', 'admin.report']
|
export const NOTIFICATION_FILTER_TYPES: mastodon.v1.NotificationType[] = ['status', 'reblog', 'follow', 'follow_request', 'favourite', 'poll', 'update', 'admin.sign_up', 'admin.report']
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ export default defineNuxtModule({
|
|||||||
return
|
return
|
||||||
|
|
||||||
const s = new MagicString(code)
|
const s = new MagicString(code)
|
||||||
s.replace(/<!--(?:.*?)-->/sg, '')
|
s.replace(/<!--.*?-->/gs, '')
|
||||||
|
|
||||||
if (s.hasChanged()) {
|
if (s.hasChanged()) {
|
||||||
return {
|
return {
|
||||||
|
@ -12,7 +12,7 @@ export function configurePWAOptions(options: Partial<VitePWAOptions>, nuxt: Nuxt
|
|||||||
import('workbox-build').BasePartial
|
import('workbox-build').BasePartial
|
||||||
& import('workbox-build').GlobPartial
|
& import('workbox-build').GlobPartial
|
||||||
& import('workbox-build').RequiredGlobDirectoryPartial
|
& import('workbox-build').RequiredGlobDirectoryPartial
|
||||||
>
|
>
|
||||||
|
|
||||||
if (options.strategies === 'injectManifest') {
|
if (options.strategies === 'injectManifest') {
|
||||||
options.injectManifest = options.injectManifest ?? {}
|
options.injectManifest = options.injectManifest ?? {}
|
||||||
@ -76,7 +76,7 @@ function createManifestTransform(base: string, appManifestFolder?: string): impo
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (appManifestFolder) {
|
if (appManifestFolder) {
|
||||||
const regExp = /(\/)?[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}\.json$/i
|
const regExp = /\/?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.json$/i
|
||||||
// we need to remove the revision from the sw prechaing manifest, UUID is enough:
|
// we need to remove the revision from the sw prechaing manifest, UUID is enough:
|
||||||
// we don't use dontCacheBustURLsMatching, single regex
|
// we don't use dontCacheBustURLsMatching, single regex
|
||||||
entries.filter(e => e && e.url.startsWith(appManifestFolder) && regExp.test(e.url)).forEach((e) => {
|
entries.filter(e => e && e.url.startsWith(appManifestFolder) && regExp.test(e.url)).forEach((e) => {
|
||||||
|
@ -276,7 +276,7 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// eslint-disable-next-line ts/prefer-ts-expect-error
|
// eslint-disable-next-line ts/ban-ts-comment
|
||||||
// @ts-ignore nuxt-security is conditional
|
// @ts-ignore nuxt-security is conditional
|
||||||
security: {
|
security: {
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -112,7 +112,7 @@
|
|||||||
"ws": "^8.15.1"
|
"ws": "^8.15.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^2.9.0",
|
"@antfu/eslint-config": "^2.26.0",
|
||||||
"@antfu/ni": "^0.21.12",
|
"@antfu/ni": "^0.21.12",
|
||||||
"@types/chroma-js": "^2.4.4",
|
"@types/chroma-js": "^2.4.4",
|
||||||
"@types/file-saver": "^2.0.7",
|
"@types/file-saver": "^2.0.7",
|
||||||
@ -122,12 +122,12 @@
|
|||||||
"@types/wicg-file-system-access": "^2023.10.5",
|
"@types/wicg-file-system-access": "^2023.10.5",
|
||||||
"@types/ws": "^8.5.10",
|
"@types/ws": "^8.5.10",
|
||||||
"@unlazy/nuxt": "^0.11.2",
|
"@unlazy/nuxt": "^0.11.2",
|
||||||
"@unocss/eslint-config": "^0.58.9",
|
"@unocss/eslint-config": "^0.62.2",
|
||||||
"@vue/test-utils": "2.4.5",
|
"@vue/test-utils": "2.4.5",
|
||||||
"bumpp": "^9.4.0",
|
"bumpp": "^9.4.0",
|
||||||
"consola": "^3.2.3",
|
"consola": "^3.2.3",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-format": "^0.1.0",
|
"eslint-plugin-format": "^0.1.2",
|
||||||
"flat": "^6.0.1",
|
"flat": "^6.0.1",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"lint-staged": "^15.2.2",
|
"lint-staged": "^15.2.2",
|
||||||
|
@ -50,9 +50,11 @@ async function createList() {
|
|||||||
|
|
||||||
function clearError(focusBtn: boolean) {
|
function clearError(focusBtn: boolean) {
|
||||||
actionError.value = undefined
|
actionError.value = undefined
|
||||||
focusBtn && nextTick(() => {
|
if (focusBtn) {
|
||||||
inputRef.value?.focus()
|
nextTick(() => {
|
||||||
})
|
inputRef.value?.focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateEntry(list: mastodon.v1.List) {
|
function updateEntry(list: mastodon.v1.List) {
|
||||||
|
@ -31,7 +31,7 @@ export default defineNuxtPlugin(() => {
|
|||||||
if (settings.themeColors) {
|
if (settings.themeColors) {
|
||||||
Object.entries(settings.themeColors).map(i => html.style.setProperty(i[0], i[1]))
|
Object.entries(settings.themeColors).map(i => html.style.setProperty(i[0], i[1]))
|
||||||
}
|
}
|
||||||
})()`.trim().replace(/\s*\n+\s*/g, ';'),
|
})()`.trim().replace(/\s*\n\s*/g, ';'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
1389
pnpm-lock.yaml
1389
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,7 @@ export default defineEventHandler(async (event) => {
|
|||||||
const url = `/signin/callback?${stringifyQuery({ server, token: result.access_token, vapid_key: app.vapid_key })}`
|
const url = `/signin/callback?${stringifyQuery({ server, token: result.access_token, vapid_key: app.vapid_key })}`
|
||||||
await sendRedirect(event, url, 302)
|
await sendRedirect(event, url, 302)
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
statusMessage: 'Could not complete log in.',
|
statusMessage: 'Could not complete log in.',
|
||||||
|
@ -62,7 +62,7 @@ async function fetchAppInfo(origin: string, server: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getApp(origin: string, server: string) {
|
export async function getApp(origin: string, server: string) {
|
||||||
const host = origin.replace(/^https?:\/\//, '').replace(/[^\w\d]/g, '-').replace(/\?.*$/, '')
|
const host = origin.replace(/^https?:\/\//, '').replace(/\W/g, '-').replace(/\?.*$/, '')
|
||||||
const key = `servers:v3:${server}:${host}.json`.toLowerCase()
|
const key = `servers:v3:${server}:${host}.json`.toLowerCase()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -60,8 +60,8 @@ export function createNotificationOptions(
|
|||||||
icon,
|
icon,
|
||||||
lang: preferred_locale,
|
lang: preferred_locale,
|
||||||
tag: notification_id,
|
tag: notification_id,
|
||||||
// eslint-disable-next-line ts/prefer-ts-expect-error
|
|
||||||
// @ts-ignore error missing type, just ignore
|
// @ts-expect-error error missing type, just ignore
|
||||||
timestamp: new Date().getTime(),
|
timestamp: new Date().getTime(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,8 +73,7 @@ export function createNotificationOptions(
|
|||||||
notificationOptions.icon = notification.account.avatar_static
|
notificationOptions.icon = notification.account.avatar_static
|
||||||
*/
|
*/
|
||||||
if (notification.created_at) {
|
if (notification.created_at) {
|
||||||
// eslint-disable-next-line ts/prefer-ts-expect-error
|
// @ts-expect-error error missing type, just ignore
|
||||||
// @ts-ignore error missing type, just ignore
|
|
||||||
notificationOptions.timestamp = new Date(notification.created_at).getTime()
|
notificationOptions.timestamp = new Date(notification.created_at).getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,8 +88,7 @@ export function createNotificationOptions(
|
|||||||
if (notification.status) {
|
if (notification.status) {
|
||||||
// notificationOptions.body = htmlToPlainText(notification.status.content)
|
// notificationOptions.body = htmlToPlainText(notification.status.content)
|
||||||
if (notification.status.media_attachments && notification.status.media_attachments.length > 0 && notification.status.media_attachments[0].preview_url) {
|
if (notification.status.media_attachments && notification.status.media_attachments.length > 0 && notification.status.media_attachments[0].preview_url) {
|
||||||
// eslint-disable-next-line ts/prefer-ts-expect-error
|
// @ts-expect-error error missing type, just ignore
|
||||||
// @ts-ignore error missing type, just ignore
|
|
||||||
notificationOptions.image = notification.status.media_attachments[0].preview_url
|
notificationOptions.image = notification.status.media_attachments[0].preview_url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ describe('editor', () => {
|
|||||||
async function render(content: string, options?: ContentParseOptions) {
|
async function render(content: string, options?: ContentParseOptions) {
|
||||||
const vnode = contentToVNode(content, options)
|
const vnode = contentToVNode(content, options)
|
||||||
const html = (await renderToString(vnode))
|
const html = (await renderToString(vnode))
|
||||||
.replace(/<!--[\[\]]-->/g, '')
|
.replace(/<!--[[\]]-->/g, '')
|
||||||
let formatted = ''
|
let formatted = ''
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -202,7 +202,7 @@ async function render(content: string, options?: ContentParseOptions) {
|
|||||||
parser: 'html',
|
parser: 'html',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
formatted = html
|
formatted = html
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ async function render(input: string, options?: ContentParseOptions) {
|
|||||||
parser: 'html',
|
parser: 'html',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch {
|
||||||
formatted = html
|
formatted = html
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ export default defineConfig({
|
|||||||
|
|
||||||
'timeline-title-style': 'text-primary text-lg font-bold',
|
'timeline-title-style': 'text-primary text-lg font-bold',
|
||||||
},
|
},
|
||||||
[/^elk-group-hover[:-]([a-z0-9\/-]+)$/, ([,r]) => `media-mouse-group-hover-${r} group-active-${r}`],
|
[/^elk-group-hover[:-]([a-z0-9/-]+)$/, ([,r]) => `media-mouse-group-hover-${r} group-active-${r}`],
|
||||||
],
|
],
|
||||||
presets: [
|
presets: [
|
||||||
presetUno({
|
presetUno({
|
||||||
|
Loading…
Reference in New Issue
Block a user