Compare commits
148 commits
Author | SHA1 | Date | |
---|---|---|---|
9264207406 | |||
4babfe9c46 | |||
fe3f416f54 | |||
69506f7d99 | |||
![]() |
78fd25ac10 | ||
![]() |
7fc8aa7bc2 | ||
f8a702704f | |||
![]() |
da26c38e59 | ||
![]() |
e8e2192e75 | ||
2d6ba0cab5 | |||
1db09a2a41 | |||
7f733512a2 | |||
![]() |
31364c1b63 | ||
e170e22621 | |||
078ca947aa | |||
a57ce2db7b | |||
![]() |
317929504e | ||
![]() |
3ef80d56ef | ||
![]() |
cfb68319fe | ||
![]() |
f3d1ac9fca | ||
5b073ee32a | |||
ebf11b5d57 | |||
2780036983 | |||
f202edd5fd | |||
a876d81f51 | |||
e09e4d5b4d | |||
![]() |
b8144db9ac | ||
![]() |
b320b37e52 | ||
![]() |
167f6d78b4 | ||
![]() |
379ab78db3 | ||
![]() |
3adcce4e36 | ||
![]() |
1d128f56f9 | ||
![]() |
190be77043 | ||
![]() |
a51f8f172a | ||
![]() |
8b6f15a214 | ||
![]() |
dd2148095a | ||
![]() |
4f5648f151 | ||
![]() |
548183e14a | ||
![]() |
e12b1d2b6c | ||
![]() |
f4567dcacc | ||
![]() |
d3bffd1da2 | ||
![]() |
d22579fd89 | ||
![]() |
73f6790d01 | ||
![]() |
b669514243 | ||
![]() |
df9554e7ae | ||
![]() |
1d485c91b1 | ||
![]() |
a5ec0cbd3f | ||
![]() |
5f55a5928a | ||
![]() |
220189abd8 | ||
![]() |
a3fbc056a9 | ||
![]() |
46e4433e1c | ||
![]() |
f9feb4e8e4 | ||
![]() |
d31e353d0d | ||
![]() |
4340472873 | ||
![]() |
9cf88c8d38 | ||
![]() |
fc3dce6600 | ||
![]() |
b78417b4de | ||
![]() |
b62006228f | ||
![]() |
1fbea88e58 | ||
![]() |
2d86894d9f | ||
![]() |
ad60711ee3 | ||
![]() |
889de794c3 | ||
![]() |
920d3f3327 | ||
![]() |
f6c34e9120 | ||
![]() |
81675930eb | ||
![]() |
ec594410e4 | ||
![]() |
8c6c03a9a2 | ||
![]() |
b82e85585c | ||
![]() |
b0f301843b | ||
![]() |
c3b3f0fc4f | ||
![]() |
8ba1f7f1d0 | ||
![]() |
19457573ed | ||
![]() |
218c85c89e | ||
![]() |
4968fac2a9 | ||
![]() |
30eb3e9e5c | ||
![]() |
27f543a20d | ||
![]() |
d73fcf27db | ||
![]() |
0a5c2e1598 | ||
![]() |
ab9345b6a8 | ||
![]() |
cd9af5da87 | ||
![]() |
398a792245 | ||
![]() |
81b1fb2d0c | ||
![]() |
ddcce77dc1 | ||
![]() |
d9c4cdb2f1 | ||
![]() |
46deba2c14 | ||
![]() |
5319c1c031 | ||
![]() |
40fb0b70ec | ||
![]() |
149208300d | ||
![]() |
114e49f4bb | ||
![]() |
bf131da26e | ||
![]() |
ea46a5c0c2 | ||
![]() |
e20815b84c | ||
![]() |
2d4a1cfef1 | ||
![]() |
02b9b5cbf3 | ||
![]() |
1679c0dcc4 | ||
![]() |
1bf113a960 | ||
![]() |
5623f87607 | ||
![]() |
96e6c2a730 | ||
![]() |
b26a9dfcf9 | ||
![]() |
37e6a84ba5 | ||
![]() |
538064589d | ||
![]() |
54265dab29 | ||
![]() |
91de331184 | ||
![]() |
979c2fae29 | ||
![]() |
4422bf6286 | ||
![]() |
3b075847b0 | ||
![]() |
616d08c1f9 | ||
![]() |
c640dc5d9e | ||
![]() |
099b88b3b1 | ||
![]() |
d94b14ae53 | ||
![]() |
41379627b5 | ||
![]() |
60b1d0224c | ||
![]() |
7d9712c209 | ||
![]() |
74b7c9da2c | ||
![]() |
260290f011 | ||
![]() |
dad766177f | ||
![]() |
55ad2438ed | ||
![]() |
1ebac1a450 | ||
![]() |
fed57014af | ||
![]() |
9f4945bad8 | ||
![]() |
4cbafc5f56 | ||
![]() |
c1b465069d | ||
![]() |
9f9d71e050 | ||
![]() |
f9977c7f84 | ||
![]() |
efe0a81787 | ||
![]() |
cfe81eef82 | ||
![]() |
06a282e890 | ||
![]() |
4da8cdd3b2 | ||
![]() |
9e52a97795 | ||
![]() |
bfd05f74d7 | ||
![]() |
76bf8cf09b | ||
![]() |
d35a1fdbb2 | ||
![]() |
44409a92f2 | ||
![]() |
835ed51da6 | ||
![]() |
12273eae1d | ||
![]() |
414adb5a71 | ||
![]() |
daf7b8b941 | ||
![]() |
307b04dfdd | ||
![]() |
8116d69b6c | ||
![]() |
5c38c91aee | ||
![]() |
3d951ba44c | ||
![]() |
fce8d79c4d | ||
![]() |
be6aa1e878 | ||
![]() |
e52b34c62d | ||
![]() |
8e2a1d58c1 | ||
![]() |
853fc5cf1a | ||
![]() |
bf000b70a1 | ||
![]() |
374d1908fc |
405 changed files with 10598 additions and 9714 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -18,11 +18,13 @@ jobs:
|
|||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: corepack enable
|
||||
- uses: actions/setup-node@v4
|
||||
# workaround for npm registry key change
|
||||
# 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
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: 📦 Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -19,7 +19,7 @@ jobs:
|
|||
- name: Set node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- run: npx changelogithub
|
||||
env:
|
||||
|
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
|||
20
|
||||
22
|
|
@ -6,19 +6,13 @@ Refer also to https://github.com/antfu/contribute.
|
|||
|
||||
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).
|
||||
|
||||
[](https://pr.new/elk-zone/elk)
|
||||
|
||||
### Local Setup
|
||||
|
||||
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.
|
||||
|
||||
2. Ensure using the latest Node.js (20.x).
|
||||
2. Ensure using the LTS version of Node.js.
|
||||
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)
|
||||
|
@ -92,7 +86,7 @@ We've added some `UnoCSS` utilities styles to help you with that:
|
|||
|
||||
We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i18n.nuxtjs.org/) to handle internationalization.
|
||||
|
||||
You can check the current [translation status](https://docs.elk.zone/docs/guide/contributing#translation-status): more instructions on the table caption.
|
||||
You can check the current [translation status](https://docs.elk.zone/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:
|
||||
- from root folder: `nr prepare-translation-status`
|
||||
|
|
|
@ -6,7 +6,10 @@ WORKDIR /elk
|
|||
FROM base AS builder
|
||||
|
||||
# Prepare pnpm https://pnpm.io/installation#using-corepack
|
||||
RUN corepack enable
|
||||
# workaround for npm registry key change
|
||||
# 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
|
||||
RUN apk update
|
||||
|
|
83
README.md
83
README.md
|
@ -1,28 +1,16 @@
|
|||
<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>
|
||||
# Yolk
|
||||
|
||||
<h1 align="center"/>Elk <sup><em>alpha</em></sup></h1>
|
||||
Hi! Yolk is my custom fork of [Elk](https://github.com/elk-zon/elk), a nimble Mastodon client.
|
||||
|
||||
<p align="center">
|
||||
A nimble Mastodon web client
|
||||
</p>
|
||||
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.
|
||||
|
||||
<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/>
|
||||
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.
|
||||
|
||||
<p align="center">
|
||||
<a href="https://elk.zone/" target="_blank" rel="noopener noreferrer" >
|
||||
<img src="./public/elk-og.png" alt="Elk screenshots" width="600" height="auto">
|
||||
</a>
|
||||
</p>
|
||||
Crucial fixes (if I find them), quality of life improvements, and mastodon API feature parity will still go upstream to the main Elk project.
|
||||
|
||||
~ Ayo Ayco
|
||||
|
||||
---
|
||||
|
||||
## ⚠️ Elk is in Alpha
|
||||
|
||||
|
@ -51,65 +39,12 @@ One could put Elk behind popular reverse proxies with SSL Handling like Traefik,
|
|||
> [!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.
|
||||
|
||||
### 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
|
||||
- [crab.bumscode.com](https://crab.bumscode.com) - Use [crab](https://github.com/maybeanerd/crab) - a soft fork of Elk - for the `bumscode.com` 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.
|
||||
|
||||
## 💖 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
|
||||
|
||||
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).
|
||||
|
||||
[](https://pr.new/elk-zone/elk)
|
||||
|
||||
### Local Setup
|
||||
|
||||
Clone the repository and run on the root folder:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const props = defineProps<{
|
||||
const { account } = defineProps<{
|
||||
account: mastodon.v1.Account
|
||||
square?: boolean
|
||||
}>()
|
||||
|
@ -11,22 +11,22 @@ const error = ref(false)
|
|||
|
||||
const preferredMotion = usePreferredReducedMotion()
|
||||
const accountAvatarSrc = computed(() => {
|
||||
return preferredMotion.value === 'reduce' ? (props.account?.avatarStatic ?? props.account.avatar) : props.account.avatar
|
||||
return preferredMotion.value === 'reduce' ? (account?.avatarStatic ?? account.avatar) : account.avatar
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<img
|
||||
:key="props.account.avatar"
|
||||
:key="account.avatar"
|
||||
width="400"
|
||||
height="400"
|
||||
select-none
|
||||
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : accountAvatarSrc"
|
||||
:alt="$t('account.avatar_description', [props.account.username])"
|
||||
:alt="$t('account.avatar_description', [account.username])"
|
||||
loading="lazy"
|
||||
class="account-avatar"
|
||||
:class="(loaded ? 'bg-base' : 'bg-gray:10') + (props.square ? ' ' : ' rounded-full')"
|
||||
:style="{ 'clip-path': props.square ? `url(#avatar-mask)` : 'none' }"
|
||||
class="account-avatar object-cover"
|
||||
:class="(loaded ? 'bg-base' : 'bg-gray:10') + (square ? ' ' : ' rounded-full')"
|
||||
:style="{ 'clip-path': square ? `url(#avatar-mask)` : 'none' }"
|
||||
v-bind="$attrs"
|
||||
@load="loaded = true"
|
||||
@error="error = true"
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const { account, hideEmojis = false } = defineProps<{
|
||||
const { hideEmojis = false } = defineProps<{
|
||||
account: mastodon.v1.Account
|
||||
hideEmojis?: boolean
|
||||
}>()
|
|
@ -1,8 +1,8 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
|
||||
import { toggleFollowAccount, useRelationship } from '~/composables/masto/relationship'
|
||||
|
||||
const { account, command, context, ...props } = defineProps<{
|
||||
const { account, context, command, ...props } = defineProps<{
|
||||
account: mastodon.v1.Account
|
||||
relationship?: mastodon.v1.Relationship
|
||||
context?: 'followedBy' | 'following'
|
|
@ -5,7 +5,7 @@ defineOptions({
|
|||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
const { account, as = 'div' } = defineProps<{
|
||||
const { as = 'div' } = defineProps<{
|
||||
account: mastodon.v1.Account
|
||||
as?: string
|
||||
hoverCard?: boolean
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~~/composables/masto/relationship'
|
||||
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~/composables/masto/relationship'
|
||||
|
||||
const { account } = defineProps<{
|
||||
account: mastodon.v1.Account
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const { paginator, account, context } = defineProps<{
|
||||
const { account, context } = defineProps<{
|
||||
paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined>
|
||||
context?: 'following' | 'followers'
|
||||
account?: mastodon.v1.Account
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { CommonRouteTabOption } from '~/types'
|
||||
import type { CommonRouteTabOption } from '#shared/types'
|
||||
|
||||
const { t } = useI18n()
|
||||
const route = useRoute()
|
|
@ -5,7 +5,7 @@ defineOptions({
|
|||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
const { tagName, disabled } = defineProps<{
|
||||
const { tagName } = defineProps<{
|
||||
tagName?: string
|
||||
disabled?: boolean
|
||||
}>()
|
|
@ -1,17 +1,16 @@
|
|||
<script setup lang="ts">
|
||||
import type { AriaLive } from '~/composables/aria'
|
||||
|
||||
// tsc complaining when using $defineProps
|
||||
withDefaults(defineProps<{
|
||||
title: string
|
||||
const {
|
||||
ariaLive = 'polite',
|
||||
heading = 'h2',
|
||||
messageKey = (message: any) => message,
|
||||
} = defineProps<{
|
||||
ariaLive?: AriaLive
|
||||
messageKey?: (message: any) => any
|
||||
heading?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
||||
}>(), {
|
||||
heading: 'h2',
|
||||
messageKey: (message: any) => message,
|
||||
ariaLive: 'polite',
|
||||
})
|
||||
title: string
|
||||
messageKey?: (message: any) => any
|
||||
}>()
|
||||
|
||||
const { announceLogs, appendLogs, clearLogs, logs } = useAriaLog()
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import type { AriaLive } from '~/composables/aria'
|
||||
|
||||
// tsc complaining when using $defineProps
|
||||
withDefaults(defineProps<{
|
||||
const { ariaLive = 'polite' } = defineProps<{
|
||||
ariaLive?: AriaLive
|
||||
}>(), {
|
||||
ariaLive: 'polite',
|
||||
})
|
||||
}>()
|
||||
|
||||
const { announceStatus, clearStatus, status } = useAriaStatus()
|
||||
|
|
@ -1,11 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { ResolvedCommand } from '~/composables/command'
|
||||
|
||||
const {
|
||||
cmd,
|
||||
index,
|
||||
active = false,
|
||||
} = defineProps<{
|
||||
const { active = false } = defineProps<{
|
||||
cmd: ResolvedCommand
|
||||
index: number
|
||||
active?: boolean
|
|
@ -1,11 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
const { name } = defineProps<{
|
||||
name: string
|
||||
}>()
|
||||
|
||||
const isMac = useIsMac()
|
||||
|
||||
const keys = computed(() => props.name.toLowerCase().split('+'))
|
||||
const keys = computed(() => name.toLowerCase().split('+'))
|
||||
</script>
|
||||
|
||||
<template>
|
|
@ -3,7 +3,7 @@ defineOptions({
|
|||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
const { blurhash = '', src, srcset, shouldLoadImage = true } = defineProps<{
|
||||
const { blurhash = '', shouldLoadImage = true } = defineProps<{
|
||||
blurhash?: string
|
||||
src: string
|
||||
srcset?: string
|
|
@ -3,25 +3,18 @@ import type { Boundaries } from 'vue-advanced-cropper'
|
|||
import { Cropper } from 'vue-advanced-cropper'
|
||||
import 'vue-advanced-cropper/dist/style.css'
|
||||
|
||||
export interface Props {
|
||||
const { stencilAspectRatio = 1 / 1, stencilSizePercentage = 0.9 } = defineProps<{
|
||||
/** Crop frame aspect ratio (width/height), default 1/1 */
|
||||
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 */
|
||||
stencilSizePercentage?: number
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
stencilAspectRatio: 1 / 1,
|
||||
stencilSizePercentage: 0.9,
|
||||
})
|
||||
}>()
|
||||
|
||||
const file = defineModel<File | null>()
|
||||
|
||||
const cropperDialog = ref(false)
|
||||
|
||||
const cropper = ref<InstanceType<typeof Cropper>>()
|
||||
|
||||
const cropperFlag = ref(false)
|
||||
|
||||
const cropperImage = reactive({
|
||||
src: '',
|
||||
type: 'image/jpg',
|
||||
|
@ -29,8 +22,8 @@ const cropperImage = reactive({
|
|||
|
||||
function stencilSize({ boundaries }: { boundaries: Boundaries }) {
|
||||
return {
|
||||
width: boundaries.width * props.stencilSizePercentage,
|
||||
height: boundaries.height * props.stencilSizePercentage,
|
||||
width: boundaries.width * stencilSizePercentage,
|
||||
height: boundaries.height * stencilSizePercentage,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +75,7 @@ function cropImage() {
|
|||
}"
|
||||
:stencil-size="stencilSize"
|
||||
:stencil-props="{
|
||||
aspectRatio: props.stencilAspectRatio,
|
||||
aspectRatio: stencilAspectRatio,
|
||||
movable: false,
|
||||
resizable: false,
|
||||
handlers: {},
|
|
@ -2,21 +2,21 @@
|
|||
import type { FileWithHandle } from 'browser-fs-access'
|
||||
import { fileOpen } from 'browser-fs-access'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
const {
|
||||
original,
|
||||
allowedFileTypes = ['image/jpeg', 'image/png'],
|
||||
allowedFileSize = 1024 * 1024 * 5, // 5 MB
|
||||
} = defineProps<{
|
||||
/** The image src before change */
|
||||
original?: string
|
||||
/** Allowed file types */
|
||||
allowedFileTypes?: string[]
|
||||
/** Allowed file size */
|
||||
allowedFileSize?: number
|
||||
|
||||
imgClass?: string
|
||||
|
||||
loading?: boolean
|
||||
}>(), {
|
||||
allowedFileTypes: () => ['image/jpeg', 'image/png'],
|
||||
allowedFileSize: 1024 * 1024 * 5, // 5 MB
|
||||
})
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: 'pick', value: FileWithHandle): void
|
||||
(event: 'error', code: number, message: string): void
|
||||
|
@ -26,7 +26,7 @@ const file = defineModel<FileWithHandle | null>()
|
|||
|
||||
const { t } = useI18n()
|
||||
|
||||
const defaultImage = computed(() => props.original || '')
|
||||
const defaultImage = computed(() => original || '')
|
||||
/** Preview of selected images */
|
||||
const previewImage = ref('')
|
||||
/** The current images on display */
|
||||
|
@ -37,14 +37,14 @@ async function pickImage() {
|
|||
return
|
||||
const image = await fileOpen({
|
||||
description: 'Image',
|
||||
mimeTypes: props.allowedFileTypes,
|
||||
mimeTypes: allowedFileTypes,
|
||||
})
|
||||
|
||||
if (!props.allowedFileTypes.includes(image.type)) {
|
||||
if (!allowedFileTypes.includes(image.type)) {
|
||||
emit('error', 1, t('error.unsupported_file_format'))
|
||||
return
|
||||
}
|
||||
else if (image.size > props.allowedFileSize) {
|
||||
else if (image.size > allowedFileSize) {
|
||||
emit('error', 2, t('error.file_size_cannot_exceed_n_mb', [5]))
|
||||
return
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
const {
|
||||
zIndex = 100,
|
||||
background = 'transparent',
|
||||
} = $defineProps<{
|
||||
} = defineProps<{
|
||||
zIndex?: number
|
||||
background?: string
|
||||
}>()
|
|
@ -6,10 +6,10 @@ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
|||
|
||||
const {
|
||||
paginator,
|
||||
stream,
|
||||
eventType,
|
||||
keyProp = 'id',
|
||||
virtualScroller = false,
|
||||
stream,
|
||||
eventType,
|
||||
preprocess,
|
||||
endMessage = true,
|
||||
} = defineProps<{
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { CommonRouteTabMoreOption, CommonRouteTabOption } from '~/types'
|
||||
import type { CommonRouteTabMoreOption, CommonRouteTabOption } from '#shared/types'
|
||||
|
||||
const { options, command, replace, preventScrollTop = false, moreOptions } = defineProps<{
|
||||
const { options, command, preventScrollTop = false } = defineProps<{
|
||||
options: CommonRouteTabOption[]
|
||||
moreOptions?: CommonRouteTabMoreOption
|
||||
command?: boolean
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
const { as = 'div', active } = defineProps<{
|
||||
as: any
|
||||
as?: string
|
||||
active: boolean
|
||||
}>()
|
||||
|
|
@ -3,16 +3,16 @@ defineOptions({
|
|||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
const props = defineProps<{
|
||||
const { count } = defineProps<{
|
||||
count: number
|
||||
keypath: string
|
||||
}>()
|
||||
|
||||
const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumber()
|
||||
|
||||
const useSR = computed(() => forSR(props.count))
|
||||
const rawNumber = computed(() => formatNumber(props.count))
|
||||
const humanReadableNumber = computed(() => formatHumanReadableNumber(props.count))
|
||||
const useSR = computed(() => forSR(count))
|
||||
const rawNumber = computed(() => formatNumber(count))
|
||||
const humanReadableNumber = computed(() => formatHumanReadableNumber(count))
|
||||
</script>
|
||||
|
||||
<template>
|
|
@ -4,7 +4,6 @@ const {
|
|||
text,
|
||||
description,
|
||||
icon,
|
||||
checked,
|
||||
command,
|
||||
} = defineProps<{
|
||||
is?: string
|
|
@ -1,10 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
const props = defineProps<{
|
||||
const { code, lang } = defineProps<{
|
||||
code: string
|
||||
lang?: string
|
||||
}>()
|
||||
|
||||
const raw = computed(() => decodeURIComponent(props.code).replace(/'/g, '\''))
|
||||
const raw = computed(() => decodeURIComponent(code).replace(/'/g, '\''))
|
||||
|
||||
const langMap: Record<string, string> = {
|
||||
js: 'javascript',
|
||||
|
@ -13,7 +13,7 @@ const langMap: Record<string, string> = {
|
|||
}
|
||||
|
||||
const highlighted = computed(() => {
|
||||
return props.lang ? highlightCode(raw.value, (langMap[props.lang] || props.lang) as any) : raw
|
||||
return lang ? highlightCode(raw.value, (langMap[lang] || lang) as any) : raw
|
||||
})
|
||||
</script>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { mastodon } from 'masto'
|
||||
|
||||
const { paginator } = defineProps<{
|
||||
defineProps<{
|
||||
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
|
||||
}>()
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
const { as, alt, dataEmojiId } = defineProps<{
|
||||
const { alt, dataEmojiId } = defineProps<{
|
||||
as: string
|
||||
alt?: string
|
||||
dataEmojiId?: string
|
|
@ -44,6 +44,7 @@ async function edit() {
|
|||
<button
|
||||
text-sm p2 border-1 transition-colors
|
||||
border-dark
|
||||
bg-base
|
||||
btn-action-icon
|
||||
@click="edit"
|
||||
>
|
23
app/components/list/AccountSearchResult.vue
Normal file
23
app/components/list/AccountSearchResult.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<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>
|
|
@ -35,15 +35,16 @@ const containerClass = computed(() => {
|
|||
'backdrop-blur': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
|
||||
}"
|
||||
>
|
||||
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex" border="b base">
|
||||
<div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
|
||||
<NuxtLink
|
||||
v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden
|
||||
<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 gap-2 items-center :overflow-hidden="!noOverflowHidden ? '' : false" w-full>
|
||||
<button
|
||||
v-if="backOnSmallScreen || back"
|
||||
btn-text flex items-center ms="-3" p-3 xl:hidden
|
||||
:aria-label="$t('nav.back')"
|
||||
@click="$router.go(-1)"
|
||||
>
|
||||
<div i-ri:arrow-left-line class="rtl-flip" />
|
||||
</NuxtLink>
|
||||
<div text-lg i-ri:arrow-left-line class="rtl-flip" />
|
||||
</button>
|
||||
<div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-start native-mac:text-center">
|
||||
<slot name="title" />
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions } from '~/types'
|
||||
import type { ConfirmDialogChoice, ConfirmDialogOptions } from '#shared/types'
|
||||
|
||||
const props = defineProps<ConfirmDialogOptions>()
|
||||
const { extraOptionType } = defineProps<ConfirmDialogOptions>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(evt: 'choice', choice: ConfirmDialogChoice): void
|
||||
|
@ -11,7 +11,7 @@ const hasDuration = ref(false)
|
|||
const isValidDuration = ref(true)
|
||||
const duration = ref(60 * 60) // default to 1 hour
|
||||
const shouldMuteNotifications = ref(true)
|
||||
const isMute = computed(() => props.extraOptionType === 'mute')
|
||||
const isMute = computed(() => extraOptionType === 'mute')
|
||||
|
||||
function handleChoice(choice: ConfirmDialogChoice['choice']) {
|
||||
const dialogChoice = {
|
||||
|
@ -40,7 +40,7 @@ function handleChoice(choice: ConfirmDialogChoice['choice']) {
|
|||
</div>
|
||||
<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" />
|
||||
<DurationPicker v-if="hasDuration" v-model="duration" v-model:is-valid="isValidDuration" />
|
||||
<ModalDurationPicker 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" />
|
||||
</div>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import type { ConfirmDialogChoice } from '#shared/types'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { ConfirmDialogChoice } from '~/types'
|
||||
import {
|
||||
isCommandPanelOpen,
|
||||
isConfirmDialogOpen,
|
|
@ -1,51 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
|
||||
|
||||
export interface Props {
|
||||
/**
|
||||
* level of depth
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
zIndex?: number
|
||||
|
||||
/**
|
||||
* whether to allow close dialog by clicking mask layer
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
closeByMask?: boolean
|
||||
|
||||
/**
|
||||
* use v-if, destroy all the internal elements after closed
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
useVIf?: boolean
|
||||
|
||||
/**
|
||||
* keep the dialog opened even when in other views
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
keepAlive?: boolean
|
||||
|
||||
/**
|
||||
* The aria-labelledby id for the dialog.
|
||||
*/
|
||||
dialogLabelledBy?: string
|
||||
}
|
||||
|
||||
defineOptions({
|
||||
inheritAttrs: false,
|
||||
})
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
zIndex: 100,
|
||||
closeByMask: true,
|
||||
useVIf: true,
|
||||
keepAlive: false,
|
||||
})
|
||||
const {
|
||||
zIndex = 100,
|
||||
closeByMask = true,
|
||||
useVIf = true,
|
||||
keepAlive = false,
|
||||
} = defineProps<{
|
||||
// level of depth
|
||||
zIndex?: number
|
||||
// whether to allow close dialog by clicking mask layer
|
||||
closeByMask?: boolean
|
||||
// use v-if, destroy all the internal elements after closed
|
||||
useVIf?: boolean
|
||||
// keep the dialog opened even when in other views
|
||||
keepAlive?: boolean
|
||||
// The aria-labelledby id for the dialog.
|
||||
dialogLabelledBy?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
/** v-model dialog visibility */
|
||||
|
@ -85,7 +61,7 @@ function close() {
|
|||
}
|
||||
|
||||
function clickMask() {
|
||||
if (props.closeByMask)
|
||||
if (closeByMask)
|
||||
close()
|
||||
}
|
||||
|
||||
|
@ -97,7 +73,7 @@ watch(visible, (value) => {
|
|||
|
||||
const notInCurrentPage = computed(() => deactivated.value || routePath.value !== route.path)
|
||||
watch(notInCurrentPage, (value) => {
|
||||
if (props.keepAlive)
|
||||
if (keepAlive)
|
||||
return
|
||||
if (value)
|
||||
close()
|
||||
|
@ -106,7 +82,7 @@ watch(notInCurrentPage, (value) => {
|
|||
// controls the state of v-if.
|
||||
// when useVIf is toggled, v-if has the same state as modelValue, otherwise v-if is true
|
||||
const isVIf = computed(() => {
|
||||
return props.useVIf
|
||||
return useVIf
|
||||
? visible.value
|
||||
: true
|
||||
})
|
||||
|
@ -114,7 +90,7 @@ const isVIf = computed(() => {
|
|||
// controls the state of v-show.
|
||||
// when useVIf is toggled, v-show is true, otherwise it has the same state as modelValue
|
||||
const isVShow = computed(() => {
|
||||
return !props.useVIf
|
||||
return !useVIf
|
||||
? visible.value
|
||||
: true
|
||||
})
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import type { ErrorDialogData } from '~/types'
|
||||
import type { ErrorDialogData } from '#shared/types'
|
||||
|
||||
defineProps<ErrorDialogData>()
|
||||
</script>
|
23
app/components/nav/NavLogo.vue
Normal file
23
app/components/nav/NavLogo.vue
Normal file
|
@ -0,0 +1,23 @@
|
|||
<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>
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
||||
|
||||
const { command } = defineProps<{
|
||||
defineProps<{
|
||||
command?: boolean
|
||||
}>()
|
||||
const { notifications } = useNotifications()
|
|
@ -1,13 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
const props = withDefaults(defineProps<{
|
||||
const { text, icon, to, userOnly = false, command } = defineProps<{
|
||||
text?: string
|
||||
icon: string
|
||||
to: string | Record<string, string>
|
||||
userOnly?: boolean
|
||||
command?: boolean
|
||||
}>(), {
|
||||
userOnly: false,
|
||||
})
|
||||
}>()
|
||||
|
||||
defineSlots<{
|
||||
icon: (props: object) => void
|
||||
|
@ -19,12 +17,12 @@ const router = useRouter()
|
|||
useCommand({
|
||||
scope: 'Navigation',
|
||||
|
||||
name: () => props.text ?? (typeof props.to === 'string' ? props.to as string : props.to.name),
|
||||
icon: () => props.icon,
|
||||
visible: () => props.command,
|
||||
name: () => text ?? (typeof to === 'string' ? to as string : to.name),
|
||||
icon: () => icon,
|
||||
visible: () => command,
|
||||
|
||||
onActivate() {
|
||||
router.push(props.to)
|
||||
router.push(to)
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -39,8 +37,8 @@ onHydrated(async () => {
|
|||
|
||||
// Optimize rendering for the common case of being logged in, only show visual feedback for disabled user-only items
|
||||
// when we know there is no user.
|
||||
const noUserDisable = computed(() => !isHydrated.value || (props.userOnly && !currentUser.value))
|
||||
const noUserVisual = computed(() => isHydrated.value && props.userOnly && !currentUser.value)
|
||||
const noUserDisable = computed(() => !isHydrated.value || (userOnly && !currentUser.value))
|
||||
const noUserVisual = computed(() => isHydrated.value && userOnly && !currentUser.value)
|
||||
</script>
|
||||
|
||||
<template>
|
|
@ -29,21 +29,21 @@ router.afterEach(() => {
|
|||
@click.prevent="onClickLogo"
|
||||
>
|
||||
<NavLogo shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip" />
|
||||
<div v-show="isHydrated" hidden xl:block text-secondary>
|
||||
{{ $t('app_name') }} <sup text-sm italic mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
||||
<div v-show="isHydrated" hidden xl:block>
|
||||
<span pr-1>{{ $t('app_name') }}</span>
|
||||
<sup text-sm italic mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
||||
</div>
|
||||
</NuxtLink>
|
||||
<div
|
||||
hidden xl:flex items-center me-8 mt-2 gap-1
|
||||
>
|
||||
<CommonTooltip :content="$t('nav.back')">
|
||||
<NuxtLink
|
||||
<div hidden xl:flex items-center me-6 mt-2 gap-1>
|
||||
<CommonTooltip :content="$t('nav.back')" :distance="0">
|
||||
<button
|
||||
type="button"
|
||||
:aria-label="$t('nav.back')"
|
||||
:class="{ 'pointer-events-none op0': !back || back === '/', 'xl:flex': $route.name !== 'tag' }"
|
||||
btn-text p-3 :class="{ 'pointer-events-none op0': !back || back === '/', 'xl:flex': $route.name !== 'tag' }"
|
||||
@click="$router.go(-1)"
|
||||
>
|
||||
<div text-xl i-ri:arrow-left-line class="rtl-flip" btn-text />
|
||||
</NuxtLink>
|
||||
<div text-xl i-ri:arrow-left-line class="rtl-flip" />
|
||||
</button>
|
||||
</CommonTooltip>
|
||||
</div>
|
||||
</div>
|
|
@ -4,6 +4,7 @@ import { STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
|||
defineProps<{
|
||||
activeClass: string
|
||||
}>()
|
||||
|
||||
const { notifications } = useNotifications()
|
||||
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
||||
</script>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue