Compare commits
262 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 | ||
![]() |
210278703d | ||
![]() |
f6a47167c5 | ||
![]() |
e4a3cf00f0 | ||
![]() |
443208468e | ||
![]() |
a7d64fd132 | ||
![]() |
39b2182a00 | ||
![]() |
72d6e0596b | ||
![]() |
e214076620 | ||
![]() |
2ffefc8392 | ||
![]() |
f5cada0be8 | ||
![]() |
2c0052edc4 | ||
![]() |
4d7dc4e5ac | ||
![]() |
5d4e84241a | ||
![]() |
a7cd43fcd9 | ||
![]() |
2a85c9ebd4 | ||
![]() |
9da6f45269 | ||
![]() |
9a5497e318 | ||
![]() |
29761c6b10 | ||
![]() |
7198e1e618 | ||
![]() |
154fdaaad9 | ||
![]() |
e59f5dbb8f | ||
![]() |
e986de7f6c | ||
![]() |
6cfadd7f7c | ||
![]() |
ed70b3c611 | ||
![]() |
ed5d03044b | ||
![]() |
b179271e3c | ||
![]() |
cadd2c3fa0 | ||
![]() |
1281ecf869 | ||
![]() |
209330be6d | ||
![]() |
08aac8a995 | ||
![]() |
3b6a1762d6 | ||
![]() |
5e2df3821c | ||
![]() |
371a996624 | ||
![]() |
d8710d5b06 | ||
![]() |
3b33127dd9 | ||
![]() |
dd4076f49c | ||
![]() |
4c63f6b8fc | ||
![]() |
7a52a6122a | ||
![]() |
4928148eed | ||
![]() |
83513bf624 | ||
![]() |
1e156ec82b | ||
![]() |
e67f6b0392 | ||
![]() |
fa6c8a8fa1 | ||
![]() |
fb411e89f4 | ||
![]() |
62e6bdf43c | ||
![]() |
4d42624765 | ||
![]() |
f885616537 | ||
![]() |
900017bb3f | ||
![]() |
b7cff82ab2 | ||
![]() |
6b98b6116b | ||
![]() |
cca29e6695 | ||
![]() |
b4cb027a8e | ||
![]() |
e1b8d5cb33 | ||
![]() |
672e057f83 | ||
![]() |
7a4b1907b1 | ||
![]() |
302da09248 | ||
![]() |
008248ee0f | ||
![]() |
5753f0b869 | ||
![]() |
08672d6f2c | ||
![]() |
4675599b08 | ||
![]() |
beeb30f039 | ||
![]() |
eab541b7b8 | ||
![]() |
f4b667fef6 | ||
![]() |
e6ebde3ac4 | ||
![]() |
aff559780b | ||
![]() |
63caf91ec1 | ||
![]() |
beb2b2d3bd | ||
![]() |
fb5cd0ecdb | ||
![]() |
62141629c7 | ||
![]() |
726319efb6 | ||
![]() |
f742a01430 | ||
![]() |
428db939ab | ||
![]() |
019bce3590 | ||
![]() |
738bc88be2 | ||
![]() |
816f452646 | ||
![]() |
f6265bd387 | ||
![]() |
9c25621f12 | ||
![]() |
074deb4ce6 | ||
![]() |
b1428a53bd | ||
![]() |
54cc0e4735 | ||
![]() |
9fc75afdf0 | ||
![]() |
aae808e36b | ||
![]() |
41346e318b | ||
![]() |
98a910c6f1 | ||
![]() |
49a5f49966 | ||
![]() |
c153f719fe | ||
![]() |
83fd1f3224 | ||
![]() |
86581a7172 | ||
![]() |
18b3d36e03 | ||
![]() |
2c8307b3d8 | ||
![]() |
83fce5d8a1 | ||
![]() |
2f3fe82593 | ||
![]() |
907657725d | ||
![]() |
dac42e062c | ||
![]() |
ae1da4c3e8 | ||
![]() |
78b013dc0f | ||
![]() |
2d66e6f5d7 | ||
![]() |
9440527f17 | ||
![]() |
6e731866be | ||
![]() |
d0681bd907 | ||
![]() |
36981cd40f | ||
![]() |
18433fa3e0 | ||
![]() |
466921de44 | ||
![]() |
b395ab2cf9 | ||
![]() |
3bc6e106d2 | ||
![]() |
f64878861e | ||
![]() |
abf8dd3ea1 | ||
![]() |
f5b62f3a59 | ||
![]() |
502993946b | ||
![]() |
320ddc0e28 | ||
![]() |
97826c00bc | ||
![]() |
1335bbfcd5 | ||
![]() |
44074ff1a3 | ||
![]() |
54344acf4b |
431 changed files with 13994 additions and 8788 deletions
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -18,11 +18,13 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: corepack enable
|
# workaround for npm registry key change
|
||||||
- uses: actions/setup-node@v4
|
# 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:
|
with:
|
||||||
node-version: 20
|
node-version-file: .nvmrc
|
||||||
cache: pnpm
|
|
||||||
|
|
||||||
- name: 📦 Install dependencies
|
- name: 📦 Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
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
|
- name: Set node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version-file: .nvmrc
|
||||||
|
|
||||||
- run: npx changelogithub
|
- run: npx changelogithub
|
||||||
env:
|
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).
|
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
|
### 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 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.
|
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/) 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)
|
||||||
|
@ -90,9 +84,9 @@ 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://v8.i18n.nuxtjs.org/) to handle internationalization.
|
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:
|
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`
|
||||||
|
|
|
@ -6,7 +6,10 @@ 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
|
||||||
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
|
# Prepare deps
|
||||||
RUN apk update
|
RUN apk update
|
||||||
|
|
86
README.md
86
README.md
|
@ -1,28 +1,16 @@
|
||||||
<p align="center">
|
# Yolk
|
||||||
<a href="https://elk.zone" target="_blank" rel="noopener noreferrer">
|
|
||||||
<img width="160" height="160" src="./public/logo.svg" alt="Elk logo">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<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">
|
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.
|
||||||
A nimble Mastodon web client
|
|
||||||
</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://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/>
|
|
||||||
|
|
||||||
<p align="center">
|
Crucial fixes (if I find them), quality of life improvements, and mastodon API feature parity will still go upstream to the main Elk project.
|
||||||
<a href="https://elk.zone/" target="_blank" rel="noopener noreferrer" >
|
|
||||||
<img src="./public/elk-og.png" alt="Elk screenshots" width="600" height="auto">
|
~ Ayo Ayco
|
||||||
</a>
|
|
||||||
</p>
|
---
|
||||||
|
|
||||||
## ⚠️ Elk is in Alpha
|
## ⚠️ Elk is in Alpha
|
||||||
|
|
||||||
|
@ -44,73 +32,19 @@ 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 -d```
|
1. start container: ```docker-compose up --build -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
|
|
||||||
- [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.
|
> **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).
|
|
||||||
|
|
||||||
[](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:
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
defineProps<{
|
const { account } = 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>
|
||||||
|
@ -16,10 +21,10 @@ const error = ref(false)
|
||||||
width="400"
|
width="400"
|
||||||
height="400"
|
height="400"
|
||||||
select-none
|
select-none
|
||||||
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : account.avatar"
|
:src="(error || !loaded) ? 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7' : accountAvatarSrc"
|
||||||
:alt="$t('account.avatar_description', [account.username])"
|
:alt="$t('account.avatar_description', [account.username])"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
class="account-avatar"
|
class="account-avatar object-cover"
|
||||||
: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"
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
const { account, hideEmojis = false } = defineProps<{
|
const { hideEmojis = false } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
hideEmojis?: boolean
|
hideEmojis?: boolean
|
||||||
}>()
|
}>()
|
|
@ -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, command, context, ...props } = defineProps<{
|
const { account, context, command, ...props } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
relationship?: mastodon.v1.Relationship
|
relationship?: mastodon.v1.Relationship
|
||||||
context?: 'followedBy' | 'following'
|
context?: 'followedBy' | 'following'
|
|
@ -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="true" />
|
<AccountInfo :account="account" :hover-card="false" />
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<AccountFollowButton text-sm :account="account" :relationship="relationship" />
|
<AccountFollowButton text-sm :account="account" :relationship="relationship" />
|
||||||
</div>
|
</div>
|
|
@ -5,7 +5,7 @@ defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { account, as = 'div' } = defineProps<{
|
const { as = 'div' } = defineProps<{
|
||||||
account: mastodon.v1.Account
|
account: mastodon.v1.Account
|
||||||
as?: string
|
as?: string
|
||||||
hoverCard?: boolean
|
hoverCard?: boolean
|
|
@ -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
|
||||||
|
@ -71,6 +71,7 @@ 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"
|
||||||
|
@ -81,12 +82,14 @@ 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"
|
||||||
|
@ -94,6 +97,7 @@ 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}`])"
|
||||||
|
@ -101,6 +105,7 @@ 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"
|
||||||
|
@ -109,6 +114,7 @@ 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"
|
||||||
|
@ -116,6 +122,7 @@ 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"
|
||||||
|
@ -124,6 +131,7 @@ 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"
|
||||||
|
@ -131,6 +139,7 @@ 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"
|
||||||
|
@ -139,6 +148,7 @@ 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"
|
||||||
|
@ -146,6 +156,7 @@ 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"
|
||||||
|
@ -155,6 +166,7 @@ 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"
|
||||||
|
@ -162,6 +174,7 @@ 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"
|
||||||
|
@ -171,6 +184,7 @@ 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"
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
const { paginator, account, context } = defineProps<{
|
const { 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
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { CommonRouteTabOption } from '~/types'
|
import type { CommonRouteTabOption } from '#shared/types'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
|
@ -5,7 +5,7 @@ defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { tagName, disabled } = defineProps<{
|
const { tagName } = defineProps<{
|
||||||
tagName?: string
|
tagName?: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
}>()
|
}>()
|
|
@ -1,17 +1,16 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AriaLive } from '~/composables/aria'
|
import type { AriaLive } from '~/composables/aria'
|
||||||
|
|
||||||
// tsc complaining when using $defineProps
|
const {
|
||||||
withDefaults(defineProps<{
|
ariaLive = 'polite',
|
||||||
title: string
|
heading = 'h2',
|
||||||
|
messageKey = (message: any) => message,
|
||||||
|
} = defineProps<{
|
||||||
ariaLive?: AriaLive
|
ariaLive?: AriaLive
|
||||||
messageKey?: (message: any) => any
|
|
||||||
heading?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
heading?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
||||||
}>(), {
|
title: string
|
||||||
heading: 'h2',
|
messageKey?: (message: any) => any
|
||||||
messageKey: (message: any) => message,
|
}>()
|
||||||
ariaLive: 'polite',
|
|
||||||
})
|
|
||||||
|
|
||||||
const { announceLogs, appendLogs, clearLogs, logs } = useAriaLog()
|
const { announceLogs, appendLogs, clearLogs, logs } = useAriaLog()
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { AriaLive } from '~/composables/aria'
|
import type { AriaLive } from '~/composables/aria'
|
||||||
|
|
||||||
// tsc complaining when using $defineProps
|
const { ariaLive = 'polite' } = defineProps<{
|
||||||
withDefaults(defineProps<{
|
|
||||||
ariaLive?: AriaLive
|
ariaLive?: AriaLive
|
||||||
}>(), {
|
}>()
|
||||||
ariaLive: 'polite',
|
|
||||||
})
|
|
||||||
|
|
||||||
const { announceStatus, clearStatus, status } = useAriaStatus()
|
const { announceStatus, clearStatus, status } = useAriaStatus()
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ResolvedCommand } from '~/composables/command'
|
import type { ResolvedCommand } from '~/composables/command'
|
||||||
|
|
||||||
const {
|
const { active = false } = defineProps<{
|
||||||
cmd,
|
|
||||||
index,
|
|
||||||
active = false,
|
|
||||||
} = defineProps<{
|
|
||||||
cmd: ResolvedCommand
|
cmd: ResolvedCommand
|
||||||
index: number
|
index: number
|
||||||
active?: boolean
|
active?: boolean
|
|
@ -1,11 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
const { name } = defineProps<{
|
||||||
name: string
|
name: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const isMac = useIsMac()
|
const isMac = useIsMac()
|
||||||
|
|
||||||
const keys = computed(() => props.name.toLowerCase().split('+'))
|
const keys = computed(() => name.toLowerCase().split('+'))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
|
|
||||||
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
|
import type { CommandScope, QueryResult, QueryResultItem } from '~/composables/command'
|
||||||
|
import type { SearchResult as SearchResultType } from '~/composables/masto/search'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(event: 'close'): void
|
(event: 'close'): void
|
|
@ -3,7 +3,7 @@ defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { blurhash = '', src, srcset, shouldLoadImage = true } = defineProps<{
|
const { blurhash = '', shouldLoadImage = true } = defineProps<{
|
||||||
blurhash?: string
|
blurhash?: string
|
||||||
src: string
|
src: string
|
||||||
srcset?: string
|
srcset?: string
|
|
@ -3,25 +3,18 @@ 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'
|
||||||
|
|
||||||
export interface Props {
|
const { stencilAspectRatio = 1 / 1, stencilSizePercentage = 0.9 } = defineProps<{
|
||||||
/** 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',
|
||||||
|
@ -29,8 +22,8 @@ const cropperImage = reactive({
|
||||||
|
|
||||||
function stencilSize({ boundaries }: { boundaries: Boundaries }) {
|
function stencilSize({ boundaries }: { boundaries: Boundaries }) {
|
||||||
return {
|
return {
|
||||||
width: boundaries.width * props.stencilSizePercentage,
|
width: boundaries.width * stencilSizePercentage,
|
||||||
height: boundaries.height * props.stencilSizePercentage,
|
height: boundaries.height * stencilSizePercentage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +75,7 @@ function cropImage() {
|
||||||
}"
|
}"
|
||||||
:stencil-size="stencilSize"
|
:stencil-size="stencilSize"
|
||||||
:stencil-props="{
|
:stencil-props="{
|
||||||
aspectRatio: props.stencilAspectRatio,
|
aspectRatio: stencilAspectRatio,
|
||||||
movable: false,
|
movable: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
handlers: {},
|
handlers: {},
|
|
@ -1,22 +1,22 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { fileOpen } from 'browser-fs-access'
|
|
||||||
import type { FileWithHandle } from 'browser-fs-access'
|
import type { FileWithHandle } from 'browser-fs-access'
|
||||||
|
import { fileOpen } from 'browser-fs-access'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const {
|
||||||
|
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
|
imgClass?: string
|
||||||
|
|
||||||
loading?: boolean
|
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(() => props.original || '')
|
const defaultImage = computed(() => 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: props.allowedFileTypes,
|
mimeTypes: allowedFileTypes,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!props.allowedFileTypes.includes(image.type)) {
|
if (!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 > props.allowedFileSize) {
|
else if (image.size > 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
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
const {
|
const {
|
||||||
zIndex = 100,
|
zIndex = 100,
|
||||||
background = 'transparent',
|
background = 'transparent',
|
||||||
} = $defineProps<{
|
} = defineProps<{
|
||||||
zIndex?: number
|
zIndex?: number
|
||||||
background?: string
|
background?: string
|
||||||
}>()
|
}>()
|
|
@ -1,15 +1,15 @@
|
||||||
<script setup lang="ts" generic="T, O, U = T">
|
<script setup lang="ts" generic="T, O, U = T">
|
||||||
|
import type { mastodon } from 'masto'
|
||||||
// @ts-expect-error missing types
|
// @ts-expect-error missing types
|
||||||
import { DynamicScroller } from 'vue-virtual-scroller'
|
import { DynamicScroller } from 'vue-virtual-scroller'
|
||||||
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
|
||||||
import type { mastodon } from 'masto'
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
paginator,
|
paginator,
|
||||||
stream,
|
|
||||||
eventType,
|
|
||||||
keyProp = 'id',
|
keyProp = 'id',
|
||||||
virtualScroller = false,
|
virtualScroller = false,
|
||||||
|
stream,
|
||||||
|
eventType,
|
||||||
preprocess,
|
preprocess,
|
||||||
endMessage = true,
|
endMessage = true,
|
||||||
} = defineProps<{
|
} = defineProps<{
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<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[]
|
options: CommonRouteTabOption[]
|
||||||
moreOptions?: CommonRouteTabMoreOption
|
moreOptions?: CommonRouteTabMoreOption
|
||||||
command?: boolean
|
command?: boolean
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { as = 'div', active } = defineProps<{
|
const { as = 'div', active } = defineProps<{
|
||||||
as: any
|
as?: string
|
||||||
active: boolean
|
active: boolean
|
||||||
}>()
|
}>()
|
||||||
|
|
|
@ -3,16 +3,16 @@ defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const props = defineProps<{
|
const { count } = defineProps<{
|
||||||
count: number
|
count: number
|
||||||
keypath: string
|
keypath: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumber()
|
const { formatHumanReadableNumber, formatNumber, forSR } = useHumanReadableNumber()
|
||||||
|
|
||||||
const useSR = computed(() => forSR(props.count))
|
const useSR = computed(() => forSR(count))
|
||||||
const rawNumber = computed(() => formatNumber(props.count))
|
const rawNumber = computed(() => formatNumber(count))
|
||||||
const humanReadableNumber = computed(() => formatHumanReadableNumber(props.count))
|
const humanReadableNumber = computed(() => formatHumanReadableNumber(count))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
|
@ -1,16 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = withDefaults(defineProps<{
|
const {
|
||||||
|
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>()
|
||||||
|
@ -24,11 +31,11 @@ useCommand({
|
||||||
scope: 'Actions',
|
scope: 'Actions',
|
||||||
|
|
||||||
order: -1,
|
order: -1,
|
||||||
visible: () => props.command && props.text,
|
visible: () => command && text,
|
||||||
|
|
||||||
name: () => props.text!,
|
name: () => text!,
|
||||||
icon: () => props.icon ?? 'i-ri:question-line',
|
icon: () => icon ?? 'i-ri:question-line',
|
||||||
description: () => props.description,
|
description: () => description,
|
||||||
|
|
||||||
onActivate() {
|
onActivate() {
|
||||||
const clickEvent = new MouseEvent('click', {
|
const clickEvent = new MouseEvent('click', {
|
||||||
|
@ -46,6 +53,7 @@ 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
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = defineProps<{
|
const { code, lang } = defineProps<{
|
||||||
code: string
|
code: string
|
||||||
lang?: string
|
lang?: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const raw = computed(() => decodeURIComponent(props.code).replace(/'/g, '\''))
|
const raw = computed(() => decodeURIComponent(code).replace(/'/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 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>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { mastodon } from 'masto'
|
import type { mastodon } from 'masto'
|
||||||
|
|
||||||
const { paginator } = defineProps<{
|
defineProps<{
|
||||||
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
|
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
|
||||||
}>()
|
}>()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { as, alt, dataEmojiId } = defineProps<{
|
const { alt, dataEmojiId } = defineProps<{
|
||||||
as: string
|
as: string
|
||||||
alt?: string
|
alt?: string
|
||||||
dataEmojiId?: string
|
dataEmojiId?: string
|
|
@ -44,6 +44,7 @@ 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"
|
||||||
>
|
>
|
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'),
|
'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 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-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
|
<div flex gap-2 items-center :overflow-hidden="!noOverflowHidden ? '' : false" w-full>
|
||||||
<NuxtLink
|
<button
|
||||||
v-if="backOnSmallScreen || back" flex="~ gap1" items-center btn-text p-0 xl:hidden
|
v-if="backOnSmallScreen || back"
|
||||||
|
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 i-ri:arrow-left-line class="rtl-flip" />
|
<div text-lg i-ri:arrow-left-line class="rtl-flip" />
|
||||||
</NuxtLink>
|
</button>
|
||||||
<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>
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<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<{
|
const emit = defineEmits<{
|
||||||
(evt: 'choice', choice: ConfirmDialogChoice): void
|
(evt: 'choice', choice: ConfirmDialogChoice): void
|
||||||
|
@ -11,7 +11,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(() => props.extraOptionType === 'mute')
|
const isMute = computed(() => extraOptionType === 'mute')
|
||||||
|
|
||||||
function handleChoice(choice: ConfirmDialogChoice['choice']) {
|
function handleChoice(choice: ConfirmDialogChoice['choice']) {
|
||||||
const dialogChoice = {
|
const dialogChoice = {
|
||||||
|
@ -40,7 +40,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" />
|
||||||
<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" />
|
<CommonCheckbox v-model="shouldMuteNotifications" :label="$t('confirm.mute_account.notifications')" prepend-checkbox checked-icon-color="text-primary" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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,
|
|
@ -1,51 +1,27 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
|
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({
|
defineOptions({
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const {
|
||||||
zIndex: 100,
|
zIndex = 100,
|
||||||
closeByMask: true,
|
closeByMask = true,
|
||||||
useVIf: true,
|
useVIf = true,
|
||||||
keepAlive: false,
|
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<{
|
const emit = defineEmits<{
|
||||||
/** v-model dialog visibility */
|
/** v-model dialog visibility */
|
||||||
|
@ -85,7 +61,7 @@ function close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickMask() {
|
function clickMask() {
|
||||||
if (props.closeByMask)
|
if (closeByMask)
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +73,7 @@ watch(visible, (value) => {
|
||||||
|
|
||||||
const notInCurrentPage = computed(() => deactivated.value || routePath.value !== route.path)
|
const notInCurrentPage = computed(() => deactivated.value || routePath.value !== route.path)
|
||||||
watch(notInCurrentPage, (value) => {
|
watch(notInCurrentPage, (value) => {
|
||||||
if (props.keepAlive)
|
if (keepAlive)
|
||||||
return
|
return
|
||||||
if (value)
|
if (value)
|
||||||
close()
|
close()
|
||||||
|
@ -106,7 +82,7 @@ watch(notInCurrentPage, (value) => {
|
||||||
// controls the state of v-if.
|
// controls the state of v-if.
|
||||||
// when useVIf is toggled, v-if has the same state as modelValue, otherwise v-if is true
|
// when useVIf is toggled, v-if has the same state as modelValue, otherwise v-if is true
|
||||||
const isVIf = computed(() => {
|
const isVIf = computed(() => {
|
||||||
return props.useVIf
|
return useVIf
|
||||||
? visible.value
|
? visible.value
|
||||||
: true
|
: true
|
||||||
})
|
})
|
||||||
|
@ -114,7 +90,7 @@ const isVIf = computed(() => {
|
||||||
// controls the state of v-show.
|
// controls the state of v-show.
|
||||||
// when useVIf is toggled, v-show is true, otherwise it has the same state as modelValue
|
// when useVIf is toggled, v-show is true, otherwise it has the same state as modelValue
|
||||||
const isVShow = computed(() => {
|
const isVShow = computed(() => {
|
||||||
return !props.useVIf
|
return !useVIf
|
||||||
? visible.value
|
? visible.value
|
||||||
: true
|
: true
|
||||||
})
|
})
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ErrorDialogData } from '~/types'
|
import type { ErrorDialogData } from '#shared/types'
|
||||||
|
|
||||||
defineProps<ErrorDialogData>()
|
defineProps<ErrorDialogData>()
|
||||||
</script>
|
</script>
|
|
@ -1,8 +1,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Vector2 } from '@vueuse/gesture'
|
import type { Vector2 } from '@vueuse/gesture'
|
||||||
|
import type { mastodon } from 'masto'
|
||||||
import { useGesture } from '@vueuse/gesture'
|
import { useGesture } from '@vueuse/gesture'
|
||||||
import { useReducedMotion } from '@vueuse/motion'
|
import { useReducedMotion } from '@vueuse/motion'
|
||||||
import type { mastodon } from 'masto'
|
|
||||||
|
|
||||||
const { media = [] } = defineProps<{
|
const { media = [] } = defineProps<{
|
||||||
media?: mastodon.v1.MediaAttachment[]
|
media?: mastodon.v1.MediaAttachment[]
|
|
@ -2,9 +2,23 @@
|
||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
import type { NavButtonName } from '../../composables/settings'
|
import type { NavButtonName } from '../../composables/settings'
|
||||||
|
|
||||||
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
import {
|
||||||
|
NavButtonBookmark,
|
||||||
|
NavButtonCompose,
|
||||||
|
NavButtonExplore,
|
||||||
|
NavButtonFavorite,
|
||||||
|
NavButtonFederated,
|
||||||
|
NavButtonHashtag,
|
||||||
|
NavButtonHome,
|
||||||
|
NavButtonList,
|
||||||
|
NavButtonLocal,
|
||||||
|
NavButtonMention,
|
||||||
|
NavButtonMoreMenu,
|
||||||
|
NavButtonNotification,
|
||||||
|
NavButtonSearch,
|
||||||
|
} from '#components'
|
||||||
|
|
||||||
import { NavButtonExplore, NavButtonFederated, NavButtonHome, NavButtonLocal, NavButtonMention, NavButtonMoreMenu, NavButtonNotification, NavButtonSearch } from '#components'
|
import { STORAGE_KEY_BOTTOM_NAV_BUTTONS } from '~/constants'
|
||||||
|
|
||||||
interface NavButton {
|
interface NavButton {
|
||||||
name: string
|
name: string
|
||||||
|
@ -16,9 +30,14 @@ const navButtons: NavButton[] = [
|
||||||
{ name: 'search', component: NavButtonSearch },
|
{ name: 'search', component: NavButtonSearch },
|
||||||
{ name: 'notification', component: NavButtonNotification },
|
{ name: 'notification', component: NavButtonNotification },
|
||||||
{ name: 'mention', component: NavButtonMention },
|
{ name: 'mention', component: NavButtonMention },
|
||||||
|
{ name: 'favorite', component: NavButtonFavorite },
|
||||||
|
{ name: 'bookmark', component: NavButtonBookmark },
|
||||||
|
{ name: 'compose', component: NavButtonCompose },
|
||||||
{ name: 'explore', component: NavButtonExplore },
|
{ name: 'explore', component: NavButtonExplore },
|
||||||
{ name: 'local', component: NavButtonLocal },
|
{ name: 'local', component: NavButtonLocal },
|
||||||
{ name: 'federated', component: NavButtonFederated },
|
{ name: 'federated', component: NavButtonFederated },
|
||||||
|
{ name: 'list', component: NavButtonList },
|
||||||
|
{ name: 'hashtag', component: NavButtonHashtag },
|
||||||
{ name: 'moreMenu', component: NavButtonMoreMenu },
|
{ name: 'moreMenu', component: NavButtonMoreMenu },
|
||||||
]
|
]
|
||||||
|
|
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,13 +1,38 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
||||||
|
|
||||||
const { command } = defineProps<{
|
defineProps<{
|
||||||
command?: boolean
|
command?: boolean
|
||||||
}>()
|
}>()
|
||||||
const { notifications } = useNotifications()
|
const { notifications } = useNotifications()
|
||||||
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
|
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
|
||||||
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
||||||
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
|
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
|
||||||
|
|
||||||
|
const notificationsLink = computed(() => {
|
||||||
|
const hydrated = isHydrated.value
|
||||||
|
const user = currentUser.value
|
||||||
|
const lastRoute = lastAccessedNotificationRoute.value
|
||||||
|
if (!hydrated || !user || !lastRoute) {
|
||||||
|
return '/notifications'
|
||||||
|
}
|
||||||
|
|
||||||
|
return `/notifications/${lastRoute}`
|
||||||
|
})
|
||||||
|
const exploreLink = computed(() => {
|
||||||
|
const hydrated = isHydrated.value
|
||||||
|
const server = currentServer.value
|
||||||
|
let lastRoute = lastAccessedExploreRoute.value
|
||||||
|
if (!hydrated) {
|
||||||
|
return '/explore'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastRoute.length) {
|
||||||
|
lastRoute = `/${lastRoute}`
|
||||||
|
}
|
||||||
|
|
||||||
|
return server ? `/${server}/explore${lastRoute}` : `/explore${lastRoute}`
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -16,7 +41,7 @@ const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLO
|
||||||
|
|
||||||
<div class="spacer" shrink xl:hidden />
|
<div class="spacer" shrink xl:hidden />
|
||||||
<NavSideItem :text="$t('nav.home')" to="/home" icon="i-ri:home-5-line" user-only :command="command" />
|
<NavSideItem :text="$t('nav.home')" to="/home" icon="i-ri:home-5-line" user-only :command="command" />
|
||||||
<NavSideItem :text="$t('nav.notifications')" :to="`/notifications/${lastAccessedNotificationRoute}`" icon="i-ri:notification-4-line" user-only :command="command">
|
<NavSideItem :text="$t('nav.notifications')" :to="notificationsLink" icon="i-ri:notification-4-line" user-only :command="command">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<div flex relative>
|
<div flex relative>
|
||||||
<div class="i-ri:notification-4-line" text-xl />
|
<div class="i-ri:notification-4-line" text-xl />
|
||||||
|
@ -34,7 +59,7 @@ const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLO
|
||||||
<NavSideItem :text="$t('action.compose')" to="/compose" icon="i-ri:quill-pen-line" user-only :command="command" />
|
<NavSideItem :text="$t('action.compose')" to="/compose" icon="i-ri:quill-pen-line" user-only :command="command" />
|
||||||
|
|
||||||
<div class="spacer" shrink hidden sm:block />
|
<div class="spacer" shrink hidden sm:block />
|
||||||
<NavSideItem :text="$t('nav.explore')" :to="isHydrated ? `/${currentServer}/explore/${lastAccessedExploreRoute}` : `/explore/${lastAccessedExploreRoute}`" icon="i-ri:compass-3-line" :command="command" />
|
<NavSideItem :text="$t('nav.explore')" :to="exploreLink" icon="i-ri:compass-3-line" :command="command" />
|
||||||
<NavSideItem :text="$t('nav.local')" :to="isHydrated ? `/${currentServer}/public/local` : '/public/local'" icon="i-ri:group-2-line " :command="command" />
|
<NavSideItem :text="$t('nav.local')" :to="isHydrated ? `/${currentServer}/public/local` : '/public/local'" icon="i-ri:group-2-line " :command="command" />
|
||||||
<NavSideItem :text="$t('nav.federated')" :to="isHydrated ? `/${currentServer}/public` : '/public'" icon="i-ri:earth-line" :command="command" />
|
<NavSideItem :text="$t('nav.federated')" :to="isHydrated ? `/${currentServer}/public` : '/public'" icon="i-ri:earth-line" :command="command" />
|
||||||
<NavSideItem :text="$t('nav.lists')" :to="isHydrated ? `/${currentServer}/lists` : '/lists'" icon="i-ri:list-check" user-only :command="command" />
|
<NavSideItem :text="$t('nav.lists')" :to="isHydrated ? `/${currentServer}/lists` : '/lists'" icon="i-ri:list-check" user-only :command="command" />
|
|
@ -1,13 +1,11 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const props = withDefaults(defineProps<{
|
const { text, icon, to, userOnly = false, command } = defineProps<{
|
||||||
text?: string
|
text?: string
|
||||||
icon: string
|
icon: string
|
||||||
to: string | Record<string, string>
|
to: string | Record<string, string>
|
||||||
userOnly?: boolean
|
userOnly?: boolean
|
||||||
command?: boolean
|
command?: boolean
|
||||||
}>(), {
|
}>()
|
||||||
userOnly: false,
|
|
||||||
})
|
|
||||||
|
|
||||||
defineSlots<{
|
defineSlots<{
|
||||||
icon: (props: object) => void
|
icon: (props: object) => void
|
||||||
|
@ -19,12 +17,12 @@ const router = useRouter()
|
||||||
useCommand({
|
useCommand({
|
||||||
scope: 'Navigation',
|
scope: 'Navigation',
|
||||||
|
|
||||||
name: () => props.text ?? (typeof props.to === 'string' ? props.to as string : props.to.name),
|
name: () => text ?? (typeof to === 'string' ? to as string : to.name),
|
||||||
icon: () => props.icon,
|
icon: () => icon,
|
||||||
visible: () => props.command,
|
visible: () => command,
|
||||||
|
|
||||||
onActivate() {
|
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
|
// 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.
|
// when we know there is no user.
|
||||||
const noUserDisable = computed(() => !isHydrated.value || (props.userOnly && !currentUser.value))
|
const noUserDisable = computed(() => !isHydrated.value || (userOnly && !currentUser.value))
|
||||||
const noUserVisual = computed(() => isHydrated.value && props.userOnly && !currentUser.value)
|
const noUserVisual = computed(() => isHydrated.value && userOnly && !currentUser.value)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
|
@ -29,21 +29,21 @@ router.afterEach(() => {
|
||||||
@click.prevent="onClickLogo"
|
@click.prevent="onClickLogo"
|
||||||
>
|
>
|
||||||
<NavLogo shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip" />
|
<NavLogo shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip" />
|
||||||
<div v-show="isHydrated" hidden xl:block text-secondary>
|
<div v-show="isHydrated" hidden xl:block>
|
||||||
{{ $t('app_name') }} <sup text-sm italic mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
<span pr-1>{{ $t('app_name') }}</span>
|
||||||
|
<sup text-sm italic mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
||||||
</div>
|
</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div
|
<div hidden xl:flex items-center me-6 mt-2 gap-1>
|
||||||
hidden xl:flex items-center me-8 mt-2 gap-1
|
<CommonTooltip :content="$t('nav.back')" :distance="0">
|
||||||
>
|
<button
|
||||||
<CommonTooltip :content="$t('nav.back')">
|
type="button"
|
||||||
<NuxtLink
|
|
||||||
:aria-label="$t('nav.back')"
|
: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)"
|
@click="$router.go(-1)"
|
||||||
>
|
>
|
||||||
<div text-xl i-ri:arrow-left-line class="rtl-flip" btn-text />
|
<div text-xl i-ri:arrow-left-line class="rtl-flip" />
|
||||||
</NuxtLink>
|
</button>
|
||||||
</CommonTooltip>
|
</CommonTooltip>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
11
app/components/nav/button/Bookmark.vue
Normal file
11
app/components/nav/button/Bookmark.vue
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
11
app/components/nav/button/Compose.vue
Normal file
11
app/components/nav/button/Compose.vue
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
11
app/components/nav/button/Favorite.vue
Normal file
11
app/components/nav/button/Favorite.vue
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
11
app/components/nav/button/Hashtag.vue
Normal file
11
app/components/nav/button/Hashtag.vue
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<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>
|
17
app/components/nav/button/List.vue
Normal file
17
app/components/nav/button/List.vue
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<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>
|
|
@ -1,10 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
defineModel<boolean>()
|
const model = defineModel<boolean>()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NavBottomMoreMenu
|
<NavBottomMoreMenu
|
||||||
v-slot="{ toggleVisible, show }" v-model="modelValue!" flex flex-row items-center
|
v-slot="{ toggleVisible, show }" v-model="model!" flex flex-row items-center
|
||||||
place-content-center h-full flex-1 cursor-pointer
|
place-content-center h-full flex-1 cursor-pointer
|
||||||
>
|
>
|
||||||
<button
|
<button
|
|
@ -4,6 +4,7 @@ import { STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
|
||||||
defineProps<{
|
defineProps<{
|
||||||
activeClass: string
|
activeClass: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { notifications } = useNotifications()
|
const { notifications } = useNotifications()
|
||||||
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
|
||||||
</script>
|
</script>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue