Compare commits

..

No commits in common. "main" and "v0.14.0" have entirely different histories.

440 changed files with 13689 additions and 22935 deletions

View file

@ -40,6 +40,7 @@
"groupName": "lint", "groupName": "lint",
"matchPackageNames": [ "matchPackageNames": [
"@antfu/eslint-config", "@antfu/eslint-config",
"@types/prettier",
"eslint", "eslint",
"prettier" "prettier"
] ]

View file

@ -18,13 +18,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# workaround for npm registry key change - run: corepack enable
# ref. `pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch · Issue #612 · nodejs/corepack - uses: actions/setup-node@v4
# - https://github.com/nodejs/corepack/issues/612#issuecomment-2629496091
- run: npm i -g corepack@latest && corepack enable
- uses: actions/setup-node@v4.4.0
with: with:
node-version-file: .nvmrc node-version: 20
cache: pnpm
- name: 📦 Install dependencies - name: 📦 Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile

View file

@ -35,7 +35,7 @@ jobs:
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ github.token }} password: ${{ github.token }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v5
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64

View file

@ -19,7 +19,7 @@ jobs:
- name: Set node - name: Set node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version-file: .nvmrc node-version: 18
- run: npx changelogithub - run: npx changelogithub
env: env:

View file

@ -19,6 +19,6 @@ jobs:
name: Semantic Pull Request name: Semantic Pull Request
steps: steps:
- name: Validate PR title - name: Validate PR title
uses: amannn/action-semantic-pull-request@v5.5.3 uses: amannn/action-semantic-pull-request@v5.4.0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.npmrc
View file

@ -1,4 +1,3 @@
shamefully-hoist=true shamefully-hoist=true
shell-emulator=true shell-emulator=true
ignore-workspace-root-check=true ignore-workspace-root-check=true
package-manager-strict=false

2
.nvmrc
View file

@ -1 +1 @@
22 20

View file

@ -6,16 +6,22 @@ Refer also to https://github.com/antfu/contribute.
For guidelines on contributing to the documentation, refer to the [docs README](./docs/README.md). For guidelines on contributing to the documentation, refer to the [docs README](./docs/README.md).
### Online
You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow).
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk)
### Local Setup ### Local Setup
To develop and test the Elk package: To develop and test the Elk package:
1. Fork the Elk repository to your own GitHub account and then clone it to your local device. 1. Fork the Elk repository to your own GitHub account and then clone it to your local device.
2. Ensure using the LTS version of Node.js. 2. Ensure using the latest Node.js (16.x).
If you have [nvm](https://github.com/nvm-sh/nvm), you can run `nvm i` to install the required version. If you have [nvm](https://github.com/nvm-sh/nvm), you can run `nvm i` to install the required version.
3. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/) v9. To use it you must first enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`. (Note: on Linux in a standard Node 20+ environment, you should follow the instructions to install via Node's `corepack` rather than using the `curl` command) 3. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/) v7. To use it you must first enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`. (Note: on Linux in a standard Node 16+ environment, you should follow the instructions to install via Node's `corepack` rather than using the `curl` command)
4. Check out a branch where you can work and commit your changes: 4. Check out a branch where you can work and commit your changes:
```shell ```shell
@ -84,14 +90,14 @@ We've added some `UnoCSS` utilities styles to help you with that:
## Internationalization ## Internationalization
We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i18n.nuxtjs.org/) to handle internationalization. We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://v8.i18n.nuxtjs.org/) to handle internationalization.
You can check the current [translation status](https://docs.elk.zone/guide/contributing#translation-status): more instructions on the table caption. You can check the current [translation status](https://docs.elk.zone/docs/guide/contributing#translation-status): more instructions on the table caption.
If you are updating a translation in your local environment, you can run the following commands to check the status: If you are updating a translation in your local environment, you can run the following commands to check the status:
- from root folder: `nr prepare-translation-status` - from root folder: `nr prepare-translation-status`
- change to `docs` folder and run docs dev server `nr dev` - change to `docs` folder and run docs dev server `nr dev`
- open `http://localhost:3000/guide/contributing#translation-status` in your browser - open `http://localhost:3000/docs/guide/contributing#translation-status` in your browser
### Adding a new language ### Adding a new language

View file

@ -6,10 +6,7 @@ WORKDIR /elk
FROM base AS builder FROM base AS builder
# Prepare pnpm https://pnpm.io/installation#using-corepack # Prepare pnpm https://pnpm.io/installation#using-corepack
# workaround for npm registry key change RUN corepack enable
# ref. `pnpm@10.1.0` / `pnpm@9.15.4` cannot be installed due to key id mismatch · Issue #612 · nodejs/corepack
# - https://github.com/nodejs/corepack/issues/612#issuecomment-2629496091
RUN npm i -g corepack@latest && corepack enable
# Prepare deps # Prepare deps
RUN apk update RUN apk update

View file

@ -1,16 +1,28 @@
# Yolk <p align="center">
<a href="https://elk.zone" target="_blank" rel="noopener noreferrer">
<img width="160" height="160" src="./public/logo.svg" alt="Elk logo">
</a>
</p>
Hi! Yolk is my custom fork of [Elk](https://github.com/elk-zon/elk), a nimble Mastodon client. <h1 align="center"/>Elk <sup><em>alpha</em></sup></h1>
I [decided](https://social.ayco.io/@ayo/114921112446517000) to have a personal fork of Elk because I really like the cross-account functionalities I use it for (e.g., I can open the Explore tab of my fosstodon account, then engage in a post with my self-hosted account, etc)... but I find sometimes I want to change little things which will make the app a bit more opinionated on my tastes (e.g., icons, colors, spacing, etc)... and some behavioral features. <p align="center">
A nimble Mastodon web client
</p>
I think doing this will make me use it as my main app daily. I have been switching between multiple apps because each one have strengths & weaknesses of their own. <br/>
<p align="center">
<a href="https://chat.elk.zone"><img src="https://img.shields.io/badge/chat-discord-blue?style=flat&logo=discord" alt="discord chat"></a>
<a href="https://pr.new/elk-zone/elk"><img src="https://developer.stackblitz.com/img/start_pr_dark_small.svg" alt="Start new PR in StackBlitz Codeflow"></a>
<a href="https://volta.net/elk-zone/elk?utm_source=elk_readme"><img src="https://user-images.githubusercontent.com/904724/209143798-32345f6c-3cf8-4e06-9659-f4ace4a6acde.svg" alt="Open board on Volta"></a>
</p>
<br/>
Crucial fixes (if I find them), quality of life improvements, and mastodon API feature parity will still go upstream to the main Elk project. <p align="center">
<a href="https://elk.zone/" target="_blank" rel="noopener noreferrer" >
~ Ayo Ayco <img src="./public/elk-og.png" alt="Elk screenshots" width="600" height="auto">
</a>
--- </p>
## ⚠️ Elk is in Alpha ## ⚠️ Elk is in Alpha
@ -32,19 +44,72 @@ One could put Elk behind popular reverse proxies with SSL Handling like Traefik,
1. checkout source ```git clone https://github.com/elk-zone/elk.git``` 1. checkout source ```git clone https://github.com/elk-zone/elk.git```
1. got into new source dir: ```cd elk``` 1. got into new source dir: ```cd elk```
1. build Docker image: ```docker build .```
1. create local storage directory for settings: ```mkdir elk-storage``` 1. create local storage directory for settings: ```mkdir elk-storage```
1. adjust permissions of storage dir: ```sudo chown 911:911 ./elk-storage``` 1. adjust permissions of storage dir: ```sudo chown 911:911 ./elk-storage```
1. start container: ```docker-compose up --build -d``` 1. start container: ```docker-compose up -d```
> [!NOTE] > [!NOTE]
> The provided Dockerfile creates a container which will eventually run Elk as non-root user and create a persistent named Docker volume upon first start (if that volume does not yet exist). This volume is always created with root permission. Failing to change the permissions of ```/elk/data``` inside this volume to UID:GID 911 (as specified for Elk in the Dockerfile) will prevent Elk from storing it's config for user accounts. You either have to fix the permission in the created named volume, or mount a directory with the correct permission to ```/elk/data``` into the container. > The provided Dockerfile creates a container which will eventually run Elk as non-root user and create a persistent named Docker volume upon first start (if that volume does not yet exist). This volume is always created with root permission. Failing to change the permissions of ```/elk/data``` inside this volume to UID:GID 911 (as specified for Elk in the Dockerfile) will prevent Elk from storing it's config for user accounts. You either have to fix the permission in the created named volume, or mount a directory with the correct permission to ```/elk/data``` into the container.
### Ecosystem
These are known deployments using Elk as an alternative Web client for Mastodon servers or as a base for other projects in the fediverse:
- [elk.fedified.com](https://elk.fedified.com) - Use Elk to log into any compatible instance
- [elk.me.uk](https://elk.me.uk) - Use Elk to log into any compatible instance, hosted on Google Cloud Run with no Cloudflare proxy
- [elk.h4.io](https://elk.h4.io) - Use Elk for the `h4.io` Server
- [elk.universeodon.com](https://elk.universeodon.com) - Use Elk for the Universeodon Server
- [elk.vmst.io](https://elk.vmst.io) - Use Elk for the `vmst.io` Server
- [elk.hostux.social](https://elk.hostux.social) - Use Elk for the `hostux.social` Server
- [elk.cupoftea.social](https://elk.cupoftea.social) - Use Elk for the `cupoftea.social` Server
- [elk.aus.social](https://elk.aus.social) - Use Elk for the `aus.social` Server
- [elk.mstdn.ca](https://elk.mstdn.ca) - Use Elk for the `mstdn.ca` Server
- [elk.mastodonapp.uk](https://elk.mastodonapp.uk) - Use Elk for the `mastodonapp.uk` Server
- [elk.bolha.us](https://elk.bolha.us) - Use Elk for the `bolha.us` Server
> **Note**: Community deployments are **NOT** maintained by the Elk team. It may not be synced with Elk's source code. Please do your own research about the host servers before using them. > **Note**: Community deployments are **NOT** maintained by the Elk team. It may not be synced with Elk's source code. Please do your own research about the host servers before using them.
## 💖 Sponsors
We are grateful for the generous sponsorship and help of:
<a href="https://nuxtlabs.com/" target="_blank" rel="noopener noreferrer" >
<img src="./images/nuxtlabs.svg" alt="NuxtLabs" height="85">
</a>
<br><br>
<a href="https://stackblitz.com/" target="_blank" rel="noopener noreferrer" >
<img src="./images/stackblitz.svg" alt="StackBlitz" height="85">
</a>
<br><br>
And all the companies and individuals sponsoring Elk Team and the members. If you're enjoying the app, consider sponsoring us:
- [Elk Team's GitHub Sponsors](https://github.com/sponsors/elk-zone)
Or you can sponsor our core team members individually:
- [Anthony Fu](https://github.com/sponsors/antfu)
- [Daniel Roe](https://github.com/sponsors/danielroe)
- [三咲智子 Kevin Deng](https://github.com/sponsors/sxzz)
- [Patak](https://github.com/sponsors/patak-dev)
We would also appreciate sponsoring other contributors to the Elk project. If someone helps you solve an issue or implement a feature you wanted, supporting them would help make this project and OS more sustainable.
## 📍 Roadmap
[Open board on Volta](https://volta.net/elk-zone/elk)
## 🧑‍💻 Contributing ## 🧑‍💻 Contributing
We're really excited that you're interested in contributing to Elk! Before submitting your contribution, please read through the following guide. We're really excited that you're interested in contributing to Elk! Before submitting your contribution, please read through the following guide.
### Online
You can use [StackBlitz Codeflow](https://stackblitz.com/codeflow) to fix bugs or implement features. You'll also see a Codeflow button on PRs to review them without a local setup. Once the elk repo has been cloned in Codeflow, the dev server will start automatically and print the URL to open the App. You should receive a prompt in the bottom-right suggesting to open it in the Editor or in another Tab. To learn more, check out the [Codeflow docs](https://developer.stackblitz.com/codeflow/what-is-codeflow).
[![Open in Codeflow](https://developer.stackblitz.com/img/open_in_codeflow.svg)](https://pr.new/elk-zone/elk)
### Local Setup ### Local Setup
Clone the repository and run on the root folder: Clone the repository and run on the root folder:

View file

@ -1,23 +0,0 @@
<script setup lang="ts">
import type { SearchResult } from '~/composables/masto/search'
defineProps<{
result: SearchResult
active: boolean
}>()
</script>
<template>
<CommonScrollIntoView
as="div"
:active="active"
py2 block px2
:aria-selected="active"
:class="{ 'bg-active': active }"
>
<AccountInfo
v-if="result.type === 'account'"
:account="result.data"
/>
</CommonScrollIntoView>
</template>

View file

@ -1,23 +0,0 @@
<script setup lang="ts">
</script>
<template>
<span shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip">
<!-- <svg
xmlns="http://www.w3.org/2000/svg" w-full
aspect="1/1" sm:h-8 xl:h-10 sm:w-8 xl:w-10 viewBox="0 0 250 250" fill="none"
> -->
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><defs><mask id="ipTEgg0"><g fill="none" stroke="#fff" stroke-width="4"><circle cx="24" cy="24" r="10" fill="#555555" stroke-linecap="round" stroke-linejoin="round" /><path d="M44 24c0 2.633-.508 5.146-1.433 7.448c-.936 2.331-4.129.071-7.346 3.521c-3.216 3.45-.71 6.267-3.204 7.36A19.9 19.9 0 0 1 24 44C12.954 44 4 35.046 4 24S12.954 4 24 4s20 8.954 20 20Z" /><path stroke-linecap="round" d="M20 25s.21 1.21 1 2s2 1 2 1" /></g></mask></defs><path fill="#ff8d00" d="M0 0h48v48H0z" mask="url(#ipTEgg0)" /></svg>
</span>
</template>
<style scoped>
svg path.wood {
fill: var(--c-primary);
}
svg path.body {
fill: var(--c-text-secondary);
}
</style>

View file

@ -1,11 +0,0 @@
<script setup lang="ts">
defineProps<{
activeClass: string
}>()
</script>
<template>
<NuxtLink to="/bookmarks" :aria-label="$t('nav.bookmarks')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:bookmark-line />
</NuxtLink>
</template>

View file

@ -1,11 +0,0 @@
<script setup lang="ts">
defineProps<{
activeClass: string
}>()
</script>
<template>
<NuxtLink to="/compose" :aria-label="$t('nav.favourites')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:quill-pen-line />
</NuxtLink>
</template>

View file

@ -1,11 +0,0 @@
<script setup lang="ts">
defineProps<{
activeClass: string
}>()
</script>
<template>
<NuxtLink to="/favourites" :aria-label="$t('nav.favourites')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:heart-line />
</NuxtLink>
</template>

View file

@ -1,11 +0,0 @@
<script setup lang="ts">
defineProps<{
activeClass: string
}>()
</script>
<template>
<NuxtLink to="/hashtags" :aria-label="$t('nav.hashtags')" :active-class="activeClass" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:hashtag />
</NuxtLink>
</template>

View file

@ -1,17 +0,0 @@
<script setup lang="ts">
defineProps<{
activeClass: string
}>()
</script>
<template>
<NuxtLink
to="/lists"
:aria-label="$t('nav.lists')"
:active-class="activeClass"
flex flex-row items-center place-content-center h-full flex-1
class="coarse-pointer:select-none" @click="$scrollToTop"
>
<div i-ri:list-check />
</NuxtLink>
</template>

View file

@ -1,102 +0,0 @@
<script setup lang="ts">
import type { GroupedNotifications } from '#shared/types'
const { items } = defineProps<{
items: GroupedNotifications
}>()
const maxVisibleFollows = 5
const follows = computed(() => items.items)
const visibleFollows = computed(() => follows.value.slice(0, maxVisibleFollows))
const count = computed(() => follows.value.length)
const countPlus = computed(() => Math.max(count.value - maxVisibleFollows, 0))
const isExpanded = ref(false)
const lang = computed(() => {
return (count.value > 1 || count.value === 0) ? undefined : items.items[0].status?.language
})
const timeAgoOptions = useTimeAgoOptions(true)
const timeAgoCreatedAt = computed(() => follows.value[0].createdAt)
const timeAgo = useTimeAgo(() => timeAgoCreatedAt.value, timeAgoOptions)
</script>
<template>
<article flex flex-col relative :lang="lang ?? undefined">
<div flex items-center top-0 left-2 pt-2 px-3>
<div :class="count > 1 ? 'i-ri-group-line' : 'i-ri-user-3-line'" me-3 color-blue text-xl aria-hidden="true" />
<template v-if="count > 1">
<AccountHoverWrapper
:account="follows[0].account"
>
<NuxtLink :to="getAccountRoute(follows[0].account)">
<AccountDisplayName
:account="follows[0].account"
text-primary font-bold line-clamp-1 ws-pre-wrap break-all hover:underline
/>
</NuxtLink>
</AccountHoverWrapper>
&nbsp;{{ $t('notification.and') }}&nbsp;
<CommonLocalizedNumber
keypath="notification.others"
:count="count - 1"
text-primary font-bold line-clamp-1 ws-pre-wrap break-all
/>
&nbsp;{{ $t('notification.followed_you') }}
<time text-secondary :datetime="timeAgoCreatedAt">
{{ timeAgo }}
</time>
</template>
<template v-else-if="count === 1">
<NuxtLink :to="getAccountRoute(follows[0].account)">
<AccountDisplayName
:account="follows[0].account"
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all hover:underline
/>
</NuxtLink>
<span me-1 ws-nowrap>
{{ $t('notification.followed_you') }}
<time text-secondary :datetime="timeAgoCreatedAt">
{{ timeAgo }}
</time>
</span>
</template>
</div>
<div pb-2 ps8>
<div
v-if="!isExpanded && count > 1"
flex="~ wrap gap-1.75" p4 items-center cursor-pointer
@click="isExpanded = !isExpanded"
>
<AccountHoverWrapper
v-for="follow in visibleFollows"
:key="follow.id"
:account="follow.account"
>
<NuxtLink :to="getAccountRoute(follow.account)">
<AccountAvatar :account="follow.account" w-12 h-12 />
</NuxtLink>
</AccountHoverWrapper>
<div flex="~ 1" items-center>
<span v-if="countPlus > 0" ps-2 text="base lg">+{{ countPlus }}</span>
<div i-ri:arrow-down-s-line mx-1 text-secondary text-xl aria-hidden="true" />
</div>
</div>
<div v-else>
<div v-if="count > 1" flex p-4 pb-2 cursor-pointer @click="isExpanded = !isExpanded">
<div i-ri:arrow-up-s-line ms-2 text-secondary text-xl aria-hidden="true" />
<span ps-2 text-base>Hide</span>
</div>
<AccountHoverWrapper
v-for="follow in follows"
:key="follow.id"
:account="follow.account"
>
<NuxtLink :to="getAccountRoute(follow.account)" flex gap-4 px-4 py-2>
<AccountAvatar :account="follow.account" w-12 h-12 />
<StatusAccountDetails :account="follow.account" />
</NuxtLink>
</AccountHoverWrapper>
</div>
</div>
</article>
</template>

View file

@ -1,69 +0,0 @@
<script setup lang="ts">
import type { ThemeColors } from '~/composables/settings'
import { THEME_COLORS } from '~/constants'
const themes = await import('~/constants/themes.json').then((r) => {
const map = new Map<'dark' | 'light', [string, ThemeColors][]>([['dark', []], ['light', []]])
const themes = r.default as [string, ThemeColors][]
for (const [key, theme] of themes) {
map.get('dark')!.push([key, theme])
map.get('light')!.push([key, {
...theme,
'--c-primary': `color-mix(in srgb, ${theme['--c-primary']}, black 25%)`,
}])
}
return map
})
const settings = useUserSettings()
const media = useMediaQuery('(prefers-color-scheme: dark)')
const colorMode = useColorMode()
const useThemes = shallowRef<[string, ThemeColors][]>([])
watch(() => colorMode.preference, (cm) => {
const dark = cm === 'dark' || (cm === 'system' && media.value)
const newThemes = dark ? themes.get('dark')! : themes.get('light')!
const key = settings.value.themeColors?.['--theme-color-name'] || THEME_COLORS.defaultTheme
for (const [k, theme] of newThemes) {
if (k === key) {
settings.value.themeColors = theme
break
}
}
useThemes.value = newThemes
}, { immediate: true, flush: 'post' })
const currentTheme = computed(() => settings.value.themeColors?.['--theme-color-name'] || THEME_COLORS.defaultTheme)
function updateTheme(theme: ThemeColors) {
settings.value.themeColors = theme
}
</script>
<template>
<section space-y-2>
<h2 id="interface-tc" font-medium>
{{ $t('settings.interface.theme_color') }}
</h2>
<div flex="~ gap4 wrap" p2 role="group" aria-labelledby="interface-tc">
<button
v-for="[key, theme] in useThemes" :key="key"
:style="{
'--rgb-primary': theme['--rgb-primary'],
'background': theme['--c-primary'],
'--local-ring-color': theme['--c-primary'],
}"
type="button"
:class="currentTheme === theme['--theme-color-name'] ? 'ring-2' : 'scale-90'"
:aria-pressed="currentTheme === theme['--theme-color-name'] ? 'true' : 'false'"
:title="theme['--theme-color-name']"
w-8 h-8 rounded-full transition-all
ring="$local-ring-color offset-3 offset-$c-bg-base"
@click="updateTheme(theme)"
/>
</div>
</section>
</template>

View file

@ -1,20 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineProps<{
account: mastodon.v1.Account
}>()
</script>
<template>
<div
max-h-2xl
flex gap-2
my-auto
p-4 py-2
light:bg-gray-3 dark:bg-gray-8
>
<span z-0>More from</span>
<AccountInlineInfo :account="account" hover:bg-inherit ps-0 ms-0 />
</div>
</template>

View file

@ -1,124 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const { card, smallPictureOnly } = defineProps<{
card: mastodon.v1.PreviewCard
/** For the preview image, only the small image mode is displayed */
smallPictureOnly?: boolean
/** When it is root card in the list, not appear as a child card */
root?: boolean
}>()
// mastodon's default max og image width
const ogImageWidth = 400
const alt = computed(() => `${card.title} - ${card.title}`)
const isSquare = computed(() => (
smallPictureOnly
|| card.width === card.height
|| Number(card.width || 0) < ogImageWidth
|| Number(card.height || 0) < ogImageWidth / 2
))
const providerName = computed(() => card.providerName ? card.providerName : new URL(card.url).hostname)
// TODO: handle card.type: 'photo' | 'video' | 'rich';
const cardTypeIconMap: Record<mastodon.v1.PreviewCardType, string> = {
link: 'i-ri:profile-line',
photo: 'i-ri:image-line',
video: 'i-ri:play-line',
rich: 'i-ri:profile-line',
}
const userSettings = useUserSettings()
const shouldLoadAttachment = ref(!getPreferences(userSettings.value, 'enableDataSaving'))
function loadAttachment() {
shouldLoadAttachment.value = true
}
</script>
<template>
<NuxtLink
block
of-hidden
:to="card.url"
bg-card
hover:bg-active
:class="{
'flex flex-col': isSquare,
'p-4': root,
'rounded-lg': !root,
}"
target="_blank"
external
>
<div :class="isSquare ? 'flex' : ''">
<!-- image -->
<div
v-if="card.image"
flex flex-col
display-block of-hidden
:class="{
'sm:(min-w-32 w-32 h-32) min-w-24 w-24 h-24': isSquare,
'w-full aspect-[1.91]': !isSquare,
'rounded-lg': root,
}"
relative
>
<CommonBlurhash
:blurhash="card.blurhash"
:src="card.image"
:width="card.width"
:height="card.height"
:alt="alt"
:should-load-image="shouldLoadAttachment"
w-full h-full object-cover
:class="!shouldLoadAttachment ? 'brightness-60' : ''"
/>
<button
v-if="!shouldLoadAttachment"
type="button"
absolute
class="status-preview-card-load bg-black/64"
p-2
transition
rounded
hover:bg-black
cursor-pointer
@click.stop.prevent="!shouldLoadAttachment ? loadAttachment() : null"
>
<span
text-sm
text-white
flex flex-col justify-center items-center
gap-3 w-6 h-6
i-ri:file-download-line
/>
</button>
</div>
<div
v-else
min-w-24 w-24 h-24 sm="min-w-32 w-32 h-32" bg="slate-500/10" flex justify-center items-center
:class="[
root ? 'rounded-lg' : '',
]"
>
<div :class="cardTypeIconMap[card.type]" w="30%" h="30%" text-secondary />
</div>
<!-- description -->
<StatusPreviewCardInfo :p="isSquare ? 'x-4' : '4'" :root="root" :card="card" :provider="providerName" />
</div>
<StatusPreviewCardMoreFromAuthor
v-if="card?.authors?.[0]?.account"
:account="card.authors[0].account"
/>
</NuxtLink>
</template>
<style lang="postcss">
.status-preview-card-load {
left: 50%;
top: 50%;
translate: -50% -50%;
}
</style>

View file

@ -1,26 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const { isSupported, effectiveType } = useNetwork()
const isSlow = computed(() => isSupported.value && effectiveType.value && ['slow-2g', '2g', '3g'].includes(effectiveType.value))
const limit = computed(() => isSlow.value ? 10 : 30)
const paginator = useMastoClient().v1.timelines.home.list({ limit: limit.value })
const stream = useStreaming(client => client.user.subscribe())
function reorderAndFilter(items: mastodon.v1.Status[]) {
return reorderedTimeline(items, 'home')
}
let followedTags: mastodon.v1.Tag[] | undefined
if (currentUser.value !== undefined) {
followedTags = (await useMasto().client.value.v1.followedTags.list({ limit: 0 }))
}
</script>
<template>
<div>
<PublishWidgetList draft-key="home" />
<div h="1px" w-auto bg-border mb-3 />
<TimelinePaginator :followed-tags="followedTags" v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="home" />
</div>
</template>

View file

@ -1,20 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const paginator = useMastoClient().v1.timelines.public.list({ limit: 30, local: true })
const stream = useStreaming(client => client.public.local.subscribe())
function reorderAndFilter(items: mastodon.v1.Status[]) {
return reorderedTimeline(items, 'public')
}
let followedTags: mastodon.v1.Tag[] | undefined
if (currentUser.value !== undefined) {
followedTags = (await useMasto().client.value.v1.followedTags.list({ limit: 0 }))
}
</script>
<template>
<div>
<TimelinePaginator :followed-tags="followedTags" v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="public" />
</div>
</template>

View file

@ -1,75 +0,0 @@
import type { MaybeRefOrGetter, RemovableRef } from '@vueuse/core'
import type { UseIDBOptions } from '@vueuse/integrations/useIDBKeyval'
import { del, get, set, update } from '~/utils/elk-idb'
export interface UseAsyncIDBKeyvalReturn<T> {
set: (value: T) => Promise<void>
readIDB: () => Promise<T | undefined>
}
export async function useAsyncIDBKeyval<T>(
key: IDBValidKey,
initialValue: MaybeRefOrGetter<T>,
source: RemovableRef<T>,
options: Omit<UseIDBOptions, 'shallow'> = {},
): Promise<UseAsyncIDBKeyvalReturn<T>> {
const {
flush = 'pre',
deep = true,
writeDefaults = true,
onError = (e: unknown) => {
console.error(e)
},
} = options
const rawInit: T = toValue<T>(initialValue)
try {
const rawValue = await get<T>(key)
if (rawValue === undefined) {
if (rawInit !== undefined && rawInit !== null && writeDefaults) {
await set(key, rawInit)
source.value = rawInit
}
}
else {
source.value = rawValue
}
}
catch (e) {
onError(e)
}
async function write(data: T) {
try {
if (data == null) {
await del(key)
}
else {
// IndexedDB does not support saving proxies, convert from proxy before saving
await update(key, () => toRaw(data))
}
}
catch (e) {
onError(e)
}
}
const {
pause: pauseWatch,
resume: resumeWatch,
} = watchPausable(source, data => write(data), { flush, deep })
async function setData(value: T): Promise<void> {
pauseWatch()
try {
await write(value)
source.value = value
}
finally {
resumeWatch()
}
}
return { set: setData, readIDB: () => get<T>(key) }
}

View file

@ -1,198 +0,0 @@
import type { mastodon } from 'masto'
export interface TranslationResponse {
translatedText: string
detectedLanguage: {
confidence: number
language: string
}
}
// @see https://github.com/LibreTranslate/LibreTranslate/tree/main/libretranslate/locales
export const supportedTranslationCodes = [
'ar',
'az',
'cs',
'da',
'de',
'el',
'en',
'eo',
'es',
'fa',
'fi',
'fr',
'ga',
'he',
'hi',
'hu',
'id',
'it',
'ja',
'ko',
'nl',
'pl',
'pt',
'ru',
'sk',
'sv',
'tr',
'uk',
'vi',
'zh',
] as const
const translationAPISupported = 'Translator' in globalThis && 'LanguageDetector' in globalThis
const anchorMarkupRegEx = /<a[^>]*>.*?<\/a>/g
export function getLanguageCode() {
let code = 'en'
const getCode = (code: string) => code.replace(/-.*$/, '')
if (import.meta.client) {
const { locale } = useI18n()
code = getCode(locale.value ? locale.value : navigator.language)
}
return code
}
interface TranslationErr {
data?: {
error?: string
}
}
function replaceTranslatedLinksWithOriginal(text: string) {
return text.replace(anchorMarkupRegEx, (match) => {
const tagLink = anchorMarkupRegEx.exec(text)
return tagLink ? tagLink[0] : match
})
}
export async function translateText(text: string, from: string | null | undefined, to: string) {
const config = useRuntimeConfig()
const status = ref({
success: false,
error: '',
text: '',
})
try {
const response = await ($fetch as any)(config.public.translateApi, {
method: 'POST',
body: {
q: text,
source: from ?? 'auto',
target: to,
format: 'html',
api_key: '',
},
}) as TranslationResponse
status.value.success = true
status.value.text = replaceTranslatedLinksWithOriginal(response.translatedText)
}
catch (err) {
// TODO: improve type
if ((err as TranslationErr).data?.error)
status.value.error = (err as TranslationErr).data!.error!
else
status.value.error = 'Unknown Error, Please check your console in browser devtool.'
console.error('Translate Post Error: ', err)
}
return status
}
const translations = new WeakMap<mastodon.v1.Status | mastodon.v1.StatusEdit, {
visible: boolean
text: string
success: boolean
error: string
}>()
export async function useTranslation(status: mastodon.v1.Status | mastodon.v1.StatusEdit, to: string) {
if (!translations.has(status))
translations.set(status, reactive({ visible: false, text: '', success: false, error: '' }))
const translation = translations.get(status)!
const userSettings = useUserSettings()
let shouldTranslate = false
if ('language' in status) {
shouldTranslate = typeof status.language === 'string' && status.language !== to && !userSettings.value.disabledTranslationLanguages.includes(status.language)
if (!translationAPISupported) {
shouldTranslate = shouldTranslate && supportedTranslationCodes.includes(to as any)
&& supportedTranslationCodes.includes(status.language as any)
}
else {
shouldTranslate = shouldTranslate && (await (globalThis as any).Translator.availability({
sourceLanguage: status.language,
targetLanguage: to,
})) !== 'unavailable'
}
}
const enabled = /*! !useRuntimeConfig().public.translateApi && */ shouldTranslate
async function toggle() {
if (!shouldTranslate)
return
if (!translation.text) {
let translated = {
value: {
error: '',
text: '',
success: false,
},
}
if (translationAPISupported && 'language' in status) {
let sourceLanguage = status.language
if (!sourceLanguage) {
const languageDetector = await (globalThis as any).LanguageDetector.create()
// Make sure HTML markup doesn't derail language detection.
const div = document.createElement('div')
div.innerHTML = status.content
// eslint-disable-next-line unicorn/prefer-dom-node-text-content
const detectedLanguages = await languageDetector.detect(div.innerText)
sourceLanguage = detectedLanguages[0].detectedLanguage
if (sourceLanguage === 'und') {
throw new Error('Could not detect source language.')
}
}
const translator = await (globalThis as any).Translator.create({
sourceLanguage,
targetLanguage: to,
})
try {
let text = await translator.translate(status.content)
text = replaceTranslatedLinksWithOriginal(text)
translated.value = {
error: '',
text,
success: true,
}
}
catch (error) {
translated.value = {
error: (error as Error).message,
text: '',
success: false,
}
}
}
else {
if ('language' in status) {
translated = await translateText(status.content, status.language, to)
}
}
translation.error = translated.value.error
translation.text = translated.value.text
translation.success = translated.value.success
}
translation.visible = !translation.visible
}
return {
enabled,
toggle,
translation,
}
}

View file

@ -1,44 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const params = useRoute().params
const handle = computed(() => params.account as string)
definePageMeta({ name: 'account-index' })
const { t } = useI18n()
const account = await fetchAccountByHandle(handle.value)
// we need to ensure `pinned === true` on status
// because this prop is appeared only on current account's posts
function applyPinned(statuses: mastodon.v1.Status[]) {
return statuses.map((status) => {
status.pinned = true
return status
})
}
function reorderAndFilter(items: mastodon.v1.Status[]) {
return reorderedTimeline(items, 'account')
}
const pinnedPaginator = useMastoClient().v1.accounts.$select(account.id).statuses.list({ pinned: true })
const postPaginator = useMastoClient().v1.accounts.$select(account.id).statuses.list({ limit: 30, excludeReplies: true })
if (account) {
useHydratedHead({
title: () => `${t('nav.profile')} | ${getDisplayName(account)} (@${account.acct})`,
})
}
</script>
<template>
<div>
<AccountTabs />
<TimelinePaginator :paginator="pinnedPaginator" :preprocess="applyPinned" context="account" :account="account" :end-message="false" />
<!-- Upper border -->
<div h="1px" w-auto bg-border mb-1 />
<TimelinePaginator :paginator="postPaginator" :preprocess="reorderAndFilter" context="account" :account="account" />
</div>
</template>

View file

@ -1,15 +0,0 @@
<script setup lang="ts">
const instance = instanceStorage.value[currentServer.value]
try {
clearError({ redirect: currentUser.value ? '/home' : `/${currentServer.value}/public/local` })
}
catch (err) {
console.error(err)
}
</script>
<template>
<MainContent text-base grid gap-3 m3>
<img v-if="instance !== undefined" rounded-3 :src="instance.thumbnail.url">
</MainContent>
</template>

View file

@ -1,167 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import AccountSearchResult from '~/components/list/AccountSearchResult.vue'
definePageMeta({
name: 'list-accounts',
})
const inputRef = ref<HTMLInputElement>()
defineExpose({
inputRef,
})
const params = useRoute().params
const listId = computed(() => params.list as string)
const mastoListAccounts = useMastoClient().v1.lists.$select(listId.value).accounts
const paginator = mastoListAccounts.list()
// the limit parameter is set to 1000 while masto.js issue is still open: https://github.com/neet/masto.js/issues/1282
const accountsInList = ref((await useMastoClient().v1.lists.$select(listId.value).accounts.list({ limit: 1000 })))
const paginatorRef = ref()
// search stuff
const query = ref('')
const el = ref<HTMLElement>()
const { accounts, loading } = useSearch(query, {
following: true,
})
const { focused } = useFocusWithin(el)
const index = ref(0)
function isInCurrentList(userId: string) {
return accountsInList.value.map(account => account.id).includes(userId)
}
const results = computed(() => {
if (query.value.length === 0)
return []
return [...accounts.value]
})
// Reset index when results change
watch([results, focused], () => index.value = -1)
function addAccount(account: mastodon.v1.Account) {
try {
mastoListAccounts.create({ accountIds: [account.id] })
accountsInList.value.push(account)
paginatorRef.value?.createEntry(account)
}
catch (err) {
console.error(err)
}
}
function removeAccount(account: mastodon.v1.Account) {
try {
mastoListAccounts.remove({ accountIds: [account.id] })
const accountIdsInList = accountsInList.value.map(account => account.id)
const index = accountIdsInList.indexOf(account.id)
if (index > -1) {
accountsInList.value.splice(index, 1)
paginatorRef.value?.removeEntry(account.id)
}
}
catch (err) {
console.error(err)
}
}
</script>
<template>
<!-- Search Accounts You Follow -->
<div ref="el" relative group>
<form
border="t base"
p-4 w-full
flex="~ wrap" relative gap-3
>
<div
bg-base border="~ base" flex-1 h10 ps-1 pe-4 rounded-2 w-full flex="~ row"
items-center relative focus-within:box-shadow-outline gap-3
ps-4
>
<div i-ri:search-2-line pointer-events-none text-secondary mt="1px" class="rtl-flip" />
<input
ref="inputRef"
v-model="query"
bg-transparent
outline="focus:none"
ps-3
rounded-3
pb="1px"
h-full
w-full
placeholder-text-secondary
:placeholder="$t('list.search_following_placeholder')"
@keydown.esc.prevent="inputRef?.blur()"
@keydown.enter.prevent
>
<button v-if="query.length" btn-action-icon text-secondary @click="query = ''; inputRef?.focus()">
<span aria-hidden="true" class="i-ri:close-line" />
</button>
</div>
</form>
<!-- Results -->
<div left-0 top-18 absolute w-full z-10 group-focus-within="pointer-events-auto visible" invisible pointer-events-none>
<div w-full bg-base border="~ dark" rounded-3 max-h-100 overflow-auto :class="results.length === 0 ? 'py2' : null">
<span v-if="query.trim().length === 0" block text-center text-sm text-secondary>
{{ $t('list.search_following_desc') }}
</span>
<template v-else-if="!loading">
<template v-if="results.length > 0">
<div
v-for="(result, i) in results"
:key="result.id"
flex
border="b base"
py2 px4
hover:bg-active justify-between transition-100 items-center
>
<AccountSearchResult
:active="index === parseInt(i.toString())"
:result="result"
:tabindex="focused ? 0 : -1"
/>
<CommonTooltip :content="isInCurrentList(result.id) ? $t('list.remove_account') : $t('list.add_account')">
<button
text-sm p2 border-1 transition-colors
border-dark
btn-action-icon
bg-base
:hover="isInCurrentList(result.id) ? 'text-red' : 'text-green'"
@click=" () => isInCurrentList(result.id) ? removeAccount(result.data) : addAccount(result.data) "
>
<span :class="isInCurrentList(result.id) ? 'i-ri:user-unfollow-line' : 'i-ri:user-add-line'" />
</button>
</CommonTooltip>
</div>
</template>
<span v-else block text-center text-sm text-secondary>
{{ $t('search.search_empty') }}
</span>
</template>
<div v-else>
<SearchResultSkeleton />
<SearchResultSkeleton />
<SearchResultSkeleton />
</div>
</div>
</div>
</div>
<CommonPaginator ref="paginatorRef" :paginator="paginator">
<template #default="{ item }">
<ListAccount
:account="item"
:list="listId"
hover-card
border="b base" py2 px4
/>
</template>
</CommonPaginator>
</template>

View file

@ -1,19 +0,0 @@
<script setup lang="ts">
const { t } = useI18n()
useHydratedHead({
title: () => t('nav.lists'),
})
</script>
<template>
<MainContent>
<template #title>
<NuxtLink to="/lists" timeline-title-style flex items-center gap-2 @click="$scrollToTop">
<div i-ri:list-check />
<span text-lg font-bold>{{ t('nav.lists') }}</span>
</NuxtLink>
</template>
<NuxtPage v-if="isHydrated" />
</MainContent>
</template>

View file

@ -1,144 +0,0 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
definePageMeta({
middleware: 'auth',
})
const { t } = useI18n()
const client = useMastoClient()
const paginator = client.v1.lists.list()
useHydratedHead({
title: () => t('nav.lists'),
})
const paginatorRef = ref()
const inputRef = ref<HTMLInputElement>()
const actionError = ref<string | undefined>(undefined)
const busy = ref<boolean>(false)
const createText = ref('')
const enableSubmit = computed(() => createText.value.length > 0)
async function createList() {
if (busy.value || !enableSubmit.value)
return
busy.value = true
actionError.value = undefined
await nextTick()
try {
const newEntry = await client.v1.lists.create({
title: createText.value,
})
paginatorRef.value?.createEntry(newEntry)
createText.value = ''
}
catch (err) {
console.error(err)
actionError.value = (err as Error).message
nextTick(() => {
inputRef.value?.focus()
})
}
finally {
busy.value = false
}
}
function clearError(focusBtn: boolean) {
actionError.value = undefined
if (focusBtn) {
nextTick(() => {
inputRef.value?.focus()
})
}
}
function updateEntry(list: mastodon.v1.List) {
paginatorRef.value?.updateEntry(list)
}
function removeEntry(id: string) {
paginatorRef.value?.removeEntry(id)
}
onDeactivated(() => clearError(false))
</script>
<template>
<CommonPaginator ref="paginatorRef" :paginator="paginator">
<template #default="{ item }">
<ListEntry
:model-value="item"
@update:model-value="updateEntry"
@list-removed="removeEntry"
/>
</template>
<template #done>
<form
border="t base"
p-4 w-full
flex="~ wrap" relative gap-3
:aria-describedby="actionError ? 'create-list-error' : undefined"
:class="actionError ? 'border border-base border-rounded rounded-be-is-0 rounded-be-ie-0 border-b-unset border-$c-danger-active' : null"
@submit.prevent="createList"
>
<div
bg-base border="~ base" flex-1 h10 ps-1 pe-4 rounded-2 w-full flex="~ row"
items-center relative focus-within:box-shadow-outline gap-3
>
<input
ref="inputRef"
v-model="createText"
bg-transparent
outline="focus:none"
px-4
pb="1px"
flex-1
placeholder-text-secondary
:placeholder="$t('list.list_title_placeholder')"
@keypress.enter="createList"
>
</div>
<div flex="~ col" gap-y-4 gap-x-2 sm="~ justify-between flex-row">
<button flex="~ row" gap-x-2 items-center btn-solid :disabled="!enableSubmit || busy">
<span v-if="busy" aria-hidden="true" block animate animate-spin preserve-3d class="rtl-flip">
<span block i-ri:loader-2-fill aria-hidden="true" />
</span>
<span v-else aria-hidden="true" block i-material-symbols:playlist-add-rounded class="rtl-flip" />
{{ $t('list.create') }}
</button>
</div>
</form>
<CommonErrorMessage
v-if="actionError"
id="create-list-error"
described-by="create-list-failed"
class="rounded-bs-is-0 rounded-bs-ie-0 border-t-dashed m-b-2"
>
<header id="create-list-failed" flex justify-between>
<div flex items-center gap-x-2 font-bold>
<div aria-hidden="true" i-ri:error-warning-fill />
<p>{{ $t('list.error') }}</p>
</div>
<CommonTooltip placement="bottom" :content="$t('list.clear_error')">
<button
flex rounded-4 p1 hover:bg-active cursor-pointer transition-100 :aria-label="$t('list.clear_error')"
@click="clearError(true)"
>
<span aria-hidden="true" w="1.75em" h="1.75em" i-ri:close-line />
</button>
</CommonTooltip>
</header>
<ol ps-2 sm:ps-1>
<li flex="~ col sm:row" gap-y-1 sm:gap-x-2>
<strong sr-only>{{ $t('list.error_prefix') }}</strong>
<span>{{ actionError }}</span>
</li>
</ol>
</CommonErrorMessage>
</template>
</CommonPaginator>
</template>

View file

@ -1,20 +0,0 @@
<script setup lang="ts">
definePageMeta({
middleware: 'auth',
})
const { t } = useI18n()
const { client } = useMasto()
const paginator = client.value.v1.followedTags.list({
limit: 20,
})
useHydratedHead({
title: () => t('nav.hashtags'),
})
</script>
<template>
<TagCardPaginator v-bind="{ paginator }" />
</template>

View file

@ -1,192 +0,0 @@
<script setup lang="ts">
const { t } = useI18n()
useHydratedHead({
title: () => `${t('settings.preferences.label')} | ${t('nav.settings')}`,
})
const userSettings = useUserSettings()
</script>
<template>
<MainContent back-on-small-screen>
<template #title>
<h1 text-lg font-bold flex items-center gap-2 @click="$scrollToTop">
{{ $t('settings.preferences.label') }}
</h1>
</template>
<section>
<h2 px6 py4 mt2 font-bold text-xl flex="~ gap-1" items-center sr-only>
<span aria-hidden="true" block i-ri-equalizer-line />
{{ $t('settings.preferences.label') }}
</h2>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideAltIndicatorOnPosts')"
@click="togglePreferences('hideAltIndicatorOnPosts')"
>
{{ $t('settings.preferences.hide_alt_indi_on_posts') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideGifIndicatorOnPosts')"
@click="togglePreferences('hideGifIndicatorOnPosts')"
>
{{ $t('settings.preferences.hide_gif_indi_on_posts') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideAccountHoverCard')"
@click="togglePreferences('hideAccountHoverCard')"
>
{{ $t('settings.preferences.hide_account_hover_card') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideTagHoverCard')"
@click="togglePreferences('hideTagHoverCard')"
>
{{ $t('settings.preferences.hide_tag_hover_card') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'enableAutoplay')"
:disabled="getPreferences(userSettings, 'enableDataSaving')"
@click="togglePreferences('enableAutoplay')"
>
{{ $t('settings.preferences.enable_autoplay') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'unmuteVideos')"
@click="togglePreferences('unmuteVideos')"
>
{{ $t('settings.preferences.unmute_videos') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'optimizeForLowPerformanceDevice')"
@click="togglePreferences('optimizeForLowPerformanceDevice')"
>
{{ $t('settings.preferences.optimize_for_low_performance_device') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'enableDataSaving')"
@click="togglePreferences('enableDataSaving')"
>
{{ $t("settings.preferences.enable_data_saving") }}
<template #description>
{{ $t("settings.preferences.enable_data_saving_description") }}
</template>
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'enablePinchToZoom')"
@click="togglePreferences('enablePinchToZoom')"
>
{{ $t('settings.preferences.enable_pinch_to_zoom') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'useStarFavoriteIcon')"
@click="togglePreferences('useStarFavoriteIcon')"
>
{{ $t('settings.preferences.use_star_favorite_icon') }}
</SettingsToggleItem>
</section>
<section>
<h2 px6 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
<span aria-hidden="true" block i-ri-hearts-line />
{{ $t('settings.preferences.wellbeing') }}
</h2>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'grayscaleMode')"
@click="togglePreferences('grayscaleMode')"
>
{{ $t('settings.preferences.grayscale_mode') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideBoostCount')"
@click="togglePreferences('hideBoostCount')"
>
{{ $t('settings.preferences.hide_boost_count') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideFavoriteCount')"
@click="togglePreferences('hideFavoriteCount')"
>
{{ $t('settings.preferences.hide_favorite_count') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideReplyCount')"
@click="togglePreferences('hideReplyCount')"
>
{{ $t('settings.preferences.hide_reply_count') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideFollowerCount')"
@click="togglePreferences('hideFollowerCount')"
>
{{ $t('settings.preferences.hide_follower_count') }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideUsernameEmojis')"
@click="togglePreferences('hideUsernameEmojis')"
>
{{ $t("settings.preferences.hide_username_emojis") }}
<template #description>
{{ $t('settings.preferences.hide_username_emojis_description') }}
</template>
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'hideNews')"
@click="togglePreferences('hideNews')"
>
{{ $t("settings.preferences.hide_news") }}
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'zenMode')"
@click="togglePreferences('zenMode')"
>
{{ $t("settings.preferences.zen_mode") }}
<template #description>
{{ $t('settings.preferences.zen_mode_description') }}
</template>
</SettingsToggleItem>
</section>
<section>
<h2 px6 py4 mt2 font-bold text-xl flex="~ gap-1" items-center>
<span aria-hidden="true" block i-ri-flask-line />
{{ $t('settings.preferences.title') }}
</h2>
<!-- Embedded Media -->
<SettingsToggleItem
:checked="getPreferences(userSettings, 'experimentalEmbeddedMedia')"
@click="togglePreferences('experimentalEmbeddedMedia')"
>
{{ $t('settings.preferences.embedded_media') }}
<template #description>
{{ $t('settings.preferences.embedded_media_description') }}
</template>
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'experimentalVirtualScroller')"
@click="togglePreferences('experimentalVirtualScroller')"
>
{{ $t('settings.preferences.virtual_scroll') }}
<template #description>
{{ $t('settings.preferences.virtual_scroll_description') }}
</template>
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'experimentalGitHubCards')"
@click="togglePreferences('experimentalGitHubCards')"
>
{{ $t('settings.preferences.github_cards') }}
<template #description>
{{ $t('settings.preferences.github_cards_description') }}
</template>
</SettingsToggleItem>
<SettingsToggleItem
:checked="getPreferences(userSettings, 'experimentalUserPicker')"
@click="togglePreferences('experimentalUserPicker')"
>
{{ $t('settings.preferences.user_picker') }}
<template #description>
{{ $t('settings.preferences.user_picker_description') }}
</template>
</SettingsToggleItem>
</section>
</MainContent>
</template>

View file

@ -1,111 +0,0 @@
import type { UserLogin } from '#shared/types'
import { useAsyncIDBKeyval } from '~/composables/idb'
import { STORAGE_KEY_USERS } from '~/constants'
const mock = process.mock
export default defineNuxtPlugin({
enforce: 'pre',
parallel: import.meta.server,
async setup() {
const users = useUsers()
let defaultUsers = mock ? [mock.user] : []
// Backward compatibility with localStorage
let removeUsersOnLocalStorage = false
if (globalThis?.localStorage) {
const usersOnLocalStorageString = globalThis.localStorage.getItem(STORAGE_KEY_USERS)
if (usersOnLocalStorageString) {
defaultUsers = JSON.parse(usersOnLocalStorageString)
removeUsersOnLocalStorage = true
}
}
if (import.meta.server) {
users.value = defaultUsers
}
if (removeUsersOnLocalStorage)
globalThis.localStorage.removeItem(STORAGE_KEY_USERS)
let callback = noop
// when multiple tabs: we need to reload window when sign in, switch account or sign out
if (import.meta.client) {
// prevent reloading on the first visit
const initialLoad = ref(true)
callback = () => (initialLoad.value = false)
const { readIDB } = await useAsyncIDBKeyval<UserLogin[]>(STORAGE_KEY_USERS, defaultUsers, users)
function reload() {
setTimeout(() => {
window.location.reload()
}, 0)
}
debouncedWatch(
() => [currentUserHandle.value, users.value.length] as const,
async ([handle, currentUsers], old) => {
if (initialLoad.value) {
return
}
const oldHandle = old?.[0]
// read database users: it is not reactive
const dbUsers = await readIDB()
const numberOfUsers = dbUsers?.length || 0
// sign in or sign out
if (currentUsers !== numberOfUsers) {
reload()
return
}
let sameAcct: boolean
// 1. detect account switching
if (oldHandle) {
sameAcct = handle === oldHandle
}
else {
const acct = currentUser.value?.account?.acct
// 2. detect sign-in?
sameAcct = !acct || acct === handle
}
if (!sameAcct) {
reload()
}
},
{ debounce: 450, flush: 'post', immediate: true },
)
}
const { params, query } = useRoute()
publicServer.value = params.server as string || useRuntimeConfig().public.defaultServer
const masto = createMasto()
const user = (typeof query.server === 'string' && typeof query.token === 'string')
? {
server: query.server,
token: query.token,
vapidKey: typeof query.vapid_key === 'string' ? query.vapid_key : undefined,
}
: (currentUser.value || { server: publicServer.value })
if (import.meta.client) {
loginTo(masto, user).finally(callback)
}
return {
provide: {
masto,
},
}
},
})

View file

@ -1,18 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
const { account } = defineProps<{ defineProps<{
account: mastodon.v1.Account account: mastodon.v1.Account
square?: boolean square?: boolean
}>() }>()
const loaded = ref(false) const loaded = ref(false)
const error = ref(false) const error = ref(false)
const preferredMotion = usePreferredReducedMotion()
const accountAvatarSrc = computed(() => {
return preferredMotion.value === 'reduce' ? (account?.avatarStatic ?? account.avatar) : account.avatar
})
</script> </script>
<template> <template>
@ -21,10 +16,10 @@ const accountAvatarSrc = computed(() => {
width="400" width="400"
height="400" height="400"
select-none select-none
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : accountAvatarSrc" :src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : account.avatar"
:alt="$t('account.avatar_description', [account.username])" :alt="$t('account.avatar_description', [account.username])"
loading="lazy" loading="lazy"
class="account-avatar object-cover" class="account-avatar"
:class="(loaded ? 'bg-base' : 'bg-gray:10') + (square ? ' ' : ' rounded-full')" :class="(loaded ? 'bg-base' : 'bg-gray:10') + (square ? ' ' : ' rounded-full')"
:style="{ 'clip-path': square ? `url(#avatar-mask)` : 'none' }" :style="{ 'clip-path': square ? `url(#avatar-mask)` : 'none' }"
v-bind="$attrs" v-bind="$attrs"

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
defineOptions({ defineOptions({

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
const { hideEmojis = false } = defineProps<{ const { account, hideEmojis = false } = defineProps<{
account: mastodon.v1.Account account: mastodon.v1.Account
hideEmojis?: boolean hideEmojis?: boolean
}>() }>()

View file

@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
import { toggleFollowAccount, useRelationship } from '~/composables/masto/relationship' import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
const { account, context, command, ...props } = defineProps<{ const { account, command, context, ...props } = defineProps<{
account: mastodon.v1.Account account: mastodon.v1.Account
relationship?: mastodon.v1.Relationship relationship?: mastodon.v1.Relationship
context?: 'followedBy' | 'following' context?: 'followedBy' | 'following'

View file

@ -189,6 +189,7 @@ async function copyAccountName() {
<div flex="~ col gap1" pt2> <div flex="~ col gap1" pt2>
<div flex gap2 items-center flex-wrap> <div flex gap2 items-center flex-wrap>
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl /> <AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" />
<AccountLockIndicator v-if="account.locked" show-label /> <AccountLockIndicator v-if="account.locked" show-label />
<AccountBotIndicator v-if="account.bot" show-label /> <AccountBotIndicator v-if="account.bot" show-label />
</div> </div>
@ -201,9 +202,6 @@ async function copyAccountName() {
</button> </button>
</CommonTooltip> </CommonTooltip>
</div> </div>
<div self-start mt-1>
<AccountRolesIndicator v-if="account.roles?.length" :account="account" />
</div>
</div> </div>
</div> </div>
<label <label

View file

@ -12,7 +12,7 @@ const relationship = useRelationship(account)
<div v-show="relationship" flex="~ col gap2" rounded min-w-90 max-w-120 z-100 overflow-hidden p-4> <div v-show="relationship" flex="~ col gap2" rounded min-w-90 max-w-120 z-100 overflow-hidden p-4>
<div flex="~ gap2" items-center> <div flex="~ gap2" items-center>
<NuxtLink :to="getAccountRoute(account)" flex-auto rounded-full hover:bg-active transition-100 pe5 me-a> <NuxtLink :to="getAccountRoute(account)" flex-auto rounded-full hover:bg-active transition-100 pe5 me-a>
<AccountInfo :account="account" :hover-card="false" /> <AccountInfo :account="account" />
</NuxtLink> </NuxtLink>
<AccountFollowButton text-sm :account="account" :relationship="relationship" /> <AccountFollowButton text-sm :account="account" :relationship="relationship" />
</div> </div>

View file

@ -5,7 +5,7 @@ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}) })
const { as = 'div' } = defineProps<{ const { account, as = 'div' } = defineProps<{
account: mastodon.v1.Account account: mastodon.v1.Account
as?: string as?: string
hoverCard?: boolean hoverCard?: boolean
@ -16,20 +16,18 @@ const { as = 'div' } = defineProps<{
<!-- TODO: Make this work for both buttons and links --> <!-- TODO: Make this work for both buttons and links -->
<!-- This is sometimes (like in the sidebar) used directly as a button, and sometimes, like in follow notifications, as a link. I think this component may need a second refactor that either lets an implementation pass in a link or an action and adapt to what's passed in, or the implementations need to be updated to wrap in the action they want to take and this be just the layout for these items --> <!-- This is sometimes (like in the sidebar) used directly as a button, and sometimes, like in follow notifications, as a link. I think this component may need a second refactor that either lets an implementation pass in a link or an action and adapt to what's passed in, or the implementations need to be updated to wrap in the action they want to take and this be just the layout for these items -->
<template> <template>
<component :is="as" flex items-center gap-3 v-bind="$attrs"> <component :is="as" flex gap-3 v-bind="$attrs">
<AccountHoverWrapper :disabled="!hoverCard" :account="account"> <AccountHoverWrapper :disabled="!hoverCard" :account="account">
<AccountBigAvatar :account="account" shrink-0 :square="square" /> <AccountBigAvatar :account="account" shrink-0 :square="square" />
</AccountHoverWrapper> </AccountHoverWrapper>
<div flex="~ col" shrink h-full overflow-hidden justify-center leading-none select-none p-1> <div flex="~ col" shrink pt-1 h-full overflow-hidden justify-center leading-none select-none>
<div flex="~" gap-2> <div flex="~" gap-2>
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg /> <AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
<AccountLockIndicator v-if="account.locked" text-xs /> <AccountLockIndicator v-if="account.locked" text-xs />
<AccountBotIndicator v-if="account.bot" text-xs /> <AccountBotIndicator v-if="account.bot" text-xs />
</div> </div>
<AccountHandle :account="account" text-secondary-light /> <AccountHandle :account="account" text-secondary-light />
<div self-start mt-1>
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
</div>
</div> </div>
</component> </component>
</template> </template>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~/composables/masto/relationship' import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~~/composables/masto/relationship'
const { account } = defineProps<{ const { account } = defineProps<{
account: mastodon.v1.Account account: mastodon.v1.Account
@ -56,7 +56,7 @@ async function removeUserNote() {
<template> <template>
<CommonDropdown :eager-mount="command"> <CommonDropdown :eager-mount="command">
<button flex gap-1 items-center w-full rounded op75 hover="op100 text-purple" group :aria-label="t('actions.more')"> <button flex gap-1 items-center w-full rounded op75 hover="op100 text-purple" group aria-label="More actions">
<div rounded-5 p2 elk-group-hover="bg-purple/10"> <div rounded-5 p2 elk-group-hover="bg-purple/10">
<div i-ri:more-2-fill /> <div i-ri:more-2-fill />
</div> </div>
@ -71,7 +71,6 @@ async function removeUserNote() {
/> />
</NuxtLink> </NuxtLink>
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="isShareSupported" v-if="isShareSupported"
:text="$t('menu.share_account', [`@${account.acct}`])" :text="$t('menu.share_account', [`@${account.acct}`])"
icon="i-ri:share-line" icon="i-ri:share-line"
@ -82,14 +81,12 @@ async function removeUserNote() {
<template v-if="currentUser"> <template v-if="currentUser">
<template v-if="!isSelf"> <template v-if="!isSelf">
<CommonDropdownItem <CommonDropdownItem
is="button"
:text="$t('menu.mention_account', [`@${account.acct}`])" :text="$t('menu.mention_account', [`@${account.acct}`])"
icon="i-ri:at-line" icon="i-ri:at-line"
:command="command" :command="command"
@click="mentionUser(account)" @click="mentionUser(account)"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
:text="$t('menu.direct_message_account', [`@${account.acct}`])" :text="$t('menu.direct_message_account', [`@${account.acct}`])"
icon="i-ri:message-3-line" icon="i-ri:message-3-line"
:command="command" :command="command"
@ -97,7 +94,6 @@ async function removeUserNote() {
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="!relationship?.showingReblogs" v-if="!relationship?.showingReblogs"
icon="i-ri:repeat-line" icon="i-ri:repeat-line"
:text="$t('menu.show_reblogs', [`@${account.acct}`])" :text="$t('menu.show_reblogs', [`@${account.acct}`])"
@ -105,7 +101,6 @@ async function removeUserNote() {
@click="toggleReblogs()" @click="toggleReblogs()"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-else v-else
:text="$t('menu.hide_reblogs', [`@${account.acct}`])" :text="$t('menu.hide_reblogs', [`@${account.acct}`])"
icon="i-ri:repeat-line" icon="i-ri:repeat-line"
@ -114,7 +109,6 @@ async function removeUserNote() {
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="!relationship?.note || relationship?.note?.length === 0" v-if="!relationship?.note || relationship?.note?.length === 0"
:text="$t('menu.add_personal_note', [`@${account.acct}`])" :text="$t('menu.add_personal_note', [`@${account.acct}`])"
icon="i-ri-edit-2-line" icon="i-ri-edit-2-line"
@ -122,7 +116,6 @@ async function removeUserNote() {
@click="addUserNote()" @click="addUserNote()"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-else v-else
:text="$t('menu.remove_personal_note', [`@${account.acct}`])" :text="$t('menu.remove_personal_note', [`@${account.acct}`])"
icon="i-ri-edit-2-line" icon="i-ri-edit-2-line"
@ -131,7 +124,6 @@ async function removeUserNote() {
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="!relationship?.muting" v-if="!relationship?.muting"
:text="$t('menu.mute_account', [`@${account.acct}`])" :text="$t('menu.mute_account', [`@${account.acct}`])"
icon="i-ri:volume-mute-line" icon="i-ri:volume-mute-line"
@ -139,7 +131,6 @@ async function removeUserNote() {
@click="toggleMuteAccount (relationship!, account)" @click="toggleMuteAccount (relationship!, account)"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-else v-else
:text="$t('menu.unmute_account', [`@${account.acct}`])" :text="$t('menu.unmute_account', [`@${account.acct}`])"
icon="i-ri:volume-up-fill" icon="i-ri:volume-up-fill"
@ -148,7 +139,6 @@ async function removeUserNote() {
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="!relationship?.blocking" v-if="!relationship?.blocking"
:text="$t('menu.block_account', [`@${account.acct}`])" :text="$t('menu.block_account', [`@${account.acct}`])"
icon="i-ri:forbid-2-line" icon="i-ri:forbid-2-line"
@ -156,7 +146,6 @@ async function removeUserNote() {
@click="toggleBlockAccount (relationship!, account)" @click="toggleBlockAccount (relationship!, account)"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-else v-else
:text="$t('menu.unblock_account', [`@${account.acct}`])" :text="$t('menu.unblock_account', [`@${account.acct}`])"
icon="i-ri:checkbox-circle-line" icon="i-ri:checkbox-circle-line"
@ -166,7 +155,6 @@ async function removeUserNote() {
<template v-if="getServerName(account) !== currentServer"> <template v-if="getServerName(account) !== currentServer">
<CommonDropdownItem <CommonDropdownItem
is="button"
v-if="!relationship?.domainBlocking" v-if="!relationship?.domainBlocking"
:text="$t('menu.block_domain', [getServerName(account)])" :text="$t('menu.block_domain', [getServerName(account)])"
icon="i-ri:shut-down-line" icon="i-ri:shut-down-line"
@ -174,7 +162,6 @@ async function removeUserNote() {
@click="toggleBlockDomain(relationship!, account)" @click="toggleBlockDomain(relationship!, account)"
/> />
<CommonDropdownItem <CommonDropdownItem
is="button"
v-else v-else
:text="$t('menu.unblock_domain', [getServerName(account)])" :text="$t('menu.unblock_domain', [getServerName(account)])"
icon="i-ri:restart-line" icon="i-ri:restart-line"
@ -184,7 +171,6 @@ async function removeUserNote() {
</template> </template>
<CommonDropdownItem <CommonDropdownItem
is="button"
:text="$t('menu.report_account', [`@${account.acct}`])" :text="$t('menu.report_account', [`@${account.acct}`])"
icon="i-ri:flag-2-line" icon="i-ri:flag-2-line"
:command="command" :command="command"

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
const { account, context } = defineProps<{ const { paginator, account, context } = defineProps<{
paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined> paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined>
context?: 'following' | 'followers' context?: 'following' | 'followers'
account?: mastodon.v1.Account account?: mastodon.v1.Account

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CommonRouteTabOption } from '#shared/types' import type { CommonRouteTabOption } from '~/types'
const { t } = useI18n() const { t } = useI18n()
const route = useRoute() const route = useRoute()

View file

@ -5,7 +5,7 @@ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}) })
const { tagName } = defineProps<{ const { tagName, disabled } = defineProps<{
tagName?: string tagName?: string
disabled?: boolean disabled?: boolean
}>() }>()

View file

@ -38,14 +38,12 @@ onMounted(() => {
announce(t('a11y.loading_page')) announce(t('a11y.loading_page'))
}) })
router.afterEach((to, from) => { router.afterEach((to, from) => {
if (from) { from && setTimeout(() => {
setTimeout(() => { requestAnimationFrame(() => {
requestAnimationFrame(() => { const title = document.title.trim().split('|')
const title = document.title.trim().split('|') announce(t('a11y.route_loaded', [title[0]]))
announce(t('a11y.route_loaded', [title[0]])) })
}) }, 512)
}, 512)
}
}) })
}) })
</script> </script>

View file

@ -1,16 +1,17 @@
<script setup lang="ts"> <script setup lang="ts">
import type { AriaLive } from '~/composables/aria' import type { AriaLive } from '~/composables/aria'
const { // tsc complaining when using $defineProps
ariaLive = 'polite', withDefaults(defineProps<{
heading = 'h2',
messageKey = (message: any) => message,
} = defineProps<{
ariaLive?: AriaLive
heading?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
title: string title: string
ariaLive?: AriaLive
messageKey?: (message: any) => any messageKey?: (message: any) => any
}>() heading?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
}>(), {
heading: 'h2',
messageKey: (message: any) => message,
ariaLive: 'polite',
})
const { announceLogs, appendLogs, clearLogs, logs } = useAriaLog() const { announceLogs, appendLogs, clearLogs, logs } = useAriaLog()

View file

@ -1,9 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import type { AriaLive } from '~/composables/aria' import type { AriaLive } from '~/composables/aria'
const { ariaLive = 'polite' } = defineProps<{ // tsc complaining when using $defineProps
withDefaults(defineProps<{
ariaLive?: AriaLive ariaLive?: AriaLive
}>() }>(), {
ariaLive: 'polite',
})
const { announceStatus, clearStatus, status } = useAriaStatus() const { announceStatus, clearStatus, status } = useAriaStatus()

View file

@ -1,7 +1,11 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { ResolvedCommand } from '~/composables/command' import type { ResolvedCommand } from '~/composables/command'
const { active = false } = defineProps<{ const {
cmd,
index,
active = false,
} = defineProps<{
cmd: ResolvedCommand cmd: ResolvedCommand
index: number index: number
active?: boolean active?: boolean

View file

@ -1,11 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
const { name } = defineProps<{ const props = defineProps<{
name: string name: string
}>() }>()
const isMac = useIsMac() const isMac = useIsMac()
const keys = computed(() => name.toLowerCase().split('+')) const keys = computed(() => props.name.toLowerCase().split('+'))
</script> </script>
<template> <template>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
import type { SearchResult as SearchResultType } from '~/composables/masto/search' import type { SearchResult as SearchResultType } from '~/composables/masto/search'
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
const emit = defineEmits<{ const emit = defineEmits<{
(event: 'close'): void (event: 'close'): void

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> <script lang="ts" setup>
const emit = defineEmits<{ const emit = defineEmits<{
(event: 'close'): void (event: 'close'): void
}>() }>()

View file

@ -3,7 +3,7 @@ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}) })
const { blurhash = '', shouldLoadImage = true } = defineProps<{ const { blurhash = '', src, srcset, shouldLoadImage = true } = defineProps<{
blurhash?: string blurhash?: string
src: string src: string
srcset?: string srcset?: string

View file

@ -1,20 +1,27 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { Boundaries } from 'vue-advanced-cropper' import type { Boundaries } from 'vue-advanced-cropper'
import { Cropper } from 'vue-advanced-cropper' import { Cropper } from 'vue-advanced-cropper'
import 'vue-advanced-cropper/dist/style.css' import 'vue-advanced-cropper/dist/style.css'
const { stencilAspectRatio = 1 / 1, stencilSizePercentage = 0.9 } = defineProps<{ export interface Props {
/** Crop frame aspect ratio (width/height), default 1/1 */ /** Crop frame aspect ratio (width/height), default 1/1 */
stencilAspectRatio?: number stencilAspectRatio?: number
/** The ratio of the longest edge of the cut box to the length of the cut screen, default 0.9, not more than 1 */ /** The ratio of the longest edge of the cut box to the length of the cut screen, default 0.9, not more than 1 */
stencilSizePercentage?: number stencilSizePercentage?: number
}>() }
const props = withDefaults(defineProps<Props>(), {
stencilAspectRatio: 1 / 1,
stencilSizePercentage: 0.9,
})
const file = defineModel<File | null>() const file = defineModel<File | null>()
const cropperDialog = ref(false) const cropperDialog = ref(false)
const cropper = ref<InstanceType<typeof Cropper>>() const cropper = ref<InstanceType<typeof Cropper>>()
const cropperFlag = ref(false) const cropperFlag = ref(false)
const cropperImage = reactive({ const cropperImage = reactive({
src: '', src: '',
type: 'image/jpg', type: 'image/jpg',
@ -22,8 +29,8 @@ const cropperImage = reactive({
function stencilSize({ boundaries }: { boundaries: Boundaries }) { function stencilSize({ boundaries }: { boundaries: Boundaries }) {
return { return {
width: boundaries.width * stencilSizePercentage, width: boundaries.width * props.stencilSizePercentage,
height: boundaries.height * stencilSizePercentage, height: boundaries.height * props.stencilSizePercentage,
} }
} }
@ -75,7 +82,7 @@ function cropImage() {
}" }"
:stencil-size="stencilSize" :stencil-size="stencilSize"
:stencil-props="{ :stencil-props="{
aspectRatio: stencilAspectRatio, aspectRatio: props.stencilAspectRatio,
movable: false, movable: false,
resizable: false, resizable: false,
handlers: {}, handlers: {},

View file

@ -1,22 +1,22 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { FileWithHandle } from 'browser-fs-access'
import { fileOpen } from 'browser-fs-access' import { fileOpen } from 'browser-fs-access'
import type { FileWithHandle } from 'browser-fs-access'
const { const props = withDefaults(defineProps<{
original,
allowedFileTypes = ['image/jpeg', 'image/png'],
allowedFileSize = 1024 * 1024 * 5, // 5 MB
} = defineProps<{
/** The image src before change */ /** The image src before change */
original?: string original?: string
/** Allowed file types */ /** Allowed file types */
allowedFileTypes?: string[] allowedFileTypes?: string[]
/** Allowed file size */ /** Allowed file size */
allowedFileSize?: number allowedFileSize?: number
imgClass?: string
loading?: boolean
}>()
imgClass?: string
loading?: boolean
}>(), {
allowedFileTypes: () => ['image/jpeg', 'image/png'],
allowedFileSize: 1024 * 1024 * 5, // 5 MB
})
const emit = defineEmits<{ const emit = defineEmits<{
(event: 'pick', value: FileWithHandle): void (event: 'pick', value: FileWithHandle): void
(event: 'error', code: number, message: string): void (event: 'error', code: number, message: string): void
@ -26,7 +26,7 @@ const file = defineModel<FileWithHandle | null>()
const { t } = useI18n() const { t } = useI18n()
const defaultImage = computed(() => original || '') const defaultImage = computed(() => props.original || '')
/** Preview of selected images */ /** Preview of selected images */
const previewImage = ref('') const previewImage = ref('')
/** The current images on display */ /** The current images on display */
@ -37,14 +37,14 @@ async function pickImage() {
return return
const image = await fileOpen({ const image = await fileOpen({
description: 'Image', description: 'Image',
mimeTypes: allowedFileTypes, mimeTypes: props.allowedFileTypes,
}) })
if (!allowedFileTypes.includes(image.type)) { if (!props.allowedFileTypes.includes(image.type)) {
emit('error', 1, t('error.unsupported_file_format')) emit('error', 1, t('error.unsupported_file_format'))
return return
} }
else if (image.size > allowedFileSize) { else if (image.size > props.allowedFileSize) {
emit('error', 2, t('error.file_size_cannot_exceed_n_mb', [5])) emit('error', 2, t('error.file_size_cannot_exceed_n_mb', [5]))
return return
} }

View file

@ -2,7 +2,7 @@
const { const {
zIndex = 100, zIndex = 100,
background = 'transparent', background = 'transparent',
} = defineProps<{ } = $defineProps<{
zIndex?: number zIndex?: number
background?: string background?: string
}>() }>()

View file

@ -1,15 +1,16 @@
<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'
import type { UnwrapRef } from 'vue'
const { const {
paginator, paginator,
keyProp = 'id',
virtualScroller = false,
stream, stream,
eventType, eventType,
keyProp = 'id',
virtualScroller = false,
preprocess, preprocess,
endMessage = true, endMessage = true,
} = defineProps<{ } = defineProps<{
@ -32,7 +33,7 @@ defineSlots<{
newer: U // newer is undefined when index === 0 newer: U // newer is undefined when index === 0
}) => void }) => void
items: (props: { items: (props: {
items: U[] items: UnwrapRef<U[]>
}) => void }) => void
updater: (props: { updater: (props: {
number: number number: number
@ -73,7 +74,7 @@ defineExpose({ createEntry, removeEntry, updateEntry })
<template> <template>
<div> <div>
<slot v-if="prevItems.length" name="updater" v-bind="{ number: prevItems.length, update }" /> <slot v-if="prevItems.length" name="updater" v-bind="{ number: prevItems.length, update }" />
<slot name="items" :items="items as U[]"> <slot name="items" :items="items">
<template v-if="virtualScroller"> <template v-if="virtualScroller">
<DynamicScroller <DynamicScroller
v-slot="{ item, active, index }" v-slot="{ item, active, index }"

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { CommonRouteTabMoreOption, CommonRouteTabOption } from '#shared/types' import type { CommonRouteTabMoreOption, CommonRouteTabOption } from '~/types'
const { options, command, preventScrollTop = false } = defineProps<{ const { options, command, replace, preventScrollTop = false, moreOptions } = defineProps<{
options: CommonRouteTabOption[] options: CommonRouteTabOption[]
moreOptions?: CommonRouteTabMoreOption moreOptions?: CommonRouteTabMoreOption
command?: boolean command?: boolean
@ -14,11 +14,11 @@ const router = useRouter()
useCommands(() => command useCommands(() => command
? options.map(tab => ({ ? options.map(tab => ({
scope: 'Tabs', scope: 'Tabs',
name: tab.display, name: tab.display,
icon: tab.icon ?? 'i-ri:file-list-2-line', icon: tab.icon ?? 'i-ri:file-list-2-line',
onActivate: () => router.replace(tab.to), onActivate: () => router.replace(tab.to),
})) }))
: []) : [])
</script> </script>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
const { as = 'div', active } = defineProps<{ const { as = 'div', active } = defineProps<{
as?: string as: any
active: boolean active: boolean
}>() }>()

View file

@ -20,18 +20,18 @@ const tabs = computed(() => {
}) })
function toValidName(option: string) { function toValidName(option: string) {
return option.toLowerCase().replace(/[^a-z0-9]/gi, '-') return option.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
} }
useCommands(() => command useCommands(() => command
? tabs.value.map(tab => ({ ? tabs.value.map(tab => ({
scope: 'Tabs', scope: 'Tabs',
name: tab.display, name: tab.display,
icon: tab.icon ?? 'i-ri:file-list-2-line', icon: tab.icon ?? 'i-ri:file-list-2-line',
onActivate: () => modelValue.value = tab.name, onActivate: () => modelValue.value = tab.name,
})) }))
: []) : [])
</script> </script>

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
const { const {

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> <script lang="ts" setup>
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
import sparkline from '@fnando/sparkline' import sparkline from '@fnando/sparkline'

View file

@ -3,16 +3,16 @@ defineOptions({
inheritAttrs: false, inheritAttrs: false,
}) })
const { count } = defineProps<{ const props = defineProps<{
count: number count: number
keypath: string keypath: string
}>() }>()
const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumber() const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumber()
const useSR = computed(() => forSR(count)) const useSR = computed(() => forSR(props.count))
const rawNumber = computed(() => formatNumber(count)) const rawNumber = computed(() => formatNumber(props.count))
const humanReadableNumber = computed(() => formatHumanReadableNumber(count)) const humanReadableNumber = computed(() => formatHumanReadableNumber(props.count))
</script> </script>
<template> <template>

View file

@ -1,23 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
const { const props = withDefaults(defineProps<{
is = 'div',
text,
description,
icon,
command,
} = defineProps<{
is?: string is?: string
text?: string text?: string
description?: string description?: string
icon?: string icon?: string
checked?: boolean checked?: boolean
command?: boolean command?: boolean
}>() }>(), {
is: 'div',
})
const emit = defineEmits(['click']) const emit = defineEmits(['click'])
const type = computed(() => is === 'button' ? 'button' : null)
const { hide } = useDropdownContext() || {} const { hide } = useDropdownContext() || {}
const el = ref<HTMLDivElement>() const el = ref<HTMLDivElement>()
@ -31,11 +24,11 @@ useCommand({
scope: 'Actions', scope: 'Actions',
order: -1, order: -1,
visible: () => command && text, visible: () => props.command && props.text,
name: () => text!, name: () => props.text!,
icon: () => icon ?? 'i-ri:question-line', icon: () => props.icon ?? 'i-ri:question-line',
description: () => description, description: () => props.description,
onActivate() { onActivate() {
const clickEvent = new MouseEvent('click', { const clickEvent = new MouseEvent('click', {
@ -53,7 +46,6 @@ useCommand({
v-bind="$attrs" v-bind="$attrs"
:is="is" :is="is"
ref="el" ref="el"
:type="type"
w-full w-full
flex gap-3 items-center cursor-pointer px4 py3 flex gap-3 items-center cursor-pointer px4 py3
select-none select-none

View file

@ -1,10 +1,10 @@
<script setup lang="ts"> <script setup lang="ts">
const { code, lang } = defineProps<{ const props = defineProps<{
code: string code: string
lang?: string lang?: string
}>() }>()
const raw = computed(() => decodeURIComponent(code).replace(/&#39;/g, '\'')) const raw = computed(() => decodeURIComponent(props.code).replace(/&#39;/g, '\''))
const langMap: Record<string, string> = { const langMap: Record<string, string> = {
js: 'javascript', js: 'javascript',
@ -13,7 +13,7 @@ const langMap: Record<string, string> = {
} }
const highlighted = computed(() => { const highlighted = computed(() => {
return lang ? highlightCode(raw.value, (langMap[lang] || lang) as any) : raw return props.lang ? highlightCode(raw.value, (langMap[props.lang] || props.lang) as any) : raw
}) })
</script> </script>

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
defineProps<{ const { paginator } = defineProps<{
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams> paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
}>() }>()

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
const { alt, dataEmojiId } = defineProps<{ const { as, alt, dataEmojiId } = defineProps<{
as: string as: string
alt?: string alt?: string
dataEmojiId?: string dataEmojiId?: string

View file

@ -8,7 +8,7 @@ const vAutoFocus = (el: HTMLElement) => el.focus()
<template> <template>
<div my-8 px-3 sm:px-8 md:max-w-200 flex="~ col gap-4" relative> <div my-8 px-3 sm:px-8 md:max-w-200 flex="~ col gap-4" relative>
<button v-auto-focus type="button" btn-action-icon absolute top--8 right-0 m1 :aria-label="$t('action.close')" @click="emit('close')"> <button v-auto-focus type="button" btn-action-icon absolute top--8 right-0 m1 aria-label="Close" @click="emit('close')">
<span i-ri:close-line /> <span i-ri:close-line />
</button> </button>

View file

@ -15,10 +15,9 @@ const isRemoved = ref(false)
async function edit() { async function edit() {
try { try {
if (isRemoved.value) isRemoved.value
await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] }) ? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
else : await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
isRemoved.value = !isRemoved.value isRemoved.value = !isRemoved.value
} }
catch (err) { catch (err) {
@ -44,7 +43,6 @@ async function edit() {
<button <button
text-sm p2 border-1 transition-colors text-sm p2 border-1 transition-colors
border-dark border-dark
bg-base
btn-action-icon btn-action-icon
@click="edit" @click="edit"
> >

View file

@ -1,4 +1,4 @@
<script setup lang="ts"> <script lang="ts" setup>
const { userId } = defineProps<{ const { userId } = defineProps<{
userId: string userId: string
}>() }>()

View file

@ -32,14 +32,14 @@ const shortcutItemGroups = computed<ShortcutItemGroup[]>(() => [
description: t('magic_keys.groups.navigation.shortcut_help'), description: t('magic_keys.groups.navigation.shortcut_help'),
shortcut: { keys: ['?'], isSequence: false }, shortcut: { keys: ['?'], isSequence: false },
}, },
{ // {
description: t('magic_keys.groups.navigation.next_status'), // description: t('magic_keys.groups.navigation.next_status'),
shortcut: { keys: ['j'], isSequence: false }, // shortcut: { keys: ['j'], isSequence: false },
}, // },
{ // {
description: t('magic_keys.groups.navigation.previous_status'), // description: t('magic_keys.groups.navigation.previous_status'),
shortcut: { keys: ['k'], isSequence: false }, // shortcut: { keys: ['k'], isSequence: false },
}, // },
{ {
description: t('magic_keys.groups.navigation.go_to_search'), description: t('magic_keys.groups.navigation.go_to_search'),
shortcut: { keys: ['/'], isSequence: false }, shortcut: { keys: ['/'], isSequence: false },

View file

@ -27,7 +27,7 @@ const containerClass = computed(() => {
<template> <template>
<div ref="container" :class="containerClass"> <div ref="container" :class="containerClass">
<div <div
sticky top-0 z-20 sticky top-0 z10
pt="[env(safe-area-inset-top,0)]" pt="[env(safe-area-inset-top,0)]"
bg="[rgba(var(--rgb-bg-base),0.7)]" bg="[rgba(var(--rgb-bg-base),0.7)]"
class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]" class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]"
@ -35,16 +35,15 @@ const containerClass = computed(() => {
'backdrop-blur': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'), 'backdrop-blur': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}" }"
> >
<div flex justify-between gap-2 min-h-53px px5 py1 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex" border="b base"> <div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex" border="b base">
<div flex gap-2 items-center :overflow-hidden="!noOverflowHidden ? '' : false" w-full> <div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
<button <NuxtLink
v-if="backOnSmallScreen || back" v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden
btn-text flex items-center ms="-3" p-3 xl:hidden
:aria-label="$t('nav.back')" :aria-label="$t('nav.back')"
@click="$router.go(-1)" @click="$router.go(-1)"
> >
<div text-lg i-ri:arrow-left-line class="rtl-flip" /> <div i-ri:arrow-left-line class="rtl-flip" />
</button> </NuxtLink>
<div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-start native-mac:text-center"> <div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-start native-mac:text-center">
<slot name="title" /> <slot name="title" />
</div> </div>

View file

@ -14,8 +14,8 @@ watchEffect(() => {
const duration const duration
= days.value * 24 * 60 * 60 = days.value * 24 * 60 * 60
+ hours.value * 60 * 60 + hours.value * 60 * 60
+ minutes.value * 60 + minutes.value * 60
if (duration <= 0) { if (duration <= 0) {
isValid.value = false isValid.value = false

View file

@ -1,7 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ConfirmDialogChoice, ConfirmDialogOptions } from '#shared/types' import type { ConfirmDialogChoice, ConfirmDialogOptions } from '~/types'
import DurationPicker from '~/components/modal/DurationPicker.vue'
const { extraOptionType } = defineProps<ConfirmDialogOptions>() const props = defineProps<ConfirmDialogOptions>()
const emit = defineEmits<{ const emit = defineEmits<{
(evt: 'choice', choice: ConfirmDialogChoice): void (evt: 'choice', choice: ConfirmDialogChoice): void
@ -11,7 +12,7 @@ const hasDuration = ref(false)
const isValidDuration = ref(true) const isValidDuration = ref(true)
const duration = ref(60 * 60) // default to 1 hour const duration = ref(60 * 60) // default to 1 hour
const shouldMuteNotifications = ref(true) const shouldMuteNotifications = ref(true)
const isMute = computed(() => extraOptionType === 'mute') const isMute = computed(() => props.extraOptionType === 'mute')
function handleChoice(choice: ConfirmDialogChoice['choice']) { function handleChoice(choice: ConfirmDialogChoice['choice']) {
const dialogChoice = { const dialogChoice = {
@ -40,7 +41,7 @@ function handleChoice(choice: ConfirmDialogChoice['choice']) {
</div> </div>
<div v-if="isMute" flex-col flex gap-4> <div v-if="isMute" flex-col flex gap-4>
<CommonCheckbox v-model="hasDuration" :label="$t('confirm.mute_account.specify_duration')" prepend-checkbox checked-icon-color="text-primary" /> <CommonCheckbox v-model="hasDuration" :label="$t('confirm.mute_account.specify_duration')" prepend-checkbox checked-icon-color="text-primary" />
<ModalDurationPicker v-if="hasDuration" v-model="duration" v-model:is-valid="isValidDuration" /> <DurationPicker v-if="hasDuration" v-model="duration" v-model:is-valid="isValidDuration" />
<CommonCheckbox v-model="shouldMuteNotifications" :label="$t('confirm.mute_account.notifications')" prepend-checkbox checked-icon-color="text-primary" /> <CommonCheckbox v-model="shouldMuteNotifications" :label="$t('confirm.mute_account.notifications')" prepend-checkbox checked-icon-color="text-primary" />
</div> </div>

View file

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ConfirmDialogChoice } from '#shared/types'
import type { mastodon } from 'masto' import type { mastodon } from 'masto'
import type { ConfirmDialogChoice } from '~/types'
import { import {
isCommandPanelOpen, isCommandPanelOpen,
isConfirmDialogOpen, isConfirmDialogOpen,
@ -63,14 +63,13 @@ function handleFavouritedBoostedByClose() {
</ModalDialog> </ModalDialog>
<ModalDialog <ModalDialog
v-model="isPublishDialogOpen" v-model="isPublishDialogOpen"
max-w-180 flex w-full max-w-180 flex
@close="handlePublishClose" @close="handlePublishClose"
> >
<!-- This `w-0` style is used to avoid overflow problems in flex layoutsso don't remove it unless you know what you're doing -->
<PublishWidgetList <PublishWidgetList
v-if="dialogDraftKey" v-if="dialogDraftKey"
:draft-key="dialogDraftKey" :draft-key="dialogDraftKey" expanded flex-1 w-0
expanded
class="flex-1"
@published="handlePublished" @published="handlePublished"
/> />
</ModalDialog> </ModalDialog>

Some files were not shown because too many files have changed in this diff Show more