Skip to content

Commit 19eb11f

Browse files
authored
Merge pull request #19 from maybeanerd/chore-update-from-upstream-elk
chore: update from upstream elk
2 parents 817164a + bb240da commit 19eb11f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1302
-585
lines changed

components/account/AccountBotIndicator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defineProps<{
1111
text-secondary-light
1212
>
1313
<slot name="prepend" />
14-
<CommonTooltip no-auto-focus :content="$t('account.bot')" :disabled="showLabel">
14+
<CommonTooltip :content="$t('account.bot')" :disabled="showLabel">
1515
<div i-mdi:robot-outline />
1616
</CommonTooltip>
1717
<div v-if="showLabel">

components/account/AccountFollowRequestButton.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function rejectFollowRequest() {
3838
<template>
3939
<div flex gap-4>
4040
<template v-if="relationship?.requestedBy">
41-
<CommonTooltip :content="$t('account.authorize')" no-auto-focus>
41+
<CommonTooltip :content="$t('account.authorize')">
4242
<button
4343
type="button"
4444
rounded-full text-sm p2 border-1
@@ -48,7 +48,7 @@ async function rejectFollowRequest() {
4848
<span block text-current i-ri:check-fill />
4949
</button>
5050
</CommonTooltip>
51-
<CommonTooltip :content="$t('account.reject')" no-auto-focus>
51+
<CommonTooltip :content="$t('account.reject')">
5252
<button
5353
type="button"
5454
rounded-full text-sm p2 border-1

components/account/AccountHeader.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ async function copyAccountName() {
196196

197197
<div flex items-center gap-1>
198198
<AccountHandle :account="account" overflow-unset line-clamp-unset />
199-
<CommonTooltip placement="bottom" :content="$t('account.copy_account_name')" no-auto-focus flex>
199+
<CommonTooltip placement="bottom" :content="$t('account.copy_account_name')" flex>
200200
<button text-secondary-light text-sm :class="isCopied ? 'i-ri:check-fill text-green' : 'i-ri:file-copy-line'" @click="copyAccountName">
201201
<span sr-only>{{ $t('account.copy_account_name') }}</span>
202202
</button>

components/account/AccountHoverWrapper.vue

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const userSettings = useUserSettings()
5858
:delay="{ show: 500, hide: 100 }"
5959
v-bind="$attrs"
6060
:close-on-content-click="false"
61+
no-auto-focus
6162
>
6263
<slot />
6364
<template #popper>

components/account/AccountLockIndicator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { t } = useI18n()
1313
text-secondary-light
1414
>
1515
<slot name="prepend" />
16-
<CommonTooltip no-auto-focus content="Lock" :disabled="showLabel">
16+
<CommonTooltip content="Lock" :disabled="showLabel">
1717
<div i-ri:lock-line />
1818
</CommonTooltip>
1919
<div v-if="showLabel">

components/account/TagHoverWrapper.vue

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const userSettings = useUserSettings()
3333
:delay="{ show: 500, hide: 100 }"
3434
v-bind="$attrs"
3535
:close-on-content-click="false"
36+
no-auto-focus
3637
>
3738
<slot />
3839
<template #popper>

components/common/CommonRouteTabs.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ useCommands(() => command
4646
</template>
4747
<template v-if="isHydrated && moreOptions?.options?.length">
4848
<CommonDropdown placement="bottom" flex cursor-pointer mx-1.25rem>
49-
<CommonTooltip placement="top" no-auto-focus :content="moreOptions.tooltip || t('action.more')">
49+
<CommonTooltip placement="top" :content="moreOptions.tooltip || t('action.more')">
5050
<button
5151
cursor-pointer
5252
flex

components/common/CommonTooltip.vue

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ defineProps<Props>()
1313
v-if="isHydrated"
1414
v-bind="$attrs"
1515
auto-hide
16+
no-auto-focus
1617
>
1718
<slot />
1819
<template #popper>

components/list/Account.vue

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ async function edit() {
3939
<CommonTooltip
4040
:content="isRemoved ? $t('list.add_account') : $t('list.remove_account')"
4141
:hover="isRemoved ? 'text-green' : 'text-red'"
42-
no-auto-focus
4342
>
4443
<button
4544
text-sm p2 border-1 transition-colors

components/list/ListEntry.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ async function prepareEdit() {
3232
async function cancelEdit() {
3333
isEditing.value = false
3434
actionError.value = undefined
35-
reset()
3635
3736
await nextTick()
37+
reset()
3838
editBtn.value?.focus()
3939
}
4040
@@ -113,7 +113,7 @@ onDeactivated(cancelEdit)
113113
bg-base border="~ base" h10 m2 ps-1 pe-4 rounded-3 w-full flex="~ row"
114114
items-center relative focus-within:box-shadow-outline gap-3
115115
>
116-
<CommonTooltip v-if="isEditing" :content="$t('list.cancel_edit')" no-auto-focus>
116+
<CommonTooltip v-if="isEditing" :content="$t('list.cancel_edit')">
117117
<button
118118
type="button"
119119
rounded-full text-sm p2 transition-colors
@@ -136,7 +136,7 @@ onDeactivated(cancelEdit)
136136
{{ form.title }}
137137
</NuxtLink>
138138
<div mr4 flex gap2>
139-
<CommonTooltip v-if="isEditing" :content="$t('list.save')" no-auto-focus>
139+
<CommonTooltip v-if="isEditing" :content="$t('list.save')">
140140
<button
141141
type="submit"
142142
text-sm p2 border-1 transition-colors
@@ -152,7 +152,7 @@ onDeactivated(cancelEdit)
152152
</template>
153153
</button>
154154
</CommonTooltip>
155-
<CommonTooltip v-else :content="$t('list.edit')" no-auto-focus>
155+
<CommonTooltip v-else :content="$t('list.edit')">
156156
<button
157157
ref="editBtn"
158158
type="button"
@@ -164,7 +164,7 @@ onDeactivated(cancelEdit)
164164
<span block text-current i-ri:edit-2-line class="rtl-flip" />
165165
</button>
166166
</CommonTooltip>
167-
<CommonTooltip :content="$t('list.delete')" no-auto-focus>
167+
<CommonTooltip :content="$t('list.delete')">
168168
<button
169169
type="button"
170170
text-sm p2 border-1 transition-colors
@@ -192,7 +192,7 @@ onDeactivated(cancelEdit)
192192
<div aria-hidden="true" i-ri:error-warning-fill />
193193
<p>{{ $t(`list.${isEditing ? 'edit_error' : 'delete_error'}`) }}</p>
194194
</div>
195-
<CommonTooltip placement="bottom" :content="$t('list.clear_error')" no-auto-focus>
195+
<CommonTooltip placement="bottom" :content="$t('list.clear_error')">
196196
<button
197197
flex rounded-4 p1 hover:bg-active cursor-pointer transition-100 :aria-label="$t('list.clear_error')"
198198
@click="clearError"

components/list/Lists.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function edit(listId: string) {
3030
</script>
3131

3232
<template>
33-
<CommonPaginator :end-message="false" :paginator="paginator">
33+
<CommonPaginator :paginator="paginator">
3434
<template #default="{ item }">
3535
<div p4 hover:bg-active block w="100%" flex justify-between items-center gap-4>
3636
<p>{{ item.title }}</p>
@@ -49,5 +49,13 @@ async function edit(listId: string) {
4949
</CommonTooltip>
5050
</div>
5151
</template>
52+
<template #done>
53+
<NuxtLink
54+
p4 hover:bg-active block w="100%" flex justify-between items-center gap-4
55+
to="/lists"
56+
>
57+
<p>{{ $t('list.manage') }}</p>
58+
</NuxtLink>
59+
</template>
5260
</CommonPaginator>
5361
</template>

components/modal/ModalContainer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function handleFavouritedBoostedByClose() {
6767
@close="handlePublishClose"
6868
>
6969
<!-- This `w-0` style is used to avoid overflow problems in flex layouts,so don't remove it unless you know what you're doing -->
70-
<PublishWidget
70+
<PublishWidgetList
7171
v-if="dialogDraftKey"
7272
:draft-key="dialogDraftKey" expanded flex-1 w-0
7373
@published="handlePublished"

components/nav/NavBottom.vue

+32-47
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,45 @@
11
<script setup lang="ts">
2-
// only one icon can be lit up at the same time
3-
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
2+
import type { Component } from 'vue'
3+
import type { NavButtonName } from '../../composables/settings'
44
5-
const moreMenuVisible = ref(false)
5+
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
6+
7+
import { NavButtonExplore, NavButtonFederated, NavButtonHome, NavButtonLocal, NavButtonMention, NavButtonMoreMenu, NavButtonNotification, NavButtonSearch } from '#components'
8+
9+
interface NavButton {
10+
name: string
11+
component: Component
12+
}
13+
14+
const navButtons: NavButton[] = [
15+
{ name: 'home', component: NavButtonHome },
16+
{ name: 'search', component: NavButtonSearch },
17+
{ name: 'notification', component: NavButtonNotification },
18+
{ name: 'mention', component: NavButtonMention },
19+
{ name: 'explore', component: NavButtonExplore },
20+
{ name: 'local', component: NavButtonLocal },
21+
{ name: 'federated', component: NavButtonFederated },
22+
{ name: 'moreMenu', component: NavButtonMoreMenu },
23+
]
624
7-
const { notifications } = useNotifications()
8-
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
9-
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
25+
const defaultSelectedNavButtonNames: NavButtonName[] = currentUser.value
26+
? ['home', 'search', 'notification', 'mention', 'moreMenu']
27+
: ['explore', 'local', 'federated', 'moreMenu']
28+
const selectedNavButtonNames = useLocalStorage<NavButtonName[]>(STORAGE_KEY_BOTTOM_NAV_BUTTONS, defaultSelectedNavButtonNames)
29+
30+
const selectedNavButtons = computed(() => selectedNavButtonNames.value.map(name => navButtons.find(navButton => navButton.name === name)))
31+
32+
// only one icon can be lit up at the same time
33+
const moreMenuVisible = ref(false)
1034
</script>
1135

1236
<template>
37+
<!-- This weird styles above are used for scroll locking, don't change it unless you know exactly what you're doing. -->
1338
<nav
1439
h-14 border="t base" flex flex-row text-xl
1540
of-y-scroll scrollbar-hide overscroll-none
1641
class="after-content-empty after:(h-[calc(100%+0.5px)] w-0.1px pointer-events-none)"
1742
>
18-
<!-- These weird styles above are used for scroll locking, don't change it unless you know exactly what you're doing. -->
19-
<template v-if="currentUser">
20-
<NuxtLink to="/home" :aria-label="$t('nav.home')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
21-
<div i-ri:home-5-line />
22-
</NuxtLink>
23-
<NuxtLink to="/search" :aria-label="$t('nav.search')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
24-
<div i-ri:search-line />
25-
</NuxtLink>
26-
<NuxtLink :to="`/notifications/${lastAccessedNotificationRoute}`" :aria-label="$t('nav.notifications')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
27-
<div flex relative>
28-
<div class="i-ri:notification-4-line" text-xl />
29-
<div v-if="notifications" class="top-[-0.3rem] right-[-0.3rem]" absolute font-bold rounded-full h-4 w-4 text-xs bg-primary text-inverted flex items-center justify-center>
30-
{{ notifications < 10 ? notifications : '•' }}
31-
</div>
32-
</div>
33-
</NuxtLink>
34-
<NuxtLink to="/conversations" :aria-label="$t('nav.conversations')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
35-
<div i-ri:at-line />
36-
</NuxtLink>
37-
</template>
38-
<template v-else>
39-
<NuxtLink :to="`/${currentServer}/explore/${lastAccessedExploreRoute}`" :aria-label="$t('nav.explore')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
40-
<div i-ri:compass-3-line />
41-
</NuxtLink>
42-
<NuxtLink group :to="`/${currentServer}/public/local`" :aria-label="$t('nav.local')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
43-
<div i-ri:group-2-line />
44-
</NuxtLink>
45-
<NuxtLink :to="`/${currentServer}/public`" :aria-label="$t('nav.federated')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
46-
<div i-ri:earth-line />
47-
</NuxtLink>
48-
</template>
49-
<NavBottomMoreMenu v-slot="{ toggleVisible, show }" v-model="moreMenuVisible" flex flex-row items-center place-content-center h-full flex-1 cursor-pointer>
50-
<button
51-
flex items-center place-content-center h-full flex-1 class="select-none"
52-
:class="show ? '!text-primary' : ''"
53-
aria-label="More menu"
54-
@click="toggleVisible"
55-
>
56-
<span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" />
57-
</button>
58-
</NavBottomMoreMenu>
43+
<Component :is="navButton!.component" v-for="navButton in selectedNavButtons" :key="navButton!.name" :active-class="moreMenuVisible ? '' : 'text-primary'" />
5944
</nav>
6045
</template>

components/nav/button/Explore.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE } from '~/constants'
3+
4+
defineProps<{
5+
activeClass: string
6+
}>()
7+
8+
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
9+
</script>
10+
11+
<template>
12+
<NuxtLink :to="`/${currentServer}/explore/${lastAccessedExploreRoute}`" :aria-label="$t('nav.explore')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
13+
<div i-ri:compass-3-line />
14+
</NuxtLink>
15+
</template>

components/nav/button/Federated.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
activeClass: string
4+
}>()
5+
</script>
6+
7+
<template>
8+
<NuxtLink :to="`/${currentServer}/public`" :aria-label="$t('nav.federated')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
9+
<div i-ri:earth-line />
10+
</NuxtLink>
11+
</template>

components/nav/button/Home.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
activeClass: string
4+
}>()
5+
</script>
6+
7+
<template>
8+
<NuxtLink to="/home" :aria-label="$t('nav.home')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
9+
<div i-ri:home-5-line />
10+
</NuxtLink>
11+
</template>

components/nav/button/Local.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
activeClass: string
4+
}>()
5+
</script>
6+
7+
<template>
8+
<NuxtLink group :to="`/${currentServer}/public/local`" :aria-label="$t('nav.local')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
9+
<div i-ri:group-2-line />
10+
</NuxtLink>
11+
</template>

components/nav/button/Mention.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
activeClass: string
4+
}>()
5+
</script>
6+
7+
<template>
8+
<NuxtLink
9+
to="/conversations" :aria-label="$t('nav.conversations')"
10+
:active-class="activeClass" flex flex-row items-center place-content-center h-full
11+
flex-1 class="coarse-pointer:select-none" @click="$scrollToTop"
12+
>
13+
<div i-ri:at-line />
14+
</NuxtLink>
15+
</template>

components/nav/button/MoreMenu.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
defineModel<boolean>()
3+
</script>
4+
5+
<template>
6+
<NavBottomMoreMenu
7+
v-slot="{ toggleVisible, show }" v-model="modelValue!" flex flex-row items-center
8+
place-content-center h-full flex-1 cursor-pointer
9+
>
10+
<button
11+
flex items-center place-content-center h-full flex-1 class="select-none"
12+
:class="show ? '!text-primary' : ''"
13+
aria-label="More menu"
14+
@click="toggleVisible"
15+
>
16+
<span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" />
17+
</button>
18+
</NavBottomMoreMenu>
19+
</template>
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
import { STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
3+
4+
defineProps<{
5+
activeClass: string
6+
}>()
7+
const { notifications } = useNotifications()
8+
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
9+
</script>
10+
11+
<template>
12+
<NuxtLink :to="`/notifications/${lastAccessedNotificationRoute}`" :aria-label="$t('nav.notifications')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
13+
<div flex relative>
14+
<div class="i-ri:notification-4-line" text-xl />
15+
<div v-if="notifications" class="top-[-0.3rem] right-[-0.3rem]" absolute font-bold rounded-full h-4 w-4 text-xs bg-primary text-inverted flex items-center justify-center>
16+
{{ notifications < 10 ? notifications : '•' }}
17+
</div>
18+
</div>
19+
</NuxtLink>
20+
</template>

components/nav/button/Search.vue

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script setup lang="ts">
2+
defineProps<{
3+
activeClass: string
4+
}>()
5+
</script>
6+
7+
<template>
8+
<NuxtLink to="/search" :aria-label="$t('nav.search')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
9+
<div i-ri:search-line />
10+
</NuxtLink>
11+
</template>

0 commit comments

Comments
 (0)