Compare commits

...

581 commits

Author SHA1 Message Date
b217b4dc25
Merge branch 'pull-v0.13.2'
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-04-07 14:35:26 +02:00
f2edec194f
feat(config): switch default instance
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
set fedi.femby.page as default instance
2024-04-07 14:31:19 +02:00
087f8cc992
fix(ci): add missing docker pushes 2024-04-07 14:29:15 +02:00
6efbf8768b
fix(ci): add secrets 2024-04-07 14:29:15 +02:00
cd934fcd55
fix(ci): docker login 2024-04-07 14:29:15 +02:00
7f1e97a37c
fix(ci): remove docker login 2024-04-07 14:29:15 +02:00
58c84b2f9b
fix(ci): add docker login 2024-04-07 14:29:14 +02:00
322ffeef12
feat(ci): add docker push test 2024-04-07 14:29:14 +02:00
4a8110a52e
fix(ci): add missing flags docker buildx 2024-04-07 14:29:14 +02:00
d481c0ae7a
fix(ci): added missing flag for cut 2024-04-07 14:29:14 +02:00
68ffb627e7
fix(ci): deleted sh uncompatible line 2024-04-07 14:29:14 +02:00
b221687139
feat(ci): Made ci sh compatible (hopefully^^) 2024-04-07 14:29:14 +02:00
7b10620cca
feat(ci): Add build tags 2024-04-07 14:29:13 +02:00
498face3cf
test(ci): 2024-04-07 14:29:13 +02:00
672ff46072
test(ci): add git to image 2024-04-07 14:29:13 +02:00
81b5f8b8e7
test(ci): another syntax test 2024-04-07 14:29:13 +02:00
721e55be06
test(ci): another syntax test 2024-04-07 14:29:13 +02:00
eba4cc0757
test(ci): another syntax test 2024-04-07 14:29:13 +02:00
80818ed52d
test(ci): syntax test 2024-04-07 14:28:32 +02:00
patak-dev
25fb7c1c97 chore: release v0.13.2 2024-04-05 18:29:15 +02:00
TAKAHASHI Shuuji
839aa52e86
fix: adjust background spacing in direct message (#2764) 2024-04-05 16:23:52 +00:00
TAKAHASHI Shuuji
9ff55289ea
ci(ci.yml): limit maximum execution time of ci test (#2763) 2024-04-05 16:19:53 +00:00
Joaquín Sánchez
73293fbcd3
chore: update nuxt to 3.11.2 (#2755) 2024-04-05 14:34:42 +00:00
TAKAHASHI Shuuji
a27c218802
chore: update github avatar images (#2762) 2024-04-05 14:34:19 +00:00
Emanuel Pina
f8fc0efadc
feat(i18n): Update portuguese from Portugal translation (#2756) 2024-04-05 09:16:30 +00:00
Joaquín Sánchez
618a5b2df3
chore(ui): use full width in settings toggle items (#2754) 2024-04-05 09:16:11 +00:00
lazzzis
1146dca5f6
fix(ui): media preview card is misaligned (#2751) 2024-04-05 09:15:44 +00:00
Joaquín Sánchez
f86e856ee6
feat(i18n): add missing spanish translations (gifs, docs and contributing) (#2753) 2024-04-04 18:36:03 +00:00
renovate[bot]
6d13d61227
chore(deps): update devdependencies (#2725)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
2024-04-04 16:47:27 +00:00
Francesco
0de9825bf2
feat(i18n): Update it-IT locale (#2750) 2024-04-04 13:25:09 +00:00
Joaquín Sánchez
3f0b234cc4
feat(ui): add max. file size check before upload attachment (#2709)
Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
2024-04-04 10:28:18 +00:00
lazzzis
8f04ea8eee
feat(ui): improve gif support (#2752) 2024-04-04 10:27:52 +00:00
Emanuel Pina
7dcafa3fe0
feat(i18n): Update portuguese from Portugal translation (#2747) 2024-04-04 05:17:03 +00:00
Joaquín Sánchez
bead2183b2
fix(ui): don't scroll on settings item click when external or _blank target link (#2742) 2024-04-03 13:59:42 +00:00
patak
59dda09cd4
fix: notifications in update timeline (#2740) 2024-04-03 13:59:24 +00:00
lazzzis
d0b115751f
feat(ui): style blockquote (#2744) 2024-04-03 04:17:52 +00:00
lazzzis
c6787aae3f
fix(ui): clicking on custom emoji does not navigate to status detail (#2743) 2024-04-03 04:17:30 +00:00
patak
9025416ab3
feat: update info dialog (#2741) 2024-04-02 03:17:45 +00:00
TAKAHASHI Shuuji
aa28257754
feat: add "Documentation" link to "About" page (#2734) 2024-04-01 14:57:11 +00:00
TAKAHASHI Shuuji
d807e06fa0
refactor: various typo fixes (#2735) 2024-04-01 14:56:30 +00:00
TAKAHASHI Shuuji
611d556936
feat: put sign-in icon to default "Sign in" button (#2736) 2024-04-01 14:55:31 +00:00
Xabi
4313002950
feat(i18n): update eu-ES.json (#2737) 2024-04-01 14:54:37 +00:00
TAKAHASHI Shuuji
de11a60b17
feat: add "How to contribute?" link next to language status (#2733) 2024-04-01 05:27:47 +00:00
TAKAHASHI Shuuji
5064b269e7
feat: show background color for direct post to reduce mistake (#2732) 2024-04-01 05:26:51 +00:00
TAKAHASHI Shuuji
d8d9975756
fix: hide duplicated status actions items on details page in zen mode (#2731) 2024-04-01 05:25:53 +00:00
TAKAHASHI Shuuji
eee671cdc3
fix: improve keyboard operability especially on search page and editor (#2730)
Co-authored-by: patak <583075+patak-dev@users.noreply.github.com>
2024-04-01 05:24:42 +00:00
lazzzis
587c063aba
fix(ui): remove a duplicated command (#2718) 2024-03-30 04:19:22 +00:00
lazzzis
28514e956d
fix(ui): wrong polls are removed (#2720) 2024-03-30 04:18:33 +00:00
lazzzis
42aeb8fa35
fix(ui): prevent from navigating to search page when opening command panel (#2719) 2024-03-30 04:15:58 +00:00
Joaquín Sánchez
f6f50a582e
fix(ui): change status actions title (#2717) 2024-03-29 20:04:55 +00:00
patak-dev
f86818867b chore: release v0.13.1 2024-03-29 16:37:28 +01:00
Sma11X
82d962a54b
fix: add missing notification event type (#2714) 2024-03-29 15:31:53 +00:00
renovate[bot]
1b189043e4
chore(deps): update devdependencies (major) (#2400)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 08:51:07 +00:00
renovate[bot]
a4867566d9
chore(deps): update devdependencies (#2697)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 08:34:06 +00:00
renovate[bot]
0757db69b2
chore(deps): update dependency @types/prettier to v3 (#2712)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 08:33:11 +00:00
renovate[bot]
f0de25c992
chore(deps): update dependency @antfu/eslint-config to ^2.9.0 (#2711)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-26 08:32:33 +00:00
TAKAHASHI Shuuji
660549b08b
chore: update masto to v6.7.0 (#2708) 2024-03-21 15:18:53 +00:00
Joaquín Sánchez
7807730118
feat(i18n): add missing spanish mute duration dialog entries (#2696) 2024-03-21 12:37:57 +00:00
Joaquín Sánchez
b526db0860
chore: update i18n module to 8.2.0 (#2703) 2024-03-21 12:13:28 +00:00
Sma11X
0133324ded
fix: correct local timeline stream (#2707) 2024-03-21 10:08:51 +00:00
TAKAHASHI Shuuji
e9ab0cd40b
fix: prevent showing notification errors for dev for known emoji reaction types (#2704) 2024-03-19 15:04:16 +00:00
Joaquín Sánchez
9251ec496b
chore: add ofetch to typescript.hoist (#2693)
Co-authored-by: Daniel Roe <daniel@roe.dev>
2024-03-19 12:56:14 +00:00
renovate[bot]
bd4cd02b2b
chore(deps): update pnpm to v8.15.5 (#2698)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 12:40:13 +00:00
Joaquín Sánchez
74ccfece5d
chore: update nuxt to 3.11.1 (#2702) 2024-03-19 12:36:25 +00:00
35b4c80311
fix(ci): add missing docker pushes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-03-18 14:50:56 +01:00
f6a081d199 Merge pull request 'feat-add-woodpecker' (#1) from feat-add-woodpecker into main
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Reviewed-on: #1
2024-03-18 13:42:55 +00:00
5e419045ed
fix(ci): add secrets
All checks were successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
2024-03-18 14:24:49 +01:00
cfdbb66b96
fix(ci): docker login 2024-03-18 14:16:41 +01:00
c717aace86
fix(ci): remove docker login 2024-03-18 14:10:31 +01:00
6713329a5e
fix(ci): add docker login 2024-03-18 14:00:02 +01:00
7470468077
feat(ci): add docker push test 2024-03-18 13:53:05 +01:00
9044b3bcad
fix(ci): add missing flags docker buildx 2024-03-18 13:41:39 +01:00
5bd9dce91e
fix(ci): added missing flag for cut 2024-03-18 13:39:40 +01:00
12e14cfc05
fix(ci): deleted sh uncompatible line 2024-03-18 13:37:51 +01:00
1ea4399765
feat(ci): Made ci sh compatible (hopefully^^) 2024-03-18 13:34:44 +01:00
991cb812da
feat(ci): Add build tags 2024-03-18 13:26:08 +01:00
Sma11X
c89e499f96
fix: pre tag overwritten by default style (#2699) 2024-03-18 11:34:03 +00:00
Dohány Tamás
89e3582dd7
feat(i18n): Update hu-HU.json (#2694) 2024-03-17 19:11:42 +00:00
TAKAHASHI Shuuji
48c013709a
ci(docker.yml): support linux/arm64 container (#2691) 2024-03-17 15:15:04 +00:00
renovate[bot]
f90f0a2e61
chore(deps): update pnpm to v8.15.4 (#2627)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-17 15:14:19 +00:00
renovate[bot]
c58b585855
chore(deps): update lint (#2399)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-17 15:14:04 +00:00
Joaquín Sánchez
ded2e0f3d7
chore: update nuxt to 3.11.0 (#2692) 2024-03-17 14:32:02 +00:00
9b77efe1d7
test(ci): 2024-03-16 15:52:25 +01:00
aec670a903
test(ci): add git to image 2024-03-16 15:48:38 +01:00
1218f92133
test(ci): another syntax test 2024-03-16 15:45:13 +01:00
7c0986a005
test(ci): another syntax test 2024-03-16 15:42:49 +01:00
ac01207283
test(ci): another syntax test 2024-03-16 15:37:04 +01:00
ef169d682f
test(ci): syntax test 2024-03-16 15:33:04 +01:00
Joaquín Sánchez
21d5633233
chore: bump to eslint-config to 2.8.1 (#2685) 2024-03-13 06:39:28 +00:00
Joaquín Sánchez
7703565c75
fix(ui): hashtags not working when composing (#2686) 2024-03-12 20:47:05 +00:00
cuithon
5a9546ec0a
chore: fix typo (#2681)
Signed-off-by: cuithon <dscs@outlook.com>
2024-03-12 07:58:20 +00:00
patak
bc30a8bd82 chore: release v0.13.0 2024-03-11 12:08:52 +01:00
Duy
c432c2bd0d
feat(i18n): Update vi-VN.json (#2664) 2024-03-11 10:55:18 +00:00
Francesco
364fbd350b
feat(i18n): Update it-IT locale (#2666) 2024-03-11 10:55:05 +00:00
Xabi
c64580f782
feat(i18n): update eu-ES.json (#2670) 2024-03-11 10:54:53 +00:00
Emanuel Pina
e7dfdafd59
feat(i18n): Update portuguese from Portugal translation (#2671) 2024-03-11 10:54:38 +00:00
Ayo Ayco
b06ec9356d
feat(i18n): update Tagalog translations (#2677) 2024-03-11 10:54:20 +00:00
TAKAHASHI Shuuji
3b1a66c93c
fix: fix vue/no-ref-as-operand and vue/return-in-computed-property ESLint errors (#2679) 2024-03-11 10:53:25 +00:00
TAKAHASHI Shuuji
ed8a1811cc
chore: upgrade @vueuse/core from 10.8.0 to 10.9.0 (#2674) 2024-03-10 18:38:37 +00:00
TAKAHASHI Shuuji
dfbe2e080d
fix: prevent empty search keyword to send invalid request (#2676) 2024-03-10 18:37:32 +00:00
TAKAHASHI Shuuji
0fd9374e8c
fix: fix incorrect follow status on followers and following pages (#2669) 2024-03-09 19:31:40 +00:00
TAKAHASHI Shuuji
1c8e48bee4
fix: show loading spinner on follow button while fetching account relationship (#2667)
Co-authored-by: patak <583075+patak-dev@users.noreply.github.com>
2024-03-09 18:44:44 +00:00
TAKAHASHI Shuuji
3448335356
feat: allow to set mute duration and notifications mute option (#2665) 2024-03-09 09:52:41 +00:00
Joaquín Sánchez
4954473f50
chore: extract bg and theme colors to constants (#2662) 2024-03-07 19:15:35 +00:00
TAKAHASHI Shuuji
efa17caf5e
fix: consistent hover highlight styling in mobile bottom navigation menus (#2661) 2024-03-07 19:14:20 +00:00
Joaquín Sánchez
df165f0023
fix(pwa): wrong web manifest colors (#2659) 2024-03-07 14:55:27 +00:00
TAKAHASHI Shuuji
0f583ece28
feat: remember last accessed explore tab (#2658) 2024-03-07 14:33:25 +00:00
Ivan Demchuk
d579977790
feat(i18n): update Ukrainian translations (#2660) 2024-03-07 13:41:24 +00:00
TAKAHASHI Shuuji
8786c83db7
fix: remember last accessed notification tab (#2654) 2024-03-06 22:00:07 +00:00
patak
1ce913e69d chore: release v0.12.1 2024-03-06 16:52:16 +01:00
Joaquín Sánchez
48a8b74e7c
fix(ui): mentions not working when composing (#2655) 2024-03-06 15:42:41 +00:00
patak
1ff13952b0 chore: release v0.12.0 2024-03-06 08:48:14 +01:00
Francesco
02f7c4b291
feat(i18n): Update it-IT locale (#2652) 2024-03-05 20:12:05 +00:00
Joaquín Sánchez
9da77637b2
chore: bump to eslint-config v2.8.0 (#2651)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2024-03-05 14:48:58 +00:00
Joaquín Sánchez
62f70250d5
fix(ui): wrong reply to account (#2649) 2024-03-05 13:21:58 +00:00
Joaquín Sánchez
873c62e9ef
feat(i18n): add missing nav.hashtags entry for Spanish translation (#2650) 2024-03-05 13:21:12 +00:00
Emanuel Pina
b1ff1e6277
feat(i18n): Update portuguese from Portugal translation (#2648) 2024-03-05 13:20:44 +00:00
TAKAHASHI Shuuji
f644148844
feat: introduce new "Followed tags" page (#2642)
Co-authored-by: patak <583075+patak-dev@users.noreply.github.com>
2024-03-05 10:27:10 +00:00
Joaquín Sánchez
3120bbb77f
feat(content-rich html parsing): add paragraphs LTR/RTL direction support (#2545) 2024-03-05 06:25:58 +00:00
renovate[bot]
6cbe65c9d8
chore(deps): update devdependencies (#2646)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-04 20:39:12 +00:00
qezwan
1c908363cb
feat(i18n): Add central kurdish locale(ckb) (#2332)
Co-authored-by: userquin <userquin@gmail.com>
2024-03-04 20:28:57 +00:00
Jafar Farganlooj
c01a15c930
feat(i18n): Add Persian translation (#2535)
Co-authored-by: userquin <userquin@gmail.com>
2024-03-04 19:59:03 +00:00
nonnullish
0c15aa55d8
fix: fix emoji placement (#2626) (#2645) 2024-03-04 19:56:59 +00:00
Joaquín Sánchez
9f04e17e57
fix(ui): avoid fetching status account in replying to until visible (#2638) 2024-03-04 19:55:02 +00:00
Joaquín Sánchez
308b50cbad
feat(ui): fetch account data on demand (#2632) 2024-03-04 19:20:13 +00:00
TAKAHASHI Shuuji
e44833b18a
feat: show tag hover card when hovering cursor on hashtag links (#2621)
Co-authored-by: userquin <userquin@gmail.com>
2024-03-04 16:45:25 +00:00
Joaquín Sánchez
0fa87f71a4
chore(tests): fix vitest can't terminate worker (#2644) 2024-03-04 16:41:38 +00:00
Emanuel Pina
edfbe2c3ed
feat(i18n): Update portuguese from Portugal translation (#2633) 2024-03-04 16:02:35 +00:00
Joaquín Sánchez
70c7e93919
refactor: update no reactivity transform changes (#2639) 2024-03-04 16:01:56 +00:00
TAKAHASHI Shuuji
95e466146d
fix: show correct reply target user account in reply post header (#2640) 2024-02-29 20:55:46 +00:00
Joaquín Sánchez
efec212a9f
fix(pwa): update pwa plugin to fix broken prompt (#2634) 2024-02-29 16:55:31 +00:00
Kevin Pliester
1844af0a41
feat(i18n): German translation for new shortcuts (#2641) 2024-02-29 16:09:04 +00:00
Joaquín Sánchez
72b80d4984
fix(ui): missing replying to links (#2637) 2024-02-28 18:02:09 +00:00
Francesco
6dc5a68c80
feat(i18n): Update it-IT locale (#2630) 2024-02-26 13:22:51 +00:00
TAKAHASHI Shuuji
310b32c123
fix: allow to edit alt description of attached image again (#2631) 2024-02-26 13:11:21 +00:00
Joaquín Sánchez
748dd5e19f
fix(cache): return cached account as promise (#2623) 2024-02-25 19:43:34 +00:00
Joaquín Sánchez
c00d6f7bf8
feat(ui): add missing goto magic keys spanish translation entries (#2625) 2024-02-25 19:39:57 +00:00
Joaquín Sánchez
fc5d248094
fix(ui): account mentions not being fetched when visible (#2624) 2024-02-25 19:28:38 +00:00
Joaquín Sánchez
6f20ce5bba
chore(test): add hanging-process reporter on CI (#2622) 2024-02-25 14:13:27 +00:00
TAKAHASHI Shuuji
edcc8741bf
feat: add several new shortcut keys for navigation (#2618) 2024-02-24 19:28:56 +00:00
renovate[bot]
3584151fab
fix(deps): update tiptap to v2.2.4 (#2398)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: userquin <userquin@gmail.com>
2024-02-24 19:26:14 +00:00
Joaquín Sánchez
efb6967e6a
fix(ui): help preview tabindex, auto focus and buttons (#2616) 2024-02-24 18:24:55 +00:00
Joaquín Sánchez
eddbb1eee9
chore: cleanup isHydrated (#2614)
Co-authored-by: patak <583075+patak-dev@users.noreply.github.com>
2024-02-24 18:24:19 +00:00
Joaquín Sánchez
6b40319723
fix(ui): wrong tabindex usage 2 (#2617) 2024-02-24 18:23:37 +00:00
Joaquín Sánchez
913e2892f7
fix(ui): wrong tabindex usage (#2615) 2024-02-24 18:13:12 +00:00
renovate[bot]
a3c5272e07
chore(deps): update devdependencies (#2388)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-24 16:56:38 +00:00
Joaquín Sánchez
55037f04cd
chore: update nuxt to 3.10.3 (#2610) 2024-02-24 16:46:14 +00:00
patak
1fefb6e5b6
fix: paginator watch (#2613) 2024-02-24 14:51:51 +00:00
patak
3769176eaa
feat: . shortcut to show new items (#2612) 2024-02-24 14:46:54 +00:00
TAKAHASHI Shuuji
082650d458
fix: fix [object Object] on the mentions tab (#2611) 2024-02-24 14:18:13 +00:00
Joaquín Sánchez
36004a7eba
feat: bump to latest vue 3.4.19 (#2607)
Co-authored-by: patak <matias.capeletto@gmail.com>
2024-02-24 12:24:21 +00:00
Joaquín Sánchez
81ef8ff9aa
chore: include .gitattributes for eol (#2606) 2024-02-23 13:32:51 +00:00
Joaquín Sánchez
da163903b1
chore: bump to @vueuse/gesture v2.0.0 (#2605) 2024-02-23 13:04:44 +00:00
patak
ccfa7a8d10
refactor: no reactivity transform (#2600) 2024-02-21 15:20:08 +00:00
Xabi
b9394c2fa5
fix(i18n): update eu-ES.json (#2594) 2024-02-19 12:42:57 +00:00
Yudai Nishiyama
1954c34628
feat(i18n): Update ja-JP.json (#2588) 2024-02-19 12:05:02 +00:00
patak
9f005a0a59 chore: release v0.11.0 2024-02-19 10:33:00 +01:00
TAKAHASHI Shuuji
bf0c562794
fix(suggestion): allow case-insensitive emoji suggestion (#2565) 2024-02-19 09:23:58 +00:00
renovate[bot]
54fe0c1ab9
chore(deps): update dependency vitest to ^1.3.0 (#2556)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-17 17:29:14 +00:00
Shinigami
1bbc2eca24
fix: notification badge (#2592)
Co-authored-by: Ayo <ramon.aycojr@gmail.com>
2024-02-16 16:48:53 +00:00
renovate[bot]
dcc1b74824
chore(deps): update pnpm to v8.15.3 (#2557)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-02-15 15:49:27 +00:00
ocavue
8eb6b2378a
refactor: migrate from shikiji to shiki v1 (#2591) 2024-02-15 07:43:09 +00:00
lazzzis
40415f34a4
fix: fix tooltip overlaps with editor tool popup on Mobile (#2582) 2024-02-11 06:39:45 +00:00
Emanuel Pina
be4752ee0c
feat(i18n): Update portuguese from Portugal translation (#2577) 2024-02-08 15:41:26 +00:00
Joaquín Sánchez
30e2295af4
feat(i18n): Update es.json (#2576) 2024-01-26 23:23:57 +00:00
华丽
285f83e2fa
feat: Add option to preserve whitespace in parseOptions (#2448) 2024-01-26 18:44:07 +00:00
Duy
8db37617d4
feat(i18n): Update vi-VN.json (#2574) 2024-01-26 18:43:07 +00:00
Francesco
172883a499
feat(i18n): Update it-IT locale (#2572) 2024-01-26 03:21:23 +00:00
TAKAHASHI Shuuji
2a59543836
fix: allow to translate "Lock" string on profile (#2571) 2024-01-24 15:48:24 +00:00
TAKAHASHI Shuuji
77b917a921
fix: rename tab label from "Mention" to "Mentions" (#2570) 2024-01-24 12:12:42 +00:00
Francesco
af8a6e6809
feat(i18n): Update it-IT locale (#2569) 2024-01-24 09:13:02 +00:00
Francesco
6d8b33a58a
feat(i18n): Update it-IT locale (#2567) 2024-01-23 05:26:09 +00:00
patak
7322711609
fix: subscribe to proper user.notification stream (#2566) 2024-01-21 08:52:52 +00:00
Duy
b8e8693342
feat(i18n): Update vi-VN.json (#2560) 2024-01-21 08:31:22 +00:00
TAKAHASHI Shuuji
f0bc78ba2c
refactor: fix lint warnings (#2564) 2024-01-21 09:30:15 +01:00
TAKAHASHI Shuuji
cadf1b4a7c
feat: add Bluesky and Friendica icons (#2563) 2024-01-18 10:21:49 +00:00
TAKAHASHI Shuuji
f79d84ad6e
feat: add new setting to disable blur for low-performance device (#2561) 2024-01-18 08:18:49 +00:00
renovate[bot]
b0125eb3fc
chore(deps): update docker/setup-qemu-action action to v3 (#2558)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-15 08:35:52 +00:00
Emanuel Pina
77175416a6
feat(i18n): Update portuguese from Portugal translation (#2555) 2024-01-10 15:31:28 +00:00
renovate[bot]
7836edd10a
chore(deps): update docker/metadata-action action to v5 (#2527)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-10 15:02:29 +00:00
renovate[bot]
0ae189207f
chore(deps): update docker/login-action action to v3 (#2515)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-10 14:01:10 +00:00
renovate[bot]
56d4967eb7
chore(deps): update docker/setup-buildx-action action to v3 (#2528)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-10 13:46:05 +00:00
TAKAHASHI Shuuji
0451ac98c9
feat: improve title and layout of the confirm dialog (#2307) 2024-01-09 19:51:36 +00:00
ghose
54e53889e5
feat(i18n): updated gl-ES translation (#2522)
Co-authored-by: Joaquín Sánchez <userquin@gmail.com>
Co-authored-by: patak <matias.capeletto@gmail.com>
2024-01-09 14:35:04 +01:00
yrming
149963c304
feat(i18n): complete the translation of copy_account_name (#2487) 2024-01-09 09:12:29 +00:00
Cesar Gomez
44f5ec1fa2
feat(i18n): missing and rewording es and es-419 keys (#2511)
Co-authored-by: patak <matias.capeletto@gmail.com>
2024-01-09 09:08:42 +00:00
patak
6c5bb83ac3
feat: upgrade to masto.js v6 (#2530) 2024-01-09 08:56:15 +00:00
Joshix-1
d8ea685803
fix: meta og:url should use the origin of the request instead of elk.zone (#2550) 2024-01-09 08:14:35 +00:00
Duy
3fa1fc349c
feat(i18n): update vi-VN.json (#2506) 2024-01-08 20:26:04 +00:00
Joaquín Sánchez
3adf92ea56
feat: add LTR/RTL in hashtags and mentions support (#2541)
Co-authored-by: Daniel Roe <daniel@roe.dev>
2024-01-04 19:51:32 +00:00
Matty Jorgensen
b016320eaf
feat: add Vercel KV (#2533) 2024-01-02 10:58:37 +00:00
ocavue
77588c1890
fix: trigger code block highlighting when the highlighter is ready (#2539) 2024-01-01 16:46:37 +00:00
北雁云依
e43993770d
fix: spoiler button style in notifications (#2537) 2024-01-01 17:48:52 +01:00
TAKAHASHI Shuuji
9070fa4053
feat: add a new link icon (#2534) 2024-01-01 17:48:10 +01:00
Roshan Jossy
7f041c3ac8
docs: use GitHub markdown formatting for note in Readme (#2536) 2024-01-01 17:47:49 +01:00
Sebastian Di Luzio
b7c22287d6
chore: run unit tests in watch mode by default (#2525) 2023-12-22 21:50:59 +00:00
Sebastian Di Luzio
07042b9f31
fix: correct linking of theme colors (#2524) 2023-12-22 13:25:34 +01:00
Shinigami
c0bb6e293c
feat: show emoji tooltip (#2485) 2023-12-22 12:16:46 +00:00
ocavue
74138a9a58
refactor: migrate from shiki to shikiji (#2520) 2023-12-20 18:54:40 +00:00
renovate[bot]
e63473a5f8
chore(deps): update pnpm to v8.12.1 (#2514)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-19 20:59:20 +00:00
renovate[bot]
24378e0be8
chore(deps): update dependency vitest to ^1.1.0 (#2338)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-19 20:58:50 +00:00
Daniel Roe
5ce005b55a
chore: correct type import from floating-vue (#2518) 2023-12-19 22:31:39 +01:00
Daniel Roe
3ae2d50bff
test: reenable nuxt runtime tests (with latest test-utils) (#2497) 2023-12-14 11:45:52 +00:00
renovate[bot]
2b421f1039
chore(deps): update pnpm to v8.12.0 (#2507)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 21:42:53 +00:00
renovate[bot]
e0ddbc1da2
chore(deps): update dependency vitest to v1 (#2508)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-12 21:42:19 +00:00
Xabi
ca3a818678
fix(i18n): update Basque localisation (#2503) 2023-12-09 16:05:10 +00:00
Joaquín Sánchez
9155c32ece
chore(pwa): improve DX for $pwa (#2498) 2023-12-09 16:04:41 +00:00
Cesar Gomez
3dbdb99118
feat(i18n): es & es-419 locales sync (#2505) 2023-12-09 16:03:43 +00:00
renovate[bot]
c3d96d2811
chore(deps): update dependency node to v20 (#2501)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-05 10:18:22 +00:00
renovate[bot]
429d1d7ce8
chore(deps): update actions/setup-node action to v4 (#2499)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-12-05 10:18:19 +00:00
Joaquín Sánchez
5503ecbea2
chore(pwa): change sw generation logic (#2494) 2023-12-01 17:28:31 +00:00
Tamas
21376e013a
feat(i18n): hu-HU.json update (#2489) 2023-11-29 22:27:04 +00:00
Daniel Roe
17f6d93c7c
chore: update nuxt to v3.8.2 (#2490) 2023-11-29 22:26:10 +00:00
renovate[bot]
0e701afb98
chore(deps): update all non-major dependencies (#2389)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-29 17:55:12 +00:00
renovate[bot]
cdcc89518a
chore(deps): update actions/checkout action to v4 (#2391)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-29 17:54:45 +00:00
renovate[bot]
1f6a7186f8
chore(deps): update docker/build-push-action action to v5 (#2401)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-29 17:54:13 +00:00
Tamas
ad1461bd2d
feat(i18n): hu-HU.json issue (#2486)
Co-authored-by: Tamas Dohany <iamdtms@gmail.com>
Co-authored-by: Tamas Dohany <dohany.tamas@atlatszo.hu>
2023-11-29 11:19:28 +00:00
Daniel Roe
7ba9b05d12
chore: bump @nuxtjs/color-mode (#2488) 2023-11-29 11:09:44 +00:00
yrming
9c39eed209
feat: unify the style of under construction page (#2483) 2023-11-28 10:54:22 +00:00
Francesco
7ed95e317f
feat(i18n): Update it-IT locale (#2473) 2023-11-27 17:55:51 +00:00
Tamas
46105c86c6
feat(i18n): update hu-HU.json (#2480)
Co-authored-by: Tamas Dohany <iamdtms@gmail.com>
2023-11-27 12:19:13 +00:00
Sma11X
7785f4fe06
feat(settings): convert metadata to text (#2444) 2023-11-27 12:17:58 +00:00
Emanuel Pina
585d8c6f0b
fix(i18n): Update portuguese from Portugal translation (#2482) 2023-11-27 12:11:11 +00:00
Alex
1f752e65ed
fix: move the ALT text button for video attahcments to the top (#2479) 2023-11-24 08:19:53 +00:00
Tamas
7595162a0e
feat(i18n): update hu-HU.json (#2477)
Co-authored-by: Tamas Dohany <iamdtms@gmail.com>
2023-11-22 18:10:22 +00:00
TAKAHASHI Shuuji
20c30e92a3
feat: support Threads icon in profile links (#2474) 2023-11-17 08:40:23 +00:00
TAKAHASHI Shuuji
e00e4074e1
feat: put account name copy button (#2347) 2023-11-14 14:34:56 +00:00
patak
7ec76ffed9 chore: release v0.10.3 2023-11-14 11:05:09 +01:00
patak
c41b427c2e
fix: btn-solid text color for dark mode (#2471) 2023-11-13 17:30:36 +00:00
Ayo Ayco
c55545612e
feat: allow https as frame-src (#2468) 2023-11-12 06:42:02 +00:00
Adityawarman Dewa Putra
dab0502319
feat(i18n): Update id-ID locale (#2460) 2023-11-11 09:21:20 +00:00
Adityawarman Dewa Putra
10bd555926
feat: add pinterest icon in profile metadata (#2461) 2023-11-11 09:20:41 +00:00
Xabi
53dc1f37ca
fix(i18n): update Basque localisation (#2465) 2023-11-11 09:18:41 +00:00
TAKAHASHI Shuuji
68f92e07b7
feat(a11y): improve button color contrast with white text (#2449) 2023-11-09 20:24:11 +00:00
Ayo Ayco
957f0d3b17
feat: display embedded media player (#2417) 2023-11-07 09:57:44 +00:00
JP
0bd1209bee
feat(i18n): Update arabic locale (#2459) 2023-11-06 07:42:17 +00:00
Tamas
00c4a369cc
feat(i18n): update hu-HU.json (#2458)
Co-authored-by: Tamas Dohany <iamdtms@gmail.com>
2023-11-06 07:41:52 +00:00
Adityawarman Dewa Putra
8a5ddb7c87
feat(i18n): Update the id-ID locale (#2456) 2023-11-06 07:40:50 +00:00
Francesco
90878f97b5
feat(i18n): Update it-IT locale (#2440) 2023-11-03 15:00:41 +00:00
Emanuel Pina
09189378e0
fix(i18n): Update portuguese from Portugal translation (#2446) 2023-11-03 15:00:16 +00:00
Ɗʊƴ
769968c2e8
fix(i18n): Add new strings (#2447) 2023-11-03 14:59:33 +00:00
Tom Doe
5d09e7d2ab
fix: #2439 - endMessage in CommonPaginator (#2441) 2023-10-24 13:01:57 +00:00
Francesco
0924c9d9be
feat(i18n): Update it-IT locale (#2438) 2023-10-22 20:47:46 -05:00
Sma11X
293534fb8b
fix: correct links content with query symbol (#2377) 2023-10-22 16:14:37 +00:00
Sma11X
5fceb70971
feat: handle follow request (#2339) 2023-10-22 16:11:00 +00:00
Emanuel Pina
d825a71d1f
fix(i18n): Update portuguese from Portugal translation (#2437) 2023-10-22 16:07:23 +00:00
Daniel Roe
a47071d341 chore: bump some lockfile dependencies 2023-10-18 09:47:29 +01:00
Daniel Roe
52c947f9e5 chore: update nuxt-vitest 2023-10-18 09:36:46 +01:00
Xabi
07b7f38386
fix(i18n): update eu-ES.json (#2432) 2023-10-17 08:09:47 +00:00
TAKAHASHI Shuuji
291f99cbea
feat(ui): add "search" to the keyboard shortcut help (#2429) 2023-10-16 10:51:37 +00:00
Sma11X
1fe598f554
fix: some keyboard shortcuts not working in non-english (#2324) 2023-10-13 07:13:37 +00:00
Sma11X
e9f274f304
feat: replace links in status after translated (#2385)
Co-authored-by: patak <matias.capeletto@gmail.com>
2023-10-13 07:12:48 +00:00
Daniel Roe
ca0afe585d chore: dedupe dependencies 2023-10-12 16:30:35 +01:00
Joaquín Sánchez
1a0e83365a
fix(pwa): add manifest-src to CSP (#2428) 2023-10-12 16:57:52 +02:00
Anthony Fu
77a3bd833d chore: update devtools 2023-10-11 17:46:23 +08:00
Abel Derderian
02abe2d920
feat(i18n): Update the fr-FR locale (#2421) 2023-10-09 21:24:23 +00:00
Joaquín Sánchez
c8d9c4b871
fix(ui): exclude notifications without the status (#2375) 2023-10-09 20:33:02 +00:00
Emanuel Pina
fee811dd75
fix(i18n): Update portguese from Portugal translation (#2364) 2023-10-09 20:20:42 +00:00
Xabi
1910a1d782
fix(i18n): update Basque localisation (#2376) 2023-10-09 20:19:14 +00:00
Joaquín Sánchez
c387702bb1
feat(i18n): include missing Spanish entries (#2381) 2023-10-09 20:17:33 +00:00
Sebastian Di Luzio
e015adcf4e
fix: profile header avatar being pushed lower on smaller devices (#2423) 2023-10-09 20:14:04 +00:00
Daniel Roe
12eaae6bbb chore: export Emoji as explicit type 2023-10-03 00:09:18 +01:00
patak
e199e02e79 chore: release v0.10.2 2023-10-02 09:24:30 +02:00
Pavel Ruzicka
b42e77af24
i18n: update cs-CZ.json (#2418) 2023-10-01 02:41:21 -05:00
patak
0343898146 fix: revert publish height (#2334)
This reverts commit b74eec6a03.
2023-09-30 09:59:03 +02:00
TAKAHASHI Shuuji
b5f2cea1dc
feat(i18n): update Japanese localization (#2415) 2023-09-28 12:03:44 +00:00
Ɗʊƴ
2a9f607049
fix(i18n): Update vi-VN.json (#2396)
Co-authored-by: patak <matias.capeletto@gmail.com>
2023-09-25 19:11:15 +00:00
Francesco
043883bd8e
feat(i18n): Update it-IT locale (#2408) 2023-09-25 19:10:05 +00:00
Francesco
ed5592260f
feat(i18n): Update it-IT locale (#2370) 2023-09-20 06:52:50 +00:00
Sebastian Di Luzio
f4b0be8aed
feat: make new users signup notifications link to their profile (#2406) 2023-09-20 06:52:05 +00:00
Tamas
b723d51786
feat(i18n): Add Hungarian translation (hu-HU) (#2373)
Co-authored-by: Tamas Dohany <iamdtms@gmail.com>
Co-authored-by: Zsolt Botykai <zsolt.botykai@gmail.com>
2023-09-15 21:25:34 +00:00
renovate[bot]
25d4325bd0
chore(deps): update lint (#2390)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-13 06:34:15 +00:00
Anthony Fu
319f9c4ece fix(ui): improve notifications alignment and icons consistenty 2023-09-08 18:14:19 +02:00
Anthony Fu
06ef226440 chore: clean up footer 2023-09-08 17:57:08 +02:00
Anthony Fu
3691ec389a fix: improve elk-group-hover shortcut, close #2386 2023-09-08 17:56:29 +02:00
YRMING
ca2ca2bef4
feat: unify the format of locale keys (#2380) 2023-09-06 12:51:01 +00:00
Ayo Ayco
907d9999dc
feat: filter notifications by type (#2371)
Co-authored-by: Xabi <xabi.rn@gmail.com>
Co-authored-by: userquin <userquin@gmail.com>
2023-09-06 09:13:16 +00:00
renovate[bot]
e9c5de577e
chore(deps): update dependency lint-staged to v14 (#2354)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 14:22:33 +00:00
renovate[bot]
87d6ed39eb
fix(deps): update dependency iso-639-1 to v3 (#2355)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 13:43:52 +00:00
renovate[bot]
cf20ac29db
chore(deps): update lint (#2311)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 13:42:20 +00:00
renovate[bot]
1a96f87da0
fix(deps): update tiptap to v2.1.8 (#2256)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 13:42:01 +00:00
renovate[bot]
0f825a6efb
chore(deps): update devdependencies (#2310)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
2023-09-05 12:55:03 +00:00
renovate[bot]
1b8d72105d
chore(deps): update pnpm to v8.7.1 (#2337)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-09-05 11:57:03 +00:00
TAKAHASHI Shuuji
5ef2996b40
feat: add keyboard shortcut helper link or button (#2365) 2023-08-28 15:24:34 +00:00
Sma11X
1ac3164d0c
fix(i18n): add missing translation (#2340) 2023-08-24 11:09:54 +00:00
Liberal dev
e4725d433e
fix(i18n): fix Korean translation (#2335) 2023-08-24 11:09:35 +00:00
Valtteri Laitinen
3716e3af6e
feat(i18n): update and improve Finnish locale (#2341) 2023-08-24 11:08:56 +00:00
Francesco
366f3e07df
feat(i18n): Update it-IT locale (#2350) 2023-08-24 11:06:00 +00:00
Joaquín Sánchez
6801ea6c2d
fix: compose page error (#2360) 2023-08-23 10:33:26 +00:00
Sma11X
4b37d19f65
fix: change status focus style (#2356) 2023-08-23 10:32:59 +00:00
Sma11X
c1bca79c50
fix: shrink the height of avatar (#2361) 2023-08-22 21:58:31 +00:00
Valtteri Laitinen
ee88c111f2
fix(i18n): use "post" and "boost" consistently (#2344) 2023-08-20 21:41:02 +00:00
舜岳
067550720a
refactor: solve the problem that the title is not centered (#2353) 2023-08-19 10:35:11 +00:00
Valtteri Laitinen
c5b1b32f2c
fix(i18n): correct typo (#2343) 2023-08-15 16:13:44 +00:00
Joaquín Sánchez
bd7436e5d2
feat(i18n): Add missing Spanish translations (#2336) 2023-08-14 14:05:35 +00:00
Valtteri Laitinen
8b883dc957
fix(i18n): delete unused strings (#2345) 2023-08-14 13:57:38 +00:00
Valtteri Laitinen
06808da616
fix(i18n): use normal question mark (#2342) 2023-08-14 13:56:33 +00:00
Anthony Fu
0b900128c1 chore: release v0.10.1 2023-08-13 12:31:14 +02:00
Florian Martinez
b74eec6a03
fix: publish height (#2334) 2023-08-13 08:39:18 +00:00
Florian Martinez
92d0f18389
fix: role indicator (#2333) 2023-08-13 08:28:32 +00:00
Liberal dev
c0f936f8fe
feat(i18n): Improve Korean translation (#2320) 2023-08-12 10:27:37 +00:00
Francesco
7e492422fe
fix(i18n): it-IT typo (#2323) 2023-08-12 10:27:07 +00:00
lazzzis
4325bca22b
feat(a11y): enhance post-related a11y features (#2328) 2023-08-12 10:26:37 +00:00
Duy
5a765187ab
fix(i18n): Update vi-VN.json (#2330) 2023-08-12 10:25:40 +00:00
lazzzis
e9a02ca337
fix: like/bookmark button is disappeared (#2327) 2023-08-12 12:25:24 +02:00
Xabi
221a6f2fc3
fix(i18n): update Basque localisation (#2325) 2023-08-11 12:21:40 +00:00
lazzzis
2267db11c6
feat: disabled boost button (#2326) 2023-08-11 11:56:47 +00:00
lazzzis
a4d34323ed
feat(a11y): add checkbox role to toggle items (#2321) 2023-08-10 10:18:35 +00:00
lazzzis
91db9b03a8
docs: fix a broken link in README (#2322) 2023-08-10 10:06:52 +00:00
Liberal dev
0be47261c7
fix(i18n): Improve Korean translation (#2319) 2023-08-09 22:33:12 +00:00
Liberal dev
49b39b7fa8
fix(i18n): Update Korean translation (#2318) 2023-08-09 18:59:32 +02:00
Vee Satayamas
1f37e3ab8b
feat(i18n): Add Thai locale (#2115) 2023-08-09 11:51:07 +00:00
Eric
e183c62036
fix(i18n): Update zh-CN.json (#2313) 2023-08-09 11:50:25 +00:00
Mikhail
370c8dd58e
fix(i18n): Add missing translations for ru-RU (#2212) 2023-08-09 11:49:15 +00:00
Liberal dev
b19f73c870
feat(i18n): Improve Korean translation (#2316) 2023-08-09 11:48:04 +00:00
Emanuel Pina
dccdcbbbe2
fix(i18n): Update portuguese from Portugal translation (#2285) 2023-08-09 11:47:25 +00:00
Duy
280911b233
fix(i18n): Update vi-VN.json (#2303) 2023-08-09 11:46:46 +00:00
Liberal dev
f3d17d3be2
fix: improve default font family (#2314) 2023-08-09 11:46:26 +00:00
Francesco
3f6cc16850
fix(i18n): Update it-IT locale (#2294) 2023-08-09 11:46:13 +00:00
Daniel Roe
4ebc8b6798 fix: deduplicate unstorage version 2023-08-08 11:30:38 +01:00
三咲智子 Kevin Deng
7079564ffe
refactor: upgrade vue-macros 2023-08-08 02:32:35 +08:00
Ayaka Rizumu
991034115b
feat: pull down to close bottom nav sidebar (#2290) 2023-08-03 15:05:58 +00:00
Nicolas Lœuillet
57814915d6
fix(i18n): fr-FR typo (#2295)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2023-08-02 10:45:53 +00:00
Chanhwi Joo
8181738d48
fix(i18n): Update Korean localization (#2292) 2023-08-02 10:44:24 +00:00
TAKAHASHI Shuuji
0a8cc317a9
feat: show delete confirmation dialog when clicking "Delete & re-draft" menu (#2296)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2023-08-02 10:41:47 +00:00
renovate[bot]
8df73b13bd
chore(deps): update dependency prettier to v3 (#2257)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2023-08-02 10:37:43 +00:00
Sma11X
d975c6fc2c
fix: add attributes before status update (#2293) 2023-08-02 10:31:08 +00:00
renovate[bot]
67d5d5c00a
chore(deps): update lint (#2233)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2023-08-02 10:28:18 +00:00
Sma11X
603e10b6ca
fix: check login in zen mode (#2258) 2023-08-02 10:27:31 +00:00
Anthony Fu
9ae0d9b744 ci: add merge_group event for merge queue 2023-08-02 12:13:23 +02:00
Anthony Fu
28f9540113 pref: improve unocss perf 2023-08-02 12:12:48 +02:00
Sma11X
468a17ad58
fix: nav more menu not active (#2300) 2023-08-02 11:43:24 +02:00
renovate[bot]
b84a6ccc32
chore(deps): update devdependencies (#2236)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-01 22:57:32 +01:00
Daniel Roe
a45b7173e5
chore: update to nuxt v3.6.5 (#2299) 2023-08-01 22:11:26 +01:00
三咲智子 Kevin Deng
d23f1d39eb
refactor: replace defineModels with defineModel 2023-08-01 17:44:01 +08:00
Daniel Roe
e6172ad38b chore: update nuxt-vitest 2023-08-01 10:36:19 +01:00
Daniel Roe
5870e8d6e6 test: work around mocking issue 2023-07-31 23:56:21 +01:00
renovate[bot]
3d696646c5
chore(deps): update dependency vitest to ^0.33.0 (#2235)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 20:20:25 +01:00
Daniel Roe
6edb6ccb15 chore: update nuxt-vitest 2023-07-31 19:53:33 +01:00
renovate[bot]
6cb7fca3ab
chore(deps): update all non-major dependencies (#2234)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 19:48:59 +01:00
Daniel Roe
3375563e64 fix: augment vueCompilerOptions in pkg-types 2023-07-31 17:15:53 +01:00
Liberal dev
832ee35a93
fix(i18n): update Korean localisation (#2275) 2023-07-30 21:39:32 +02:00
TAKAHASHI Shuuji
550540fad0
fix: correct ratio of profile header avatar (#2288) 2023-07-30 21:24:06 +02:00
Alex
e59c2af818
fix: cannot fullscreen due to Permission-Policy (#2281) 2023-07-29 20:45:30 +02:00
TAKAHASHI Shuuji
ee6ee30df1
feat: hide original post area in the edit widget (#2283) 2023-07-29 20:38:13 +02:00
Niklas Wolf
675f5184a0
feat: use configured writing/post language of user from mastodon (#2282) 2023-07-29 14:01:17 +02:00
tzhao11
0a9f2d99d5
feat(i18n): Update zh-CN locale (#2200) 2023-07-29 11:43:18 +02:00
Sma11X
35dcf91a06
feat(i18n): sync zh-CN (#2248) 2023-07-29 11:42:59 +02:00
kernoeb
7876727a41
chore(docs): add notice for notifications on Brave browser (#2260) 2023-07-29 11:02:34 +02:00
Xabi
3c3fad808d
fix(i18n): update eu-ES.json (#2259) 2023-07-29 11:02:09 +02:00
TAKAHASHI Shuuji
357fac4d49
feat: show save failed error messages on the profile config page (#2274) 2023-07-29 10:52:57 +02:00
Duy
f45f51d44b
feat(i18n): Update vi-VN.json (#2278) 2023-07-29 10:31:07 +02:00
Duy
5bbbf14c92
feat(i18n): update vi-VN.json (#2268) 2023-07-26 15:39:35 +02:00
Florian Martinez
0a933614fa
feat: role labels wrap (#2266) 2023-07-25 17:29:54 +02:00
Florian Martinez
22a1388d50
feat: add roles into account header and info (#2265) 2023-07-25 16:43:26 +02:00
TAKAHASHI Shuuji
0719ad0afd
docs: fix image URLs (#2264) 2023-07-25 07:15:07 +01:00
patak
1671dfb617 chore: release v0.10.0 2023-07-24 10:26:17 +02:00
TAKAHASHI Shuuji
b730fab643
fix: prevent the lost of focus on compose icons (#2253) 2023-07-22 19:22:17 +02:00
Francesco
81e1383da5
feat(i18n): Update it-IT locale (#2249) 2023-07-22 14:00:21 +02:00
linjin
cdc43775a6
fix: display background when text is selected (#2222) 2023-07-21 14:55:00 +02:00
Natsu Kagami
2a57c64fa0
fix: only add domain when none was provided (#2225) 2023-07-21 14:52:55 +02:00
Kowlin
8a86282951
fix: Show lock indicator with the correct state (#2226) 2023-07-21 14:50:36 +02:00
Emanuel Pina
da31709677
fix(i18n): Update portuguese from Portugal translation (#2242) 2023-07-21 14:48:12 +02:00
klrtk
b14a8e63c6
fix: Use favorite star icon in notifications when enabled (#2229) 2023-07-21 14:41:43 +02:00
TAKAHASHI Shuuji
cc89692d80
fix(a11y): make the bottom menu button focusable and navigable with a11y label (#2247) 2023-07-21 12:17:32 +02:00
Francesco
5782c326b2
feat(i18n): Update it-IT locale (#2246) 2023-07-21 09:08:49 +02:00
Kevin Pliester
af444391b5
fix(i18n): add missing translations for de-DE (#2241) 2023-07-19 14:40:27 +02:00
Cesar Gomez
9bc44f44a0
feat(i18n): sync report keys into es lang (#2202) 2023-07-19 14:16:06 +02:00
Abel Derderian
f7f4167b06
feat(i18n): Update the fr-FR locale (#2231) 2023-07-17 12:14:31 +02:00
Xabi
8fa9c40e86
fix(i18n): update Basque localisation (#2136) 2023-07-17 10:53:25 +02:00
Xabi
31a4924186
fix(i18n): update Basque localisation (#2230) 2023-07-17 10:52:39 +02:00
Emanuel Pina
a6b9d4a82b
fix(i18n): update portuguese from Portugal translation (#2186) 2023-07-15 15:21:15 +02:00
Florian Martinez
ca897bdd2f
feat: add experimental features descriptions (#2228)
Co-authored-by: patak <matias.capeletto@gmail.com>
2023-07-14 21:01:35 +02:00
Ryan Cao
fa44850686
chore(renovate): ignore node version correctly (#2224) 2023-07-11 16:03:59 +01:00
Natsu Kagami
a6e4da8c41
fix: add domain when querying for user on GoToSocial (#2221) 2023-07-11 13:59:48 +01:00
Daniel Roe
895c1ecd8d chore(docs): bump docus version and remove baseURL 2023-07-11 11:33:28 +01:00
Aaron Ransley
ae35f9d11d
fix: Update command key in keyboard shortcuts modal (#2208) 2023-07-10 11:32:15 +02:00
Joaquín Sánchez
2506c02c39
fix(ui): stop question mark propagation (#2209) 2023-07-10 11:29:42 +02:00
Joaquín Sánchez
a08d9d147c
fix: installed pwa shortcuts (#2205) 2023-07-07 11:56:06 +01:00
Daniel Roe
cb109b49b8 fix: don't redirect to generated path 2023-07-06 21:19:01 +01:00
Daniel Roe
d51303cb8b
chore: update to nuxt v3.6.2 (#2203) 2023-07-06 21:13:25 +01:00
patak
c00354c833 fix: custom emojis 2023-07-06 21:33:01 +02:00
三咲智子 Kevin Deng
1ee0ec68c5
feat: show hint on empty timeline 2023-07-05 14:33:41 +08:00
三咲智子 Kevin Deng
5c1411b3de
chore: fix pwa type 2023-07-04 13:32:22 +08:00
三咲智子 Kevin Deng
2d8ec4ab89
chore: upgrade deps 2023-07-04 13:18:36 +08:00
三咲智子 Kevin Deng
c7e20296a2
chore: remove default npm option 2023-07-04 13:06:17 +08:00
Horváth Bálint
a98ca69382
fix: status card confusion (#2196) 2023-07-03 21:04:16 +02:00
Philip Sorst
886fc89df6
fix(i18n): add missing translations for de-DE (#2194) 2023-07-03 18:34:43 +02:00
三咲智子 Kevin Deng
112502155e
feat: add account share 2023-07-03 15:58:48 +08:00
Guto Carvalho
be446f5433
docs: add bolha.us server to readme (#2191) 2023-07-03 15:46:55 +08:00
Francesco
a9f5e4b5e7
fix(i18n): update it-IT locale (#2178) 2023-07-02 22:13:05 +02:00
Joaquín Sánchez
78b8b441ba
fix(ui): do not show poll expiration if missing (#2176) 2023-07-03 02:12:24 +08:00
三咲智子 Kevin Deng
d52755a153
feat: withdraw follow request
closes #2179
closes #2162
2023-07-03 02:09:30 +08:00
三咲智子 Kevin Deng
d5856b83c6
feat: add locked for account 2023-07-03 01:55:18 +08:00
三咲智子 Kevin Deng
338e203b6f
chore: upgrade devtools 2023-07-03 01:31:09 +08:00
renovate[bot]
026ef988c4
fix(deps): update dependency lru-cache to v10 (#2181)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-02 17:15:53 +00:00
renovate[bot]
5f2dca1979
chore(deps): update devdependencies (#2163)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
2023-07-03 01:11:13 +08:00
三咲智子 Kevin Deng
676470bae2
chore: ignore deps 2023-07-03 01:07:55 +08:00
renovate[bot]
e0525e5f55
chore(deps): update dependency vitest to ^0.32.2 (#2097)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-02 16:48:59 +00:00
三咲智子 Kevin Deng
d4ce90a7e8
fix: tsconfig in service worker 2023-07-03 00:41:25 +08:00
三咲智子 Kevin Deng
171f0ec857
refactor: upgrade volar 2023-07-03 00:34:39 +08:00
renovate[bot]
fbf49368c1
chore(deps): update lint (#2180)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
2023-07-02 16:26:23 +00:00
三咲智子 Kevin Deng
3f8d68c7f7
chore: fix typo 2023-07-03 00:19:11 +08:00
renovate[bot]
0c6260367e
chore(deps): update pnpm to v8.6.5 (#2188)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 22:36:30 +08:00
Joaquín Sánchez
0b5797249f
feat(pwa): include window-controls-overlay in installed pwa logic (#2135) 2023-06-23 21:40:21 +02:00
Joaquín Sánchez
e453a316f7
chore: bump to pwa plugin 0.16.4 (#2159)
Co-authored-by: Daniel Roe <daniel@roe.dev>
2023-06-23 21:39:02 +02:00
Pavel Biryukov
25a5d3fe7b
feat(i18n): Russial localization improvements (#2169)
Co-authored-by: Pavel Biryukov <birksovskiy@proton.me>
2023-06-23 21:37:32 +02:00
Ashwin Agarwal
34aca66fef
feat: Report posts (#2184) 2023-06-23 14:24:10 +02:00
Joaquín Sánchez
5ea09d323f
feat(i18n): add spanish translation for "polls" (#2166) 2023-06-14 16:13:22 +02:00
Francesco
4541486d0d
feat(i18n): Update it-IT locale (#2150) 2023-06-14 15:16:13 +02:00
Horváth Bálint
a94fe1c9d0
feat: media preview modal - better zoom support (#2133) 2023-06-12 20:46:53 +02:00
renovate[bot]
58f3ff6cd6
chore(deps): update pnpm to v8.6.2 (#2164)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-12 22:14:25 +08:00
Vince Chu
fbc779d174
chore: Add elk.mstdn.ca to README.md (#2154) 2023-06-08 19:01:59 +00:00
Eddie Coldrick
7c1873c4e3
chore: Add MastodonAppUK to README (#2157) 2023-06-08 20:59:02 +02:00
Daniel Roe
123cf13145
chore: copy across .npmrc to docker build (#2152) 2023-06-08 10:53:33 +01:00
renovate[bot]
58053d0b53
fix(deps): update dependency @vueuse/motion to v2.0.0 (#2131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-08 05:26:48 +08:00
renovate[bot]
68d0d55532
chore(deps): update lint (#2144)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-08 05:24:22 +08:00
renovate[bot]
b6304ab18c
chore(deps): update pnpm to v8.6.1 (#2098)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-08 05:24:03 +08:00
Eddie Coldrick
e996e53a64
chore: add elkmeuk to README (#2149) 2023-06-07 15:01:15 +02:00
Joaquín Sánchez
f15150c40d
docs: typo in the sharp-ico repository link (#2142) 2023-06-03 12:25:08 +01:00
Joaquín Sánchez
01486c2aef
chore: bump to vite-plugin-pwa 0.16.0 (#2141) 2023-06-01 08:11:11 +01:00
Ryan Cao
5ad32c9e26
fix: handle hidden followers/following count (#2120) 2023-05-31 17:59:54 +02:00
Laura Langdon
2b1a5072d7
docs: add alt text instructions (#2139) 2023-05-31 15:41:23 +02:00
Joaquín Sánchez
c6c4d52556
fix(pwa): pwa icons in dev and build (#2137) 2023-05-30 19:38:24 +02:00
Joaquín Sánchez
d601a117c0
chore: add generate pwa icons script (#2130) 2023-05-29 16:52:27 +02:00
renovate[bot]
0767df3f78
chore(deps): update devdependencies (#2084)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 14:45:10 +02:00
renovate[bot]
670a4ef632
chore(deps): update lint (#2085)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-29 14:44:08 +02:00
Daniel Roe
0633c09726
chore: bump to nuxt v3.5.2 (#2134) 2023-05-29 14:26:01 +02:00
Daniel Roe
d535ae6ee1 fix: work around volar parsing issue 2023-05-29 13:46:45 +02:00
Daniel Roe
209013af09 fix: re-key paginator slots 2023-05-29 13:42:18 +02:00
Xabi
dfa0e5f300
fix(i18n): update eu-ES.json (#2129) 2023-05-29 10:26:55 +02:00
Daniel Roe
897968027c
chore: upgrade to nuxt v3.5 and vue v3.3 (#2132) 2023-05-29 15:16:34 +08:00
Joaquín Sánchez
ad0725e9ae
fix(ui): hidden pwa badge and install prompt (#2127) 2023-05-26 15:25:11 +02:00
Paulina3xz
4a167c5bf5
feat(i18n): Added all missing Polish translations + translation fixes (#2082) 2023-05-22 17:31:46 +02:00
Duy
4c0c6f1325
feat(i18n): Update vi-VN.json (#2121) 2023-05-22 17:31:21 +02:00
Duy
dff36d5c43
feat(i18n): Add Vietnamese locale (#2116)
Co-authored-by: userquin <userquin@gmail.com>
2023-05-22 14:33:30 +02:00
Emanuel Pina
a50f97e5f3
fix(i18n): update portuguese from Portugal translation (#2118) 2023-05-22 10:37:59 +02:00
Tuur Martens
9c9a1f7c35
fix: poll would sometimes remove last entry (#2117) 2023-05-21 21:57:29 +02:00
Joshix-1
e251a8a50b
chore: publish docker images on forks (#2106) 2023-05-21 17:29:29 +01:00
Joaquín Sánchez
dfb5a665f0
feat(pwa): add screenshots and orientation to webmanifest (#2109) 2023-05-21 17:28:28 +01:00
Tuur Martens
22556984fa
feat: adhere to and display poll limits (#2114) 2023-05-21 13:37:33 +02:00
Tuur Martens
1fda33848e
feat: poll creation (#2111) 2023-05-20 21:23:41 +02:00
Arash
d9add9f670
fix(i18n): update tr-TR translations (#2108) 2023-05-19 21:04:27 +02:00
patak
49ee431676 chore: release v0.9.7 2023-05-16 10:46:03 +02:00
patak
0092c8cbe9 fix: force using username@server settings if present 2023-05-16 10:45:22 +02:00
patak
d0a4c51ef5 chore: release v0.9.6 2023-05-16 09:45:25 +02:00
patak
52b2d12bf9 fix: tweak sidebar max-height 2023-05-16 09:38:25 +02:00
Cesar Gomez
5e5fb0e287
chore(i18n): little es translated word change for no_bookmarks and no_fa… (#2101) 2023-05-16 08:48:59 +02:00
Francesco
886488a3c9
feat(i18n): Update it-IT locale (#2100) 2023-05-16 08:48:13 +02:00
Joaquín Sánchez
69f9004917
feat(docs): allow edit any locale file (#2099) 2023-05-15 14:35:43 +02:00
patak
f635e0a634 fix: personal notes on loading 2023-05-15 09:26:55 +02:00
patak
29f6a73de1
fix: user acct not respecting domain (#2088) 2023-05-10 13:19:50 +01:00
Elan Hasson
f28c90498b
docs: Update README.md to fix typo (#2087) 2023-05-10 12:29:48 +01:00
Joaquín Sánchez
66484bac80
fix(ui): check empty spoiler text (#2092) 2023-05-10 11:28:48 +00:00
Joaquín Sánchez
99077da1bf
fix(ui): handle empty spoiler text (#2091) 2023-05-10 13:17:58 +02:00
patak
fc97e8ff5b fix: pasting emojis 2023-05-08 21:10:52 +02:00
patak
9d3c7ef116
feat: review compose buttons (#2076) 2023-05-08 08:45:27 +02:00
patak
e9740fe693
feat: separate search and explore (#2075)
Co-authored-by: TAKAHASHI Shuuji <shuuji3@gmail.com>
2023-05-07 17:41:18 +02:00
Francesco
1fbd88c826
feat(i18n): Update it-IT locale (#2080) 2023-05-07 17:00:36 +02:00
Emanuel Pina
d3cdadd444
fix(i18n): update portuguese from Portugal translation (#2077) 2023-05-07 07:57:46 +02:00
TAKAHASHI Shuuji
582a9847a1
feat: add 'use star favorite icon' preference (#2067) 2023-05-06 17:52:33 +02:00
patak
126cd4d535
feat: search back to the right (#2071) 2023-05-06 17:49:15 +02:00
Bram Van der Sype
c9265028d2
fix(i18n): Updated nl-NL.json (#2054) 2023-05-06 17:47:23 +02:00
DoceAzedo
77717c960c
feat(i18n): add Brazilian Portuguese locale (#2073)
Co-authored-by: userquin <userquin@gmail.com>
Co-authored-by: emanuelpina <emanuelpina@users.noreply.github.com>
2023-05-06 17:45:42 +02:00
Ayo Ayco
454ad18f1b
fix: regression with media hidden (#2072) 2023-05-06 11:26:16 +02:00
Abel Derderian
4be5d81f17
feat(i18n): Update fr-FR locale (#2060) 2023-05-06 08:57:42 +02:00
patak
5ffb96baf6 chore: release v0.9.5 2023-05-05 19:36:06 +02:00
Natsu Kagami
1487932c1d
fix: Handle failure when fetching user preferences (#2069) 2023-05-05 19:34:43 +02:00
Ayo Ayco
d9e7a09d24
feat: respect Media Display preferences (#2065) 2023-05-05 18:12:07 +02:00
TAKAHASHI Shuuji
a3116e703a
feat(i18n): update Japanese localization (#2061) 2023-05-05 17:40:09 +02:00
Francesco
8dd29039cd
feat(i18n): Update it-IT locale (#2055) 2023-05-05 16:13:34 +02:00
enpitsulin
0034b22da4
fix: image preview should justify-center (#2062) 2023-05-05 10:22:41 +02:00
patak
eebe57840b chore: release v0.9.4 2023-05-04 22:58:24 +02:00
patak
d59cdb0aa4 fix: extra spacing when no media in posts 2023-05-04 22:49:12 +02:00
patak
16561845f8 fix: respect always expand content warnings 2023-05-04 22:29:47 +02:00
patak
e9de11000b fix: new compose button opens compose route 2023-05-04 21:09:23 +02:00
Nikita Karamov
c6c844f3fd
fix: notification templates for admin reports (#2045)
Co-authored-by: patak <matias.capeletto@gmail.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
2023-05-03 15:01:35 +00:00
patak
fb61891c29 chore: release v0.9.3 2023-05-03 09:51:13 +02:00
patak
94323c8fe1 fix: personal note flash on profile
Fixes #2053
2023-05-03 09:25:08 +02:00
patak
f1f5a96929 chore: release v0.9.2 2023-05-02 17:55:39 +02:00
patak
df0c30c2f2 fix: account for width on sidebar media queries 2023-05-02 17:44:34 +02:00
patak
68f2c3fc5b chore: release v0.9.1 2023-05-02 14:15:55 +02:00
patak
d0ede35e89 fix: respect zenMode preference default 2023-05-02 14:13:53 +02:00
patak
c54aed62fb chore: release v0.9.0 2023-05-02 13:42:22 +02:00
renovate[bot]
5adc5eecf1
chore(deps): update devdependencies (#1944)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-02 11:11:22 +01:00
renovate[bot]
4c1e37caa2
chore(deps): update lint (#2011)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
2023-05-02 11:03:49 +01:00
Daniel Roe
847de1b39b chore: ignore vue and vue-tsc dependencies for now 2023-05-02 10:59:44 +01:00
Daniel Roe
0a98c5f13d
chore: upgrade to nuxt v3.4.3 (#2046) 2023-05-02 11:48:33 +02:00
Shinigami
835269fa1d
chore(deps): replace esno with tsx (#1966) 2023-05-02 02:04:12 +02:00
Anthony Fu
61526df93f chore: upgrade to VueUse v10 2023-05-02 01:58:55 +02:00
Shinigami
076c47b7b0
feat: prefer en language as top (#2042) 2023-05-01 19:30:57 +02:00
Emanuel Pina
98777f078c
fix(i18n): Update portuguese from Portugal translation (#2044) 2023-05-01 19:29:30 +02:00
patak
dcf0f93eb9
feat: compose button (#2037) 2023-05-01 18:08:09 +02:00
patak
656b789e7c
feat: height responsive sidebar (#2038) 2023-05-01 17:58:37 +02:00
Francesco
70cb620ccd
feat(i18n): Update it-IT locale (#2041) 2023-05-01 17:34:50 +02:00
Phojie Rengel
3c3324f070
feat(i18n): add Tagalog translation (#2019)
Co-authored-by: Ayo Ayco <ayo@ayco.io>
2023-05-01 11:55:49 +02:00
patak
f3e1b6db67 fix: empty glass header on large screens 2023-04-30 21:46:07 +02:00
patak
d4e0d5c5f5
feat: better messages for no favourites and bookmarks (#2031) 2023-04-30 17:49:33 +02:00
Alex
ccf115ca4c
fix: refresh status after edit (#2032) 2023-04-30 17:19:14 +02:00
patak
c7b77216c1 fix: long title and description for expansion not showing
Fixes #1948
2023-04-29 22:57:26 +02:00
patak
8b8de1182c fix: avoid flash of connected line while loading avatars 2023-04-29 21:53:41 +02:00
Mark Pinero
99dc8a0479
fix(default): update layout to use dynamic vh (#1817) 2023-04-28 19:44:58 +02:00
renovate[bot]
28a68f47eb
fix(deps): update tiptap to v2.0.3 (#1987) 2023-04-28 19:38:22 +02:00
Emanuel Pina
9cc4c23e50
fix(i18n): update portuguese from Portugal translation (#2009) 2023-04-28 19:34:35 +02:00
renovate[bot]
2b42f225dd
chore(deps): update pnpm to v8.3.1 (#2012) 2023-04-28 19:34:04 +02:00
Christof Dorner
320ed81555
fix: detect Takahe hashtags correctly (#2024) 2023-04-28 19:33:34 +02:00
Alex
5bd17d3006
docs: fix contributing_guide link (#2029) 2023-04-28 09:21:19 +01:00
Phojie Rengel
5dc136372b
refactor: button creation with v-for to remove redundancy (#2020) 2023-04-28 09:42:23 +02:00
Alex
5c3b8be055
feat: add wellbeing preference hide news (#2026) 2023-04-28 09:38:44 +02:00
Alex
cbba846c4f
fix: translation button still display when posts have no contents (#2027) 2023-04-28 09:36:05 +02:00
Alex
574d72af61
fix: reply remove-and-re-draft error (#2028) 2023-04-28 11:25:53 +08:00
Peter Budai
a0d036952d
feat(editor): Respect default privacy setting of the account (2nd) (#1733)
Co-authored-by: patak <matias.capeletto@gmail.com>
2023-04-27 20:41:10 +00:00
Shinigami
23c1dfec10
feat: lazy load images (#1969) 2023-04-26 22:46:00 +02:00
Phojie Rengel
1ceb3e2857
docs: update translation guide file to copy (#2017) 2023-04-25 17:41:51 +02:00
Francesco
3f1cdbbfa9
feat(i18n): Update it-IT locale (#2015) 2023-04-24 21:00:56 +02:00
Joaquín Sánchez
59e418e2e0
fix: content render receiving undefined when converting to vnode (#2016) 2023-04-24 20:46:17 +02:00
manuq
ac4188274c
feat(ui): add clear button to search input field (#1989)
Co-authored-by: patak <matias.capeletto@gmail.com>
2023-04-24 17:05:26 +02:00
Francesco
450908ecb2
feat(i18n): Update it-IT locale (#2014) 2023-04-24 16:50:37 +02:00
Francesco
85260e8aaa
feat(i18n): Update it-IT locale (#2008) 2023-04-24 13:42:54 +02:00
patak
b2c1a4ddef
fix: emoji sizing (#2007) 2023-04-24 07:19:29 +02:00
Peter Budai
85ac040c2f
fix: Re-enable user card hover over mentions in posts (#1745) 2023-04-23 21:40:55 +02:00
Alec LeFors
94d22fd488
fix: Allow account handles to wrap in AccountHeader (#1991) 2023-04-23 21:35:01 +02:00
Daniel Roe
5b1ad44875
chore: bump nuxt to v3.4.2 (#1998) 2023-04-23 21:27:52 +02:00
Francesco
21f57f1cfa
feat(i18n): Add Italian Localisation (#2005)
Co-authored-by: Joaquín Sánchez <userquin@gmail.com>
2023-04-23 20:10:24 +02:00
Joaquín Sánchez
6727e63626
feat(i18n): Update Spanish translations (#2006) 2023-04-23 17:03:37 +02:00
Joaquín Sánchez
54e2afa56b
feat(ui): use sticky position on settings mid panel (#2004) 2023-04-23 14:21:54 +02:00
manuq
56405f52bb
fix: Add zen mode to preferences, remove shortcut (#2003) 2023-04-23 12:21:33 +02:00
patak
9564985a4e
fix: unicode emojis when editing (#2002) 2023-04-22 19:12:17 +02:00
Xabi
aa77919925
fix(i18n): update Basque localisation (#2001) 2023-04-22 15:45:08 +02:00
JP
1eb47b98f5
fix(i18n): update Arabic localisation (#1993) 2023-04-22 14:36:41 +02:00
Liberal dev
acb2b80cdd
fix(i18n): update Korean localisation (#1996) 2023-04-22 14:35:39 +02:00
Tuur Martens
dbbbe8aa01
feat: improve personal notes (#1978) 2023-04-22 12:41:27 +02:00
patak
bda18e7ac5 chore: use "boosted" instead of "reblogged" 2023-04-21 21:38:45 +02:00
patak
ce149e4cb4 fix: notification with null status should be excluded
Fixes #1995
2023-04-21 21:35:39 +02:00
patak
6f19d54586 chore: release v0.8.1 2023-04-21 15:15:40 +02:00
Daniel Roe
6fc6517811 chore: fix lockfile 2023-04-20 12:16:49 +01:00
Daniel Roe
58a7f15216 chore: bump nuxt-vitest version 2023-04-20 12:15:12 +01:00
patak
ea44f8bc30 fix: allow custom emojis on profile metadata field names
Fixes #1992
2023-04-19 21:32:07 +02:00
patak
d34a5e6e96 chore: fix titleTemplate param type 2023-04-16 22:35:25 +02:00
patak
1f559fae08 fix: use @unhead/vue 2023-04-16 22:33:22 +02:00
Kingsley Yung
ca8d785d9e
feat: allow user to view follow list in "Hide following/follower count" mode (#1901) 2023-04-16 21:47:20 +02:00
Liberal dev
18ea4ffb6e
feat(i18n): add Korean translation (#1968) 2023-04-16 21:42:32 +02:00
Joaquín Sánchez
f07d32375a
fix: saving profile data breaks cache (#1937) 2023-04-16 21:39:33 +02:00
Joaquín Sánchez
c71259334c
fix: remove flashing text on page reload (#1939) 2023-04-16 21:33:51 +02:00
patak
13581323b0 chore: fix lint 2023-04-16 21:25:55 +02:00
Emanuel Pina
587f73c4a0
fix(i18n): update portuguese from Portugal translation (#1984) 2023-04-16 20:36:35 +02:00
Ivan Demchuk
2267556b8b
chore: add a script to cleanup old translations (#1963) 2023-04-16 14:28:45 +02:00
Emanuel Pina
dac044e6ad
fix(i18n): update portuguese from Portugal translation (#1975) 2023-04-16 14:27:59 +02:00
Shinigami
3442dfe75d
feat: hide status from suspended account (#1967) 2023-04-16 14:22:03 +02:00
Glaydus
ce5e81e160
fix(i18n): update Polish translations (#1982) 2023-04-16 14:17:31 +02:00
Cesar Gomez
621d280a96
feat(i18n): sync es base lang (#1979) 2023-04-15 18:57:52 +02:00
Daniel Roe
fb1ca7d8f1
fix: use purpose: any for normal pwa icon (#1981) 2023-04-15 17:16:20 +01:00
Anthony Fu
189d358b2a
chore: update all deps (#1976) 2023-04-12 14:35:35 +02:00
renovate[bot]
3acf87d5b6
chore(deps): update lint (#1971)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Shinigami92 <chrissi92@hotmail.de>
2023-04-11 08:04:22 -07:00
renovate[bot]
d33ac87c64
fix(deps): update dependency @unocss/nuxt to ^0.51.0 (#1973)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-11 07:03:27 -07:00
renovate[bot]
a037583631
chore(deps): update dependency vitest to ^0.30.1 (#1972)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-11 07:03:20 -07:00
renovate[bot]
d6e199b83a
chore(deps): update pnpm to v8 (#1970)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-11 06:44:14 -07:00
Tuur Martens
79538a65ee
fix: wrong profile showing on hover sometimes (#1913) (#1964) 2023-04-10 20:12:27 +02:00
Tuur Martens
2dc7ad27bf
feat: personal notes (#1960) 2023-04-09 21:11:37 +02:00
renovate[bot]
921eaae949
fix(deps): update tiptap to v2.0.2 (#1524)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-03 22:23:45 +02:00
Alex
2f79f53877
feat(i18n): sync zh-CN with en (#1865) 2023-04-03 15:34:59 +02:00
renovate[bot]
973805f16d
chore(deps): update dependency typescript to ^5.0.3 (#1945)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-03 15:34:33 +02:00
Joaquín Sánchez
685b16d403
chore: change pwa module name (#1947) 2023-04-03 15:34:19 +02:00
Joaquín Sánchez
ab2881b9a2
refactor: remove useHeadFixed workaround (#1938)
Co-authored-by: Ayaka Rizumu <464388324@qq.com>
2023-04-01 04:14:12 -07:00
Daniel Roe
60a37e0bf8 chore: update devtools 2023-03-31 11:50:34 +01:00
ghose
da94117f61
feat(i18n): Update Gaician translation (#1934) 2023-03-30 22:11:00 +02:00
三咲智子 Kevin Deng
605359b9df
chore: release v0.8.0 2023-03-31 03:21:30 +08:00
三咲智子 Kevin Deng
c513907dbb
chore(deps): upgrade tiptap 2023-03-31 03:16:51 +08:00
renovate[bot]
4cc0101a06
chore(deps): update devdependencies (#1927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-30 19:13:27 +00:00
三咲智子 Kevin Deng
f4f6208420
refactor: remove unused function 2023-03-31 03:07:49 +08:00
renovate[bot]
3c43a1cdd1
chore(deps): update lint (#1928)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
2023-03-30 19:01:24 +00:00
renovate[bot]
2838e18ff7
chore(deps): update dependency typescript to v5 (#1930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-31 02:58:04 +08:00
renovate[bot]
da2ac06d8a
chore(deps): update pnpm to v7.30.5 (#1929) 2023-03-27 20:18:22 +02:00
Baptiste Girardeau
881a49e0d9
fix: syntax for robots.txt disallow rules (#1925) 2023-03-26 17:11:22 +02:00
Daniel Roe
e062fb5e52
perf: set maxAge for various public assets (#1916) 2023-03-26 16:53:07 +02:00
renovate[bot]
a1026d3aab
fix(deps): update dependencies (#1908)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
2023-03-24 00:12:42 +00:00
renovate[bot]
42dc99929e
chore(deps): update devdependencies (#1736)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-24 08:02:15 +08:00
三咲智子 Kevin Deng
0916b05afd
refactor(docs): replace palette function 2023-03-24 07:51:30 +08:00
三咲智子 Kevin Deng
331d652ef0
fix(docs): remove npm lock file 2023-03-24 07:46:22 +08:00
renovate[bot]
e9ddf3e6a0
chore(deps): update docker/build-push-action action to v4 (#1919)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-24 07:40:30 +08:00
renovate[bot]
5dd3a52865
chore(deps): update dependency vitest to ^0.29.7 (#1918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-24 07:39:03 +08:00
399 changed files with 26287 additions and 12813 deletions

View file

@ -11,7 +11,6 @@ dist
.netlify/
.eslintcache
public/shiki
public/emojis
*~

View file

@ -8,7 +8,7 @@ NUXT_CLOUDFLARE_ACCOUNT_ID=
NUXT_CLOUDFLARE_NAMESPACE_ID=
NUXT_CLOUDFLARE_API_TOKEN=
# 'cloudflare' | 'fs'
# 'cloudflare' | 'vercel' | 'fs'
NUXT_STORAGE_DRIVER=
NUXT_STORAGE_FS_BASE=

View file

@ -1,13 +0,0 @@
*.css
*.png
*.ico
*.toml
*.patch
*.txt
Dockerfile
public/
https-dev-config/localhost.crt
https-dev-config/localhost.key
Dockerfile
elk-translation-status.json
docs/translation-status.json

View file

@ -1,18 +0,0 @@
{
"extends": "@antfu",
"ignorePatterns": ["!pages/public"],
"overrides": [
{
"files": ["locales/**.json"],
"rules": {
"jsonc/sort-keys": "error"
}
}
],
"rules": {
"vue/no-restricted-syntax":["error", {
"selector": "VElement[name='a']",
"message": "Use NuxtLink instead."
}]
}
}

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
* text=auto eol=lf

View file

@ -3,7 +3,14 @@
"extends": ["config:base", "schedule:weekly", "group:allNonMajor"],
"labels": ["c: dependencies"],
"rangeStrategy": "bump",
"node": false,
"ignoreDeps": [
"vue",
"vue-tsc",
"typescript",
// Intl.Segmenter is not supported in Firefox
"string-length"
],
"packageRules": [
{
"groupName": "devDependencies",
@ -57,6 +64,10 @@
{
"groupName": "typescript",
"matchPackageNames": ["typescript"]
},
{
"matchDatasources": ["node-version"],
"enabled": false
}
],
"vulnerabilityAlerts": {

View file

@ -10,17 +10,18 @@ on:
branches:
- main
workflow_dispatch: {}
merge_group: {}
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
cache: pnpm
- name: 📦 Install dependencies
@ -30,7 +31,8 @@ jobs:
run: pnpm nuxi prepare
- name: 🧪 Test project
run: pnpm test tests/unit
run: pnpm test:ci
timeout-minutes: 10
- name: 📝 Lint
run: pnpm lint

View file

@ -16,29 +16,29 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Docker meta
id: metal
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/elk-zone/elk
ghcr.io/${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metal.outputs.tags }}
labels: ${{ steps.metal.outputs.labels }}

View file

@ -12,12 +12,12 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

View file

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

2
.gitignore vendored
View file

@ -2,6 +2,7 @@ node_modules
*.log
dist
.output
.pnpm-store
.nuxt
.env
.DS_Store
@ -11,7 +12,6 @@ dist
.eslintcache
elk-translation-status.json
public/shiki
public/emojis
*~

1
.npmrc
View file

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

2
.nvmrc
View file

@ -1 +1 @@
v18
20

45
.vscode/settings.json vendored
View file

@ -5,10 +5,6 @@
"unmute",
"unstorage"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.formatOnSave": false,
"files.associations": {
"*.css": "postcss"
},
@ -23,7 +19,44 @@
"i18n-ally.preferredDelimiter": "_",
"i18n-ally.sortKeys": true,
"i18n-ally.sourceLanguage": "en",
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"volar.completion.preferredTagNameCase": "pascal",
"volar.completion.preferredAttrNameCase": "kebab"
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}

22
.woodpecker.yml Normal file
View file

@ -0,0 +1,22 @@
steps:
- name: build docker
image: docker:25-cli
secrets: [user, pass]
commands:
- apk add git
- REPO=$(echo "$CI_REPO" | tr '[:upper:]' '[:lower:]')
- REGISTRY="dev.cat-enby.club"
- MAJOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 1 | tr -d 'v')
- MINOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 2)
- PATCH=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 3 | cut -d '-' -f 1)
- docker buildx build -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0} -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR} -t $${REGISTRY}/$$REPO:v$${MAJOR:-0} -t $${REGISTRY}/$$REPO:latest .
- docker login --username $USER --password $PASS $${REGISTRY}
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0}
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR}
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}
- docker push $${REGISTRY}/$${REPO}:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
- repo: nikurasu:elk-test-ci
- event: tag

View file

@ -21,7 +21,6 @@ To develop and test the Elk package:
2. Ensure using the latest Node.js (16.x).
If you have [nvm](https://github.com/nvm-sh/nvm), you can run `nvm i` to install the required version.
3. The package manager used to install and link dependencies must be [pnpm](https://pnpm.io/) v7. To use it you must first enable [Corepack](https://github.com/nodejs/corepack) by running `corepack enable`. (Note: on Linux in a standard Node 16+ environment, you should follow the instructions to install via Node's `corepack` rather than using the `curl` command)
4. Check out a branch where you can work and commit your changes:
@ -84,7 +83,7 @@ Simple approach used by most websites of relying on direction set in HTML elemen
We've added some `UnoCSS` utilities styles to help you with that:
- Do not use `left/right` padding and margin: for example `pl-1`. Use `padding-inline-start/end` instead. So `pl-1` should be `ps-1`, `pr-1` should be `pe-1`. The same rules apply to margin.
- Do not use `rtl-` classes, such as `rtl-left-0`.
- For icons that should be rotated for RTL, add `class="rtl-flip"`. This can only be used for icons outside of elements with `dir="auto"`, such as timeline, and is the only exception from the rule above. For icons inside the timeline, it might not work as expected.
- For icons that should be rotated for RTL, add `class="rtl-flip"`. This can only be used for icons outside of elements with `dir="auto"`, such as timeline, and is the only exception to the rule above. For icons inside the timeline, it might not work as expected.
- For absolute positioned elements, don't use `left/right`: for example `left-0`. Use `inset-inline-start/end` instead. `UnoCSS` shortcuts are `inset-is` for `inset-inline-start` and `inset-ie` for `inset-inline-end`. Example: `left-0` should be replaced with `inset-is-0`.
- If you need to change the border radius for an entire left or right side, use `border-inline-start/end`. `UnoCSS` shortcuts are `rounded-is` for left side, `rounded-ie` for right side. Example: `rounded-l-5` should be replaced with `rounded-ie-5`.
- If you need to change the border radius for one corner, use `border-start-end-radius` and similar rules. `UnoCSS` shortcuts are `rounded` + top/bottom as either `-bs` (top) or `-be` (bottom) + left/right as either `-is` (left) or `-ie` (right). Example: `rounded-tl-0` should be replaced with `rounded-bs-is-0`.
@ -103,7 +102,7 @@ If you are updating a translation in your local environment, you can run the fol
### Adding a new language
1. Add a new file in [locales](./locales) folder with the language code as the filename.
2. Copy [en-US](./locales/en-US.json) and translate the strings.
2. Copy [en](./locales/en.json) and translate the strings.
3. Add the language to the `locales` array in [config/i18n.ts](./config/i18n.ts#L61), below `en` and `ar`:
- If your language has multiple country variants, add the generic one for language only (only if there are a lot of common entries, you can always add it as a new one)
- Add all country variants in [country variants object](./config/i18n.ts#L12)

View file

@ -14,6 +14,7 @@ RUN apk add git --no-cache
# Prepare build deps ( ignore postinstall scripts for now )
COPY package.json ./
COPY .npmrc ./
COPY pnpm-lock.yaml ./
COPY patches ./patches
RUN pnpm i --frozen-lockfile --ignore-scripts

View file

@ -39,7 +39,7 @@ The Elk team maintains a deployment at:
### Self-Host Docker Deployment
In order to host Elk yourself you can use the provided Dockerfile to build a container with elk. Be aware, that Elk only loads properly of the connection is done via SSL/TLS. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself.
In order to host Elk yourself you can use the provided Dockerfile to build a container with elk. Be aware, that Elk only loads properly if the connection is done via SSL/TLS. The Docker container itself does not provide any SSL/TLS handling. You'll have to add this bit yourself.
One could put Elk behind popular reverse proxies with SSL Handling like Traefik, NGINX etc.
1. checkout source ```git clone https://github.com/elk-zone/elk.git```
@ -49,20 +49,24 @@ One could put Elk behind popular reverse proxies with SSL Handling like Traefik,
1. adjust permissions of storage dir: ```sudo chown 911:911 ./elk-storage```
1. start container: ```docker-compose up -d```
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.
> [!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
> **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.
@ -134,7 +138,7 @@ nr test
## 📲 PWA
You can consult the [PWA documentation](https://docs.elk.zone/docs/pwa) to learn more about the PWA capabilities on Elk, how to install Elk PWA in your desktop or mobile device and some hints about PWA stuff on Elk.
You can consult the [PWA documentation](https://docs.elk.zone/pwa) to learn more about the PWA capabilities on Elk, how to install Elk PWA in your desktop or mobile device and some hints about PWA stuff on Elk.
## 🦄 Stack
@ -147,7 +151,7 @@ You can consult the [PWA documentation](https://docs.elk.zone/docs/pwa) to learn
- [UnoCSS](https://uno.antfu.me/) - The instant on-demand atomic CSS engine
- [Iconify](https://github.com/iconify/icon-sets#iconify-icon-sets-in-json-format) - Iconify icon sets in JSON format
- [Masto.js](https://neet.github.io/masto.js) - Mastodon API client in TypeScript
- [shiki](https://shiki.matsu.io/) - A beautiful Syntax Highlighter
- [shiki](https://shiki.style/) - A beautiful yet powerful syntax highlighter
- [vite-plugin-pwa](https://github.com/vite-pwa/vite-plugin-pwa) - Prompt for update, Web Push Notifications and Web Share Target API
## 👨‍💻 Contributors

View file

@ -4,10 +4,12 @@ provideGlobalCommands()
const route = useRoute()
if (process.server && !route.path.startsWith('/settings')) {
if (import.meta.server && !route.path.startsWith('/settings')) {
const url = useRequestURL()
useHead({
meta: [
{ property: 'og:url', content: `https://elk.zone${route.path}` },
{ property: 'og:url', content: `${url.origin}${route.path}` },
],
})
}

View file

@ -6,8 +6,8 @@ defineProps<{
square?: boolean
}>()
const loaded = $ref(false)
const error = $ref(false)
const loaded = ref(false)
const error = ref(false)
</script>
<template>

View file

@ -1,16 +1,16 @@
<script lang="ts" setup>
import type { mastodon } from 'masto'
const { account, as = 'div' } = $defineProps<{
defineOptions({
inheritAttrs: false,
})
const { account, as = 'div' } = defineProps<{
account: mastodon.v1.Account
as?: string
}>()
cacheAccount(account)
defineOptions({
inheritAttrs: false,
})
</script>
<template>

View file

@ -19,8 +19,10 @@ cacheAccount(account)
overflow-hidden
:to="getAccountRoute(account)"
/>
<div h-full p1 shrink-0>
<AccountFollowButton :account="account" :context="relationshipContext" />
</div>
<slot>
<div h-full p1 shrink-0>
<AccountFollowButton :account="account" :context="relationshipContext" />
</div>
</slot>
</div>
</template>

View file

@ -1,5 +1,6 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
const { account, command, context, ...props } = defineProps<{
account: mastodon.v1.Account
@ -9,55 +10,36 @@ const { account, command, context, ...props } = defineProps<{
}>()
const { t } = useI18n()
const isSelf = $(useSelfAccount(() => account))
const enable = $computed(() => !isSelf && currentUser.value)
const relationship = $computed(() => props.relationship || useRelationship(account).value)
const isSelf = useSelfAccount(() => account)
const enable = computed(() => !isSelf.value && currentUser.value)
const relationship = computed(() => props.relationship || useRelationship(account).value)
const isLoading = computed(() => relationship.value === undefined)
const { client } = $(useMasto())
async function toggleFollow() {
if (relationship!.following) {
if (await openConfirmDialog({
title: t('confirm.unfollow.title'),
confirm: t('confirm.unfollow.confirm'),
cancel: t('confirm.unfollow.cancel'),
}) !== 'confirm')
return
}
relationship!.following = !relationship!.following
try {
const newRel = await client.v1.accounts[relationship!.following ? 'follow' : 'unfollow'](account.id)
Object.assign(relationship!, newRel)
}
catch (err) {
console.error(err)
// TODO error handling
relationship!.following = !relationship!.following
}
}
const { client } = useMasto()
async function unblock() {
relationship!.blocking = false
relationship.value!.blocking = false
try {
const newRel = await client.v1.accounts.unblock(account.id)
const newRel = await client.value.v1.accounts.$select(account.id).unblock()
Object.assign(relationship!, newRel)
}
catch (err) {
console.error(err)
// TODO error handling
relationship!.blocking = true
relationship.value!.blocking = true
}
}
async function unmute() {
relationship!.muting = false
relationship.value!.muting = false
try {
const newRel = await client.v1.accounts.unmute(account.id)
const newRel = await client.value.v1.accounts.$select(account.id).unmute()
Object.assign(relationship!, newRel)
}
catch (err) {
console.error(err)
// TODO error handling
relationship!.muting = true
relationship.value!.muting = true
}
}
@ -65,21 +47,25 @@ useCommand({
scope: 'Actions',
order: -2,
visible: () => command && enable,
name: () => `${relationship?.following ? t('account.unfollow') : t('account.follow')} ${getShortHandle(account)}`,
name: () => `${relationship.value?.following ? t('account.unfollow') : t('account.follow')} ${getShortHandle(account)}`,
icon: 'i-ri:star-line',
onActivate: () => toggleFollow(),
onActivate: () => toggleFollowAccount(relationship.value!, account),
})
const buttonStyle = $computed(() => {
if (relationship?.blocking)
const buttonStyle = computed(() => {
if (relationship.value?.blocking)
return 'text-inverted bg-red border-red'
if (relationship?.muting)
if (relationship.value?.muting)
return 'text-base bg-card border-base'
// If following, use a label style with a strong border for Mutuals
if (relationship ? relationship.following : context === 'following')
return `text-base ${relationship?.followedBy ? 'border-strong' : 'border-base'}`
if (relationship.value ? relationship.value.following : context === 'following')
return `text-base ${relationship.value?.followedBy ? 'border-strong' : 'border-base'}`
// If loading, use a plain style
if (isLoading.value)
return 'text-base border-base'
// If not following, use a button style
return 'text-inverted bg-primary border-primary'
@ -90,34 +76,39 @@ const buttonStyle = $computed(() => {
<button
v-if="enable"
gap-1 items-center group
:disabled="relationship?.requested"
border-1
rounded-full flex="~ gap2 center" font-500 min-w-30 h-fit px3 py1
:class="buttonStyle"
:hover="!relationship?.blocking && !relationship?.muting && relationship?.following ? 'border-red text-red' : 'bg-base border-primary text-primary'"
@click="relationship?.blocking ? unblock() : relationship?.muting ? unmute() : toggleFollow()"
@click="relationship?.blocking ? unblock() : relationship?.muting ? unmute() : toggleFollowAccount(relationship!, account)"
>
<template v-if="relationship?.blocking">
<span elk-group-hover="hidden">{{ $t('account.blocking') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unblock') }}</span>
</template>
<template v-if="relationship?.muting">
<span elk-group-hover="hidden">{{ $t('account.muting') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unmute') }}</span>
</template>
<template v-else-if="relationship ? relationship.following : context === 'following'">
<span elk-group-hover="hidden">{{ relationship?.followedBy ? $t('account.mutuals') : $t('account.following') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unfollow') }}</span>
</template>
<template v-else-if="relationship?.requested">
<span>{{ $t('account.follow_requested') }}</span>
</template>
<template v-else-if="relationship ? relationship.followedBy : context === 'followedBy'">
<span elk-group-hover="hidden">{{ $t('account.follows_you') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.follow_back') }}</span>
<template v-if="isLoading">
<span i-svg-spinners-180-ring-with-bg />
</template>
<template v-else>
<span>{{ account.locked ? $t('account.request_follow') : $t('account.follow') }}</span>
<template v-if="relationship?.blocking">
<span elk-group-hover="hidden">{{ $t('account.blocking') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unblock') }}</span>
</template>
<template v-if="relationship?.muting">
<span elk-group-hover="hidden">{{ $t('account.muting') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unmute') }}</span>
</template>
<template v-else-if="relationship ? relationship.following : context === 'following'">
<span elk-group-hover="hidden">{{ relationship?.followedBy ? $t('account.mutuals') : $t('account.following') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.unfollow') }}</span>
</template>
<template v-else-if="relationship?.requested">
<span elk-group-hover="hidden">{{ $t('account.follow_requested') }}</span>
<span hidden elk-group-hover="inline">{{ $t('account.withdraw_follow_request') }}</span>
</template>
<template v-else-if="relationship ? relationship.followedBy : context === 'followedBy'">
<span elk-group-hover="hidden">{{ $t('account.follows_you') }}</span>
<span hidden elk-group-hover="inline">{{ account.locked ? $t('account.request_follow') : $t('account.follow_back') }}</span>
</template>
<template v-else>
<span>{{ account.locked ? $t('account.request_follow') : $t('account.follow') }}</span>
</template>
</template>
</button>
</template>

View file

@ -0,0 +1,68 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
const { account, ...props } = defineProps<{
account: mastodon.v1.Account
relationship?: mastodon.v1.Relationship
}>()
const relationship = computed(() => props.relationship || useRelationship(account).value)
const { client } = useMasto()
async function authorizeFollowRequest() {
relationship.value!.requestedBy = false
relationship.value!.followedBy = true
try {
const newRel = await client.value.v1.followRequests.$select(account.id).authorize()
Object.assign(relationship!, newRel)
}
catch (err) {
console.error(err)
relationship.value!.requestedBy = true
relationship.value!.followedBy = false
}
}
async function rejectFollowRequest() {
relationship.value!.requestedBy = false
try {
const newRel = await client.value.v1.followRequests.$select(account.id).reject()
Object.assign(relationship!, newRel)
}
catch (err) {
console.error(err)
relationship.value!.requestedBy = true
}
}
</script>
<template>
<div flex gap-4>
<template v-if="relationship?.requestedBy">
<CommonTooltip :content="$t('account.authorize')" no-auto-focus>
<button
type="button"
rounded-full text-sm p2 border-1
hover:text-green transition-colors
@click="authorizeFollowRequest"
>
<span block text-current i-ri:check-fill />
</button>
</CommonTooltip>
<CommonTooltip :content="$t('account.reject')" no-auto-focus>
<button
type="button"
rounded-full text-sm p2 border-1
hover:text-red transition-colors
@click="rejectFollowRequest"
>
<span block text-current i-ri:close-fill />
</button>
</CommonTooltip>
</template>
<template v-else>
<span text-secondary>
{{ relationship?.followedBy ? $t('account.authorized') : $t('account.rejected') }}
</span>
</template>
</div>
</template>

View file

@ -5,7 +5,7 @@ const { account } = defineProps<{
account: mastodon.v1.Account
}>()
const serverName = $computed(() => getServerName(account))
const serverName = computed(() => getServerName(account))
</script>
<template>

View file

@ -6,28 +6,30 @@ const { account } = defineProps<{
command?: boolean
}>()
const { client } = $(useMasto())
const { client } = useMasto()
const { t } = useI18n()
const createdAt = $(useFormattedDateTime(() => account.createdAt, {
const createdAt = useFormattedDateTime(() => account.createdAt, {
month: 'long',
day: 'numeric',
year: 'numeric',
}))
})
const relationship = $(useRelationship(account))
const relationship = useRelationship(account)
const namedFields = ref<mastodon.v1.AccountField[]>([])
const iconFields = ref<mastodon.v1.AccountField[]>([])
const hasHeader = $computed(() => !account.header.endsWith('/original/missing.png'))
const isEditingPersonalNote = ref<boolean>(false)
const hasHeader = computed(() => !account.header.endsWith('/original/missing.png'))
const isCopied = ref<boolean>(false)
function getFieldIconTitle(fieldName: string) {
return fieldName === 'Joined' ? t('account.joined') : fieldName
}
function getNotificationIconTitle() {
return relationship?.notifying ? t('account.notifications_on_post_disable', { username: `@${account.username}` }) : t('account.notifications_on_post_enable', { username: `@${account.username}` })
return relationship.value?.notifying ? t('account.notifications_on_post_disable', { username: `@${account.username}` }) : t('account.notifications_on_post_enable', { username: `@${account.username}` })
}
function previewHeader() {
@ -49,14 +51,14 @@ function previewAvatar() {
}
async function toggleNotifications() {
relationship!.notifying = !relationship?.notifying
relationship.value!.notifying = !relationship.value?.notifying
try {
const newRel = await client.v1.accounts.follow(account.id, { notify: relationship?.notifying })
const newRel = await client.value.v1.accounts.$select(account.id).follow({ notify: relationship.value?.notifying })
Object.assign(relationship!, newRel)
}
catch {
// TODO error handling
relationship!.notifying = !relationship?.notifying
relationship.value!.notifying = !relationship.value?.notifying
}
}
@ -73,27 +75,70 @@ watchEffect(() => {
})
icons.push({
name: 'Joined',
value: createdAt,
value: createdAt.value,
})
namedFields.value = named
iconFields.value = icons
})
const isSelf = $(useSelfAccount(() => account))
const isNotifiedOnPost = $computed(() => !!relationship?.notifying)
const personalNoteDraft = ref(relationship.value?.note ?? '')
watch(relationship, (relationship, oldValue) => {
if (!oldValue && relationship)
personalNoteDraft.value = relationship.note ?? ''
})
async function editNote(event: Event) {
if (!event.target || !('value' in event.target) || !relationship.value)
return
const newNote = event.target?.value as string
if (relationship.value.note?.trim() === newNote.trim())
return
const newNoteApiResult = await client.value.v1.accounts.$select(account.id).note.create({ comment: newNote })
relationship.value.note = newNoteApiResult.note
personalNoteDraft.value = relationship.value.note ?? ''
}
const isSelf = useSelfAccount(() => account)
const isNotifiedOnPost = computed(() => !!relationship.value?.notifying)
const personalNoteMaxLength = 2000
async function copyAccountName() {
try {
const shortHandle = getShortHandle(account)
const serverName = getServerName(account)
const accountName = `${shortHandle}@${serverName}`
await navigator.clipboard.writeText(accountName)
}
catch (err) {
console.error('Failed to copy account name:', err)
}
isCopied.value = true
setTimeout(() => {
isCopied.value = false
}, 2000)
}
</script>
<template>
<div flex flex-col>
<div v-if="relationship?.requestedBy" p-4 flex justify-between items-center bg-card>
<span text-primary font-bold>{{ $t('account.requested', [account.displayName]) }}</span>
<AccountFollowRequestButton :account="account" :relationship="relationship" />
</div>
<component :is="hasHeader ? 'button' : 'div'" border="b base" z-1 @click="hasHeader ? previewHeader() : undefined">
<img h-50 height="200" w-full object-cover :src="account.header" :alt="t('account.profile_description', [account.username])">
</component>
<div p4 mt--18 flex flex-col gap-4>
<div relative>
<div flex justify-between>
<button shrink-0 :class="{ 'rounded-full': !isSelf, 'squircle': isSelf }" w-30 h-30 p1 bg-base border-bg-base z-2 @click="previewAvatar">
<AccountAvatar :square="isSelf" :account="account" hover:opacity-90 transition-opacity />
<button shrink-0 h-full :class="{ 'rounded-full': !isSelf, 'squircle': isSelf }" p1 bg-base border-bg-base z-2 @click="previewAvatar">
<AccountAvatar :square="isSelf" :account="account" hover:opacity-90 transition-opacity w-28 h-28 />
</button>
<div inset-ie-0 flex="~ wrap row-reverse" gap-2 items-center pt18 justify-start>
<!-- Edit profile -->
@ -107,7 +152,11 @@ const isNotifiedOnPost = $computed(() => !!relationship?.notifying)
</NuxtLink>
<AccountFollowButton :account="account" :command="command" />
<span inset-ie-0 flex gap-2 items-center>
<AccountMoreButton :account="account" :command="command" />
<AccountMoreButton
:account="account" :command="command"
@add-note="isEditingPersonalNote = true"
@remove-note="() => { isEditingPersonalNote = false; personalNoteDraft = '' }"
/>
<CommonTooltip v-if="!isSelf && relationship?.following" :content="getNotificationIconTitle()">
<button
:aria-pressed="isNotifiedOnPost"
@ -138,21 +187,70 @@ const isNotifiedOnPost = $computed(() => !!relationship?.notifying)
</div>
</div>
<div flex="~ col gap1" pt2>
<div flex justify-between>
<div flex gap2 items-center flex-wrap>
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" />
<AccountLockIndicator v-if="account.locked" show-label />
<AccountBotIndicator v-if="account.bot" show-label />
</div>
<AccountHandle :account="account" />
<div flex items-center gap-1>
<AccountHandle :account="account" overflow-unset line-clamp-unset />
<CommonTooltip placement="bottom" :content="$t('account.copy_account_name')" no-auto-focus flex>
<button text-secondary-light text-sm :class="isCopied ? 'i-ri:check-fill text-green' : 'i-ri:file-copy-line'" @click="copyAccountName">
<span sr-only>{{ $t('account.copy_account_name') }}</span>
</button>
</CommonTooltip>
</div>
</div>
</div>
<label
v-if="isEditingPersonalNote || (relationship?.note && relationship.note.length > 0)"
space-y-2
pb-4
block
border="b base"
>
<div flex flex-row space-x-2 flex-v-center>
<div i-ri-edit-2-line />
<p font-medium>
{{ $t('account.profile_personal_note') }}
</p>
<p text-secondary text-sm :class="{ 'text-orange': personalNoteDraft.length > (personalNoteMaxLength - 100) }">
{{ personalNoteDraft.length }} / {{ personalNoteMaxLength }}
</p>
</div>
<div position-relative>
<div
input-base
min-h-10ex
whitespace-pre-wrap
opacity-0
:class="{ 'trailing-newline': personalNoteDraft.endsWith('\n') }"
>
{{ personalNoteDraft }}
</div>
<textarea
v-model="personalNoteDraft"
input-base
position-absolute
style="height: 100%"
top-0
resize-none
:maxlength="personalNoteMaxLength"
@change="editNote"
/>
</div>
</label>
<div v-if="account.note" max-h-100 overflow-y-auto>
<ContentRich text-4 text-base :content="account.note" :emojis="account.emojis" />
</div>
<div v-if="namedFields.length" flex="~ col wrap gap1">
<div v-for="field in namedFields" :key="field.name" flex="~ gap-1" items-center>
<div text-secondary uppercase text-xs font-bold>
{{ field.name }} |
<div mt="0.5" text-secondary uppercase text-xs font-bold>
<ContentRich :content="field.name" :emojis="account.emojis" />
</div>
<span text-secondary text-xs font-bold>|</span>
<ContentRich :content="field.value" :emojis="account.emojis" />
</div>
</div>
@ -168,3 +266,9 @@ const isNotifiedOnPost = $computed(() => !!relationship?.notifying)
</div>
</div>
</template>
<style>
.trailing-newline::after {
content: '\a';
}
</style>

View file

@ -5,7 +5,7 @@ const { account } = defineProps<{
account: mastodon.v1.Account
}>()
const relationship = $(useRelationship(account))
const relationship = useRelationship(account)
</script>
<template>
@ -19,6 +19,6 @@ const relationship = $(useRelationship(account))
<div v-if="account.note" max-h-100 overflow-y-auto>
<ContentRich text-4 text-secondary :content="account.note" :emojis="account.emojis" />
</div>
<AccountPostsFollowers text-sm :account="account" />
<AccountPostsFollowers text-sm :account="account" :is-hover-card="true" />
</div>
</template>

View file

@ -1,26 +1,69 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { fetchAccountByHandle } from '~/composables/cache'
const props = defineProps<{
account?: mastodon.v1.Account
handle?: string
disabled?: boolean
}>()
const account = props.account || (props.handle ? useAccountByHandle(props.handle!) : undefined)
const userSettings = useUserSettings()
type WatcherType = [acc?: mastodon.v1.Account | null, h?: string, v?: boolean]
defineOptions({
inheritAttrs: false,
})
const props = defineProps<{
account?: mastodon.v1.Account | null
handle?: string
disabled?: boolean
}>()
const accountHover = ref()
const hovered = useElementHover(accountHover)
const account = ref<mastodon.v1.Account | null | undefined>(props.account)
watch(
() => [props.account, props.handle, hovered.value] satisfies WatcherType,
([newAccount, newHandle, newVisible], oldProps) => {
if (!newVisible || process.test)
return
if (newAccount) {
account.value = newAccount
return
}
if (newHandle) {
const [_oldAccount, oldHandle, _oldVisible] = oldProps ?? [undefined, undefined, false]
if (!oldHandle || newHandle !== oldHandle || !account.value) {
// new handle can be wrong: using server instead of webDomain
fetchAccountByHandle(newHandle).then((acc) => {
if (newHandle === props.handle)
account.value = acc
})
}
return
}
account.value = undefined
},
{ immediate: true, flush: 'post' },
)
const userSettings = useUserSettings()
</script>
<template>
<VMenu v-if="!disabled && account && !getPreferences(userSettings, 'hideAccountHoverCard')" placement="bottom-start" :delay="{ show: 500, hide: 100 }" v-bind="$attrs" :close-on-content-click="false">
<slot />
<template #popper>
<AccountHoverCard v-if="account" :account="account" />
</template>
</VMenu>
<slot v-else />
<span ref="accountHover">
<VMenu
v-if="!disabled && account && !getPreferences(userSettings, 'hideAccountHoverCard')"
placement="bottom-start"
:delay="{ show: 500, hide: 100 }"
v-bind="$attrs"
:close-on-content-click="false"
>
<slot />
<template #popper>
<AccountHoverCard v-if="account" :account="account" />
</template>
</VMenu>
<slot v-else />
</span>
</template>

View file

@ -1,16 +1,16 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineOptions({
inheritAttrs: false,
})
const { account, as = 'div' } = defineProps<{
account: mastodon.v1.Account
as?: string
hoverCard?: boolean
square?: boolean
}>()
defineOptions({
inheritAttrs: false,
})
</script>
<!-- TODO: Make this work for both buttons and links -->
@ -23,6 +23,8 @@ defineOptions({
<div flex="~ col" shrink pt-1 h-full overflow-hidden justify-center leading-none select-none>
<div flex="~" gap-2>
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
<AccountLockIndicator v-if="account.locked" text-xs />
<AccountBotIndicator v-if="account.bot" text-xs />
</div>
<AccountHandle :account="account" text-secondary-light />

View file

@ -0,0 +1,23 @@
<script setup lang="ts">
defineProps<{
showLabel?: boolean
}>()
const { t } = useI18n()
</script>
<template>
<div
flex="~ gap1" items-center
:class="{ 'border border-base rounded-md px-1': showLabel }"
text-secondary-light
>
<slot name="prepend" />
<CommonTooltip no-auto-focus content="Lock" :disabled="showLabel">
<div i-ri:lock-line />
</CommonTooltip>
<div v-if="showLabel">
{{ t('account.lock') }}
</div>
</div>
</template>

View file

@ -1,67 +1,56 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleBlockDomain, toggleMuteAccount } from '~~/composables/masto/relationship'
const { account } = defineProps<{
account: mastodon.v1.Account
command?: boolean
}>()
let relationship = $(useRelationship(account))
const emit = defineEmits<{
(evt: 'addNote'): void
(evt: 'removeNote'): void
}>()
const isSelf = $(useSelfAccount(() => account))
const relationship = useRelationship(account)
const isSelf = useSelfAccount(() => account)
const { t } = useI18n()
const { client } = $(useMasto())
const { client } = useMasto()
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
const { share, isSupported: isShareSupported } = useShare()
const toggleMute = async () => {
if (!relationship!.muting && await openConfirmDialog({
title: t('confirm.mute_account.title', [account.acct]),
confirm: t('confirm.mute_account.confirm'),
cancel: t('confirm.mute_account.cancel'),
}) !== 'confirm')
return
function shareAccount() {
share({ url: location.href })
}
relationship!.muting = !relationship!.muting
relationship = relationship!.muting
? await client.v1.accounts.mute(account.id, {
// TODO support more options
async function toggleReblogs() {
if (!relationship.value!.showingReblogs) {
const dialogChoice = await openConfirmDialog({
title: t('confirm.show_reblogs.title'),
description: t('confirm.show_reblogs.description', [account.acct]),
confirm: t('confirm.show_reblogs.confirm'),
cancel: t('confirm.show_reblogs.cancel'),
})
: await client.v1.accounts.unmute(account.id)
if (dialogChoice.choice !== 'confirm')
return
}
const showingReblogs = !relationship.value?.showingReblogs
relationship.value = await client.value.v1.accounts.$select(account.id).follow({ reblogs: showingReblogs })
}
const toggleBlockUser = async () => {
if (!relationship!.blocking && await openConfirmDialog({
title: t('confirm.block_account.title', [account.acct]),
confirm: t('confirm.block_account.confirm'),
cancel: t('confirm.block_account.cancel'),
}) !== 'confirm')
return
relationship!.blocking = !relationship!.blocking
relationship = await client.v1.accounts[relationship!.blocking ? 'block' : 'unblock'](account.id)
async function addUserNote() {
emit('addNote')
}
const toggleBlockDomain = async () => {
if (!relationship!.domainBlocking && await openConfirmDialog({
title: t('confirm.block_domain.title', [getServerName(account)]),
confirm: t('confirm.block_domain.confirm'),
cancel: t('confirm.block_domain.cancel'),
}) !== 'confirm')
async function removeUserNote() {
if (!relationship.value!.note || relationship.value!.note.length === 0)
return
relationship!.domainBlocking = !relationship!.domainBlocking
await client.v1.domainBlocks[relationship!.domainBlocking ? 'block' : 'unblock'](getServerName(account))
}
const toggleReblogs = async () => {
if (!relationship!.showingReblogs && await openConfirmDialog({
title: t('confirm.show_reblogs.title', [account.acct]),
confirm: t('confirm.show_reblogs.confirm'),
cancel: t('confirm.show_reblogs.cancel'),
}) !== 'confirm')
return
const showingReblogs = !relationship?.showingReblogs
relationship = await client.v1.accounts.follow(account.id, { reblogs: showingReblogs })
const newNote = await client.value.v1.accounts.$select(account.id).note.create({ comment: '' })
relationship.value!.note = newNote.note
emit('removeNote')
}
</script>
@ -81,6 +70,13 @@ const toggleReblogs = async () => {
:command="command"
/>
</NuxtLink>
<CommonDropdownItem
v-if="isShareSupported"
:text="$t('menu.share_account', [`@${account.acct}`])"
icon="i-ri:share-line"
:command="command"
@click="shareAccount()"
/>
<template v-if="currentUser">
<template v-if="!isSelf">
@ -112,19 +108,34 @@ const toggleReblogs = async () => {
@click="toggleReblogs()"
/>
<CommonDropdownItem
v-if="!relationship?.note || relationship?.note?.length === 0"
:text="$t('menu.add_personal_note', [`@${account.acct}`])"
icon="i-ri-edit-2-line"
:command="command"
@click="addUserNote()"
/>
<CommonDropdownItem
v-else
:text="$t('menu.remove_personal_note', [`@${account.acct}`])"
icon="i-ri-edit-2-line"
:command="command"
@click="removeUserNote()"
/>
<CommonDropdownItem
v-if="!relationship?.muting"
:text="$t('menu.mute_account', [`@${account.acct}`])"
icon="i-ri:volume-up-fill"
icon="i-ri:volume-mute-line"
:command="command"
@click="toggleMute()"
@click="toggleMuteAccount (relationship!, account)"
/>
<CommonDropdownItem
v-else
:text="$t('menu.unmute_account', [`@${account.acct}`])"
icon="i-ri:volume-mute-line"
icon="i-ri:volume-up-fill"
:command="command"
@click="toggleMute()"
@click="toggleMuteAccount (relationship!, account)"
/>
<CommonDropdownItem
@ -132,14 +143,14 @@ const toggleReblogs = async () => {
:text="$t('menu.block_account', [`@${account.acct}`])"
icon="i-ri:forbid-2-line"
:command="command"
@click="toggleBlockUser()"
@click="toggleBlockAccount (relationship!, account)"
/>
<CommonDropdownItem
v-else
:text="$t('menu.unblock_account', [`@${account.acct}`])"
icon="i-ri:checkbox-circle-line"
:command="command"
@click="toggleBlockUser()"
@click="toggleBlockAccount (relationship!, account)"
/>
<template v-if="getServerName(account) !== currentServer">
@ -148,16 +159,23 @@ const toggleReblogs = async () => {
:text="$t('menu.block_domain', [getServerName(account)])"
icon="i-ri:shut-down-line"
:command="command"
@click="toggleBlockDomain()"
@click="toggleBlockDomain(relationship!, account)"
/>
<CommonDropdownItem
v-else
:text="$t('menu.unblock_domain', [getServerName(account)])"
icon="i-ri:restart-line"
:command="command"
@click="toggleBlockDomain()"
@click="toggleBlockDomain(relationship!, account)"
/>
</template>
<CommonDropdownItem
:text="$t('menu.report_account', [`@${account.acct}`])"
icon="i-ri:flag-2-line"
:command="command"
@click="openReportDialog(account)"
/>
</template>
<template v-else>
@ -165,7 +183,7 @@ const toggleReblogs = async () => {
<CommonDropdownItem :text="$t('account.pinned')" icon="i-ri:pushpin-line" :command="command" />
</NuxtLink>
<NuxtLink to="/favourites">
<CommonDropdownItem :text="$t('account.favourites')" icon="i-ri:heart-3-line" :command="command" />
<CommonDropdownItem :text="$t('account.favourites')" :icon="useStarFavoriteIcon ? 'i-ri:star-line' : 'i-ri:heart-3-line'" :command="command" />
</NuxtLink>
<NuxtLink to="/mutes">
<CommonDropdownItem :text="$t('account.muted_users')" icon="i-ri:volume-mute-line" :command="command" />

View file

@ -1,17 +1,17 @@
<script setup lang="ts">
import type { Paginator, mastodon } from 'masto'
import type { mastodon } from 'masto'
const { paginator, account, context } = defineProps<{
paginator: Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams>
paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined>
context?: 'following' | 'followers'
account?: mastodon.v1.Account
relationshipContext?: 'followedBy' | 'following'
}>()
const fallbackContext = $computed(() => {
const fallbackContext = computed(() => {
return ['following', 'followers'].includes(context!)
})
const showOriginSite = $computed(() =>
const showOriginSite = computed(() =>
account && account.id !== currentUser.value?.account.id && getServerName(account) !== currentServer.value,
)
</script>

View file

@ -3,6 +3,7 @@ import type { mastodon } from 'masto'
defineProps<{
account: mastodon.v1.Account
isHoverCard?: boolean
}>()
const userSettings = useUserSettings()
@ -26,33 +27,51 @@ const userSettings = useUserSettings()
</template>
</NuxtLink>
<NuxtLink
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowingRoute(account)"
replace
text-secondary exact-active-class="text-primary"
>
<template #default="{ isExactActive }">
<CommonLocalizedNumber
keypath="account.following_count"
:count="account.followingCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<template
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
>
<CommonLocalizedNumber
v-if="account.followingCount >= 0"
keypath="account.following_count"
:count="account.followingCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<div v-else flex gap-x-1>
<span font-bold text-base>Hidden</span>
<span>{{ $t('account.following') }}</span>
</div>
</template>
<span v-else>{{ $t('account.following') }}</span>
</template>
</NuxtLink>
<NuxtLink
v-if="!getPreferences(userSettings, 'hideFollowerCount')"
v-if="!(isHoverCard && getPreferences(userSettings, 'hideFollowerCount'))"
:to="getAccountFollowersRoute(account)"
replace text-secondary
exact-active-class="text-primary"
>
<template #default="{ isExactActive }">
<CommonLocalizedNumber
keypath="account.followers_count"
:count="account.followersCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<template v-if="!getPreferences(userSettings, 'hideFollowerCount')">
<CommonLocalizedNumber
v-if="account.followersCount >= 0"
keypath="account.followers_count"
:count="account.followersCount"
font-bold
:class="isExactActive ? 'text-primary' : 'text-base'"
/>
<div v-else flex gap-x-1>
<span font-bold text-base>Hidden</span>
<span>{{ $t('account.followers') }}</span>
</div>
</template>
<span v-else>{{ $t('account.followers') }}</span>
</template>
</NuxtLink>
</div>

View file

@ -0,0 +1,31 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineProps<{
account: mastodon.v1.Account
limit?: number
}>()
</script>
<template>
<div
flex="~ gap1" items-center
class="border border-base rounded-md px-1"
text-secondary-light
>
<slot name="prepend" />
<div v-for="role in account.roles?.slice(0, limit)" :key="role.id" flex>
<div :style="`color: ${role.color}; border-color: ${role.color}`">
{{ role.name }}
</div>
</div>
</div>
<div
v-if="limit && account.roles?.length > limit"
flex="~ gap1" items-center
class="border border-base rounded-md px-1"
text-secondary-light
>
+{{ account.roles?.length - limit }}
</div>
</template>

View file

@ -1,18 +1,18 @@
<script setup lang="ts">
import type { CommonRouteTabOption } from '../common/CommonRouteTabs.vue'
import type { CommonRouteTabOption } from '~/types'
const { t } = useI18n()
const route = useRoute()
const server = $(computedEager(() => route.params.server as string))
const account = $(computedEager(() => route.params.account as string))
const server = computed(() => route.params.server as string)
const account = computed(() => route.params.account as string)
const tabs = $computed<CommonRouteTabOption[]>(() => [
const tabs = computed<CommonRouteTabOption[]>(() => [
{
name: 'account-index',
to: {
name: 'account-index',
params: { server, account },
params: { server: server.value, account: account.value },
},
display: t('tab.posts'),
icon: 'i-ri:file-list-2-line',
@ -21,7 +21,7 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
name: 'account-replies',
to: {
name: 'account-replies',
params: { server, account },
params: { server: server.value, account: account.value },
},
display: t('tab.posts_with_replies'),
icon: 'i-ri:chat-1-line',
@ -30,7 +30,7 @@ const tabs = $computed<CommonRouteTabOption[]>(() => [
name: 'account-media',
to: {
name: 'account-media',
params: { server, account },
params: { server: server.value, account: account.value },
},
display: t('tab.media'),
icon: 'i-ri:camera-2-line',

View file

@ -0,0 +1,45 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
defineOptions({
inheritAttrs: false,
})
const { tagName, disabled } = defineProps<{
tagName?: string
disabled?: boolean
}>()
const tag = ref<mastodon.v1.Tag>()
const tagHover = ref()
const hovered = useElementHover(tagHover)
watch(hovered, (newHovered) => {
if (newHovered && tagName) {
fetchTag(tagName).then((t) => {
tag.value = t
})
}
})
const userSettings = useUserSettings()
</script>
<template>
<span ref="tagHover">
<VMenu
v-if="!disabled && !getPreferences(userSettings, 'hideTagHoverCard')"
placement="bottom-start"
:delay="{ show: 500, hide: 100 }"
v-bind="$attrs"
:close-on-content-click="false"
>
<slot />
<template #popper>
<TagCardSkeleton v-if="!tag" />
<TagCard v-else :tag="tag" />
</template>
</VMenu>
<slot v-else />
</span>
</template>

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import type { LocaleObject } from '@nuxtjs/i18n'
import type { AriaAnnounceType, AriaLive } from '~/composables/aria'
import type { LocaleObject } from '#i18n'
const router = useRouter()
const { t, locale, locales } = useI18n()
@ -11,16 +11,16 @@ const localeMap = (locales.value as LocaleObject[]).reduce((acc, l) => {
return acc
}, {} as Record<string, string>)
let ariaLive = $ref<AriaLive>('polite')
let ariaMessage = $ref<string>('')
const ariaLive = ref<AriaLive>('polite')
const ariaMessage = ref<string>('')
const onMessage = (event: AriaAnnounceType, message?: string) => {
function onMessage(event: AriaAnnounceType, message?: string) {
if (event === 'announce')
ariaMessage = message!
ariaMessage.value = message!
else if (event === 'mute')
ariaLive = 'off'
ariaLive.value = 'off'
else
ariaLive = 'polite'
ariaLive.value = 'polite'
}
watch(locale, (l, ol) => {

View file

@ -1,19 +1,19 @@
<script lang="ts" setup>
import type { ResolvedCommand } from '~/composables/command'
const emit = defineEmits<{
(event: 'activate'): void
}>()
const {
cmd,
index,
active = false,
} = $defineProps<{
} = defineProps<{
cmd: ResolvedCommand
index: number
active?: boolean
}>()
const emit = defineEmits<{
(event: 'activate'): void
}>()
</script>
<template>

View file

@ -5,7 +5,7 @@ const props = defineProps<{
const isMac = useIsMac()
const keys = $computed(() => props.name.toLowerCase().split('+'))
const keys = computed(() => props.name.toLowerCase().split('+'))
</script>
<template>

View file

@ -10,31 +10,33 @@ const registry = useCommandRegistry()
const router = useRouter()
const inputEl = $ref<HTMLInputElement>()
const resultEl = $ref<HTMLDivElement>()
const inputEl = ref<HTMLInputElement>()
const resultEl = ref<HTMLDivElement>()
const scopes = $ref<CommandScope[]>([])
let input = $(commandPanelInput)
const scopes = ref<CommandScope[]>([])
const input = commandPanelInput
onMounted(() => {
inputEl?.focus()
inputEl.value?.focus()
})
const commandMode = $computed(() => input.startsWith('>'))
const commandMode = computed(() => input.value.startsWith('>'))
const query = $computed(() => commandMode ? '' : input.trim())
const query = computed(() => commandMode.value ? '' : input.value.trim())
const { accounts, hashtags, loading } = useSearch($$(query))
const { accounts, hashtags, loading } = useSearch(query)
const toSearchQueryResultItem = (search: SearchResultType): QueryResultItem => ({
index: 0,
type: 'search',
search,
onActivate: () => router.push(search.to),
})
function toSearchQueryResultItem(search: SearchResultType): QueryResultItem {
return {
index: 0,
type: 'search',
search,
onActivate: () => router.push(search.to),
}
}
const searchResult = $computed<QueryResult>(() => {
if (query.length === 0 || loading.value)
const searchResult = computed<QueryResult>(() => {
if (query.value.length === 0 || loading.value)
return { length: 0, items: [], grouped: {} as any }
// TODO extract this scope
@ -59,55 +61,56 @@ const searchResult = $computed<QueryResult>(() => {
}
})
const result = $computed<QueryResult>(() => commandMode
? registry.query(scopes.map(s => s.id).join('.'), input.slice(1).trim())
: searchResult,
const result = computed<QueryResult>(() => commandMode.value
? registry.query(scopes.value.map(s => s.id).join('.'), input.value.slice(1).trim())
: searchResult.value,
)
const isMac = useIsMac()
const modifierKeyName = $computed(() => isMac.value ? '⌘' : 'Ctrl')
const modifierKeyName = computed(() => isMac.value ? '⌘' : 'Ctrl')
let active = $ref(0)
watch($$(result), (n, o) => {
const active = ref(0)
watch(result, (n, o) => {
if (n.length !== o.length || !n.items.every((i, idx) => i === o.items[idx]))
active = 0
active.value = 0
})
const findItemEl = (index: number) =>
resultEl?.querySelector(`[data-index="${index}"]`) as HTMLDivElement | null
const onCommandActivate = (item: QueryResultItem) => {
function findItemEl(index: number) {
return resultEl.value?.querySelector(`[data-index="${index}"]`) as HTMLDivElement | null
}
function onCommandActivate(item: QueryResultItem) {
if (item.onActivate) {
item.onActivate()
emit('close')
}
else if (item.onComplete) {
scopes.push(item.onComplete())
input = '> '
scopes.value.push(item.onComplete())
input.value = '> '
}
}
const onCommandComplete = (item: QueryResultItem) => {
function onCommandComplete(item: QueryResultItem) {
if (item.onComplete) {
scopes.push(item.onComplete())
input = '> '
scopes.value.push(item.onComplete())
input.value = '> '
}
else if (item.onActivate) {
item.onActivate()
emit('close')
}
}
const intoView = (index: number) => {
function intoView(index: number) {
const el = findItemEl(index)
if (el)
el.scrollIntoView({ block: 'nearest' })
}
function setActive(index: number) {
const len = result.length
active = (index + len) % len
intoView(active)
const len = result.value.length
active.value = (index + len) % len
intoView(active.value)
}
const onKeyDown = (e: KeyboardEvent) => {
function onKeyDown(e: KeyboardEvent) {
switch (e.key) {
case 'p':
case 'ArrowUp': {
@ -115,7 +118,7 @@ const onKeyDown = (e: KeyboardEvent) => {
break
e.preventDefault()
setActive(active - 1)
setActive(active.value - 1)
break
}
@ -125,7 +128,7 @@ const onKeyDown = (e: KeyboardEvent) => {
break
e.preventDefault()
setActive(active + 1)
setActive(active.value + 1)
break
}
@ -133,9 +136,9 @@ const onKeyDown = (e: KeyboardEvent) => {
case 'Home': {
e.preventDefault()
active = 0
active.value = 0
intoView(active)
intoView(active.value)
break
}
@ -143,7 +146,7 @@ const onKeyDown = (e: KeyboardEvent) => {
case 'End': {
e.preventDefault()
setActive(result.length - 1)
setActive(result.value.length - 1)
break
}
@ -151,7 +154,7 @@ const onKeyDown = (e: KeyboardEvent) => {
case 'Enter': {
e.preventDefault()
const cmd = result.items[active]
const cmd = result.value.items[active.value]
if (cmd)
onCommandActivate(cmd)
@ -161,7 +164,7 @@ const onKeyDown = (e: KeyboardEvent) => {
case 'Tab': {
e.preventDefault()
const cmd = result.items[active]
const cmd = result.value.items[active.value]
if (cmd)
onCommandComplete(cmd)
@ -169,9 +172,9 @@ const onKeyDown = (e: KeyboardEvent) => {
}
case 'Backspace': {
if (input === '>' && scopes.length) {
if (input.value === '>' && scopes.value.length) {
e.preventDefault()
scopes.pop()
scopes.value.pop()
}
break
}

View file

@ -2,9 +2,7 @@
const emit = defineEmits<{
(event: 'close'): void
}>()
const { modelValue: visible } = defineModel<{
modelValue?: boolean
}>()
const visible = defineModel<boolean>()
function close() {
emit('close')

View file

@ -1,54 +1,16 @@
<script setup lang="ts">
import { decode } from 'blurhash'
const { blurhash, src, srcset, shouldLoadImage = true } = defineProps<{
blurhash?: string | null | undefined
src: string
srcset?: string
shouldLoadImage?: boolean
}>()
defineOptions({
inheritAttrs: false,
})
const isLoaded = ref(false)
const placeholderSrc = $computed(() => {
if (!blurhash)
return ''
const pixels = decode(blurhash, 32, 32)
return getDataUrlFromArr(pixels, 32, 32)
})
function loadImage() {
const img = document.createElement('img')
img.onload = () => {
isLoaded.value = true
}
img.src = src
if (srcset)
img.srcset = srcset
setTimeout(() => {
isLoaded.value = true
}, 3_000)
}
onMounted(() => {
if (shouldLoadImage)
loadImage()
})
watch(() => shouldLoadImage, () => {
if (shouldLoadImage)
loadImage()
})
const { blurhash = '', src, srcset, shouldLoadImage = true } = defineProps<{
blurhash?: string
src: string
srcset?: string
shouldLoadImage?: boolean
}>()
</script>
<template>
<img v-if="isLoaded || !placeholderSrc" v-bind="$attrs" :src="src" :srcset="srcset">
<img v-else v-bind="$attrs" :src="placeholderSrc">
<UnLazyImage v-bind="$attrs" :blurhash="blurhash" :src="src" :src-set="srcset" :lazy-load="shouldLoadImage" auto-sizes />
</template>

View file

@ -1,22 +1,28 @@
<script setup lang="ts">
defineProps<{
label: string
label?: string
hover?: boolean
iconChecked?: string
iconUnchecked?: string
checkedIconColor?: string
prependCheckbox?: boolean
}>()
const { modelValue } = defineModel<{
modelValue?: boolean
}>()
const modelValue = defineModel<boolean | null>()
</script>
<template>
<label
class="common-checkbox flex items-center cursor-pointer py-1 text-md w-full gap-y-1"
:class="hover ? 'hover:bg-active ms--2 px-4 py-2' : null"
v-bind="$attrs"
@click.prevent="modelValue = !modelValue"
>
<span flex-1 ms-2 pointer-events-none>{{ label }}</span>
<span v-if="label && !prependCheckbox" flex-1 ms-2 pointer-events-none>{{ label }}</span>
<span
:class="modelValue ? 'i-ri:checkbox-line' : 'i-ri:checkbox-blank-line'"
:class="[
modelValue ? (iconChecked ?? 'i-ri:checkbox-line') : (iconUnchecked ?? 'i-ri:checkbox-blank-line'),
modelValue && checkedIconColor,
]"
text-lg
aria-hidden="true"
/>
@ -25,6 +31,7 @@ const { modelValue } = defineModel<{
type="checkbox"
sr-only
>
<span v-if="label && prependCheckbox" flex-1 ms-2 pointer-events-none>{{ label }}</span>
</label>
</template>

View file

@ -14,10 +14,7 @@ const props = withDefaults(defineProps<Props>(), {
stencilSizePercentage: 0.9,
})
const { modelValue: file } = defineModel<{
/** Images to be cropped */
modelValue: File | null
}>()
const file = defineModel<File | null>()
const cropperDialog = ref(false)
@ -30,7 +27,7 @@ const cropperImage = reactive({
type: 'image/jpg',
})
const stencilSize = ({ boundaries }: { boundaries: Boundaries }) => {
function stencilSize({ boundaries }: { boundaries: Boundaries }) {
return {
width: boundaries.width * props.stencilSizePercentage,
height: boundaries.height * props.stencilSizePercentage,
@ -55,7 +52,7 @@ watch(file, (file, _, onCleanup) => {
cropperFlag.value = false
})
const cropImage = () => {
function cropImage() {
if (cropper.value && file.value) {
cropperFlag.value = true
cropperDialog.value = false

View file

@ -22,9 +22,7 @@ const emit = defineEmits<{
(event: 'error', code: number, message: string): void
}>()
const { modelValue: file } = defineModel<{
modelValue: FileWithHandle | null
}>()
const file = defineModel<FileWithHandle | null>()
const { t } = useI18n()
@ -34,8 +32,8 @@ const previewImage = ref('')
/** The current images on display */
const imageSrc = computed<string>(() => previewImage.value || defaultImage.value)
const pickImage = async () => {
if (process.server)
async function pickImage() {
if (import.meta.server)
return
const image = await fileOpen({
description: 'Image',

View file

@ -2,50 +2,51 @@
// @ts-expect-error missing types
import { DynamicScroller } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
import type { Paginator, WsEvents } from 'masto'
import type { mastodon } from 'masto'
import type { UnwrapRef } from 'vue'
const {
paginator,
stream,
eventType,
keyProp = 'id',
virtualScroller = false,
eventType = 'update',
preprocess,
noEndMessage = false,
endMessage = true,
} = defineProps<{
paginator: Paginator<T[], O>
paginator: mastodon.Paginator<T[], O>
keyProp?: keyof T
virtualScroller?: boolean
stream?: Promise<WsEvents>
eventType?: 'notification' | 'update'
stream?: mastodon.streaming.Subscription
eventType?: 'update' | 'notification'
preprocess?: (items: (U | T)[]) => U[]
noEndMessage?: boolean
endMessage?: boolean | string
}>()
defineSlots<{
default: {
default: (props: {
items: U[]
item: U
index: number
active?: boolean
older?: U
newer?: U // newer is undefined when index === 0
}
items: {
items: U[]
}
updater: {
older: U
newer: U // newer is undefined when index === 0
}) => void
items: (props: {
items: UnwrapRef<U[]>
}) => void
updater: (props: {
number: number
update: () => void
}
loading: {}
done: {}
}) => void
loading: (props: object) => void
done: (props: { items: U[] }) => void
}>()
const { t } = useI18n()
const nuxtApp = useNuxtApp()
const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess)
const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, toRef(() => stream), eventType, preprocess)
nuxtApp.hook('elk-logo:click', () => {
update()
@ -83,25 +84,25 @@ defineExpose({ createEntry, removeEntry, updateEntry })
page-mode
>
<slot
:key="item[keyProp]"
v-bind="{ key: item[keyProp] }"
:item="item"
:active="active"
:older="items[index + 1]"
:newer="items[index - 1]"
:older="items[index + 1] as U"
:newer="items[index - 1] as U"
:index="index"
:items="items"
:items="items as U[]"
/>
</DynamicScroller>
</template>
<template v-else>
<slot
v-for="item, index of items"
:key="(item as any)[keyProp]"
:item="item"
:older="items[index + 1]"
:newer="items[index - 1]"
v-for="(item, index) of items"
v-bind="{ key: (item as U)[keyProp as keyof U] }"
:item="item as U"
:older="items[index + 1] as U"
:newer="items[index - 1] as U"
:index="index"
:items="items"
:items="items as U[]"
/>
</template>
</slot>
@ -109,9 +110,9 @@ defineExpose({ createEntry, removeEntry, updateEntry })
<slot v-if="state === 'loading'" name="loading">
<TimelineSkeleton />
</slot>
<slot v-else-if="state === 'done' && !noEndMessage" name="done">
<slot v-else-if="state === 'done' && endMessage !== false" name="done" :items="items as U[]">
<div p5 text-secondary italic text-center>
{{ t('common.end_of_list') }}
{{ t(typeof endMessage === 'string' && items.length <= 0 ? endMessage : 'common.end_of_list') }}
</div>
</slot>
<div v-else-if="state === 'error'" p5 text-secondary>

View file

@ -4,9 +4,7 @@ defineProps<{
value: any
hover?: boolean
}>()
const { modelValue } = defineModel<{
modelValue: any
}>()
const modelValue = defineModel()
</script>
<template>

View file

@ -1,26 +1,20 @@
<script setup lang="ts">
import type { RouteLocationRaw } from 'vue-router'
import type { CommonRouteTabMoreOption, CommonRouteTabOption } from '~/types'
export interface CommonRouteTabOption {
to: RouteLocationRaw
display: string
disabled?: boolean
name?: string
icon?: string
}
const { options, command, replace, preventScrollTop = false } = $defineProps<{
const { options, command, replace, preventScrollTop = false, moreOptions } = defineProps<{
options: CommonRouteTabOption[]
moreOptions?: CommonRouteTabMoreOption
command?: boolean
replace?: boolean
preventScrollTop?: boolean
}>()
const { t } = useI18n()
const router = useRouter()
useCommands(() => command
? options.map(tab => ({
scope: 'Tabs',
name: tab.display,
icon: tab.icon ?? 'i-ri:file-list-2-line',
onActivate: () => router.replace(tab.to),
@ -31,7 +25,7 @@ useCommands(() => command
<template>
<div flex w-full items-center lg:text-lg of-x-auto scrollbar-hide border="b base">
<template
v-for="(option, index) in options"
v-for="(option, index) in options.filter(item => !item.hide)"
:key="option?.name || index"
>
<NuxtLink
@ -39,7 +33,7 @@ useCommands(() => command
:to="option.to"
:replace="replace"
relative flex flex-auto cursor-pointer sm:px6 px2 rounded transition-all
tabindex="1"
tabindex="0"
hover:bg-active transition-100
exact-active-class="children:(text-secondary !border-primary !op100 !text-base)"
@click="!preventScrollTop && $scrollToTop()"
@ -50,5 +44,43 @@ useCommands(() => command
<span ws-nowrap mxa sm:px2 sm:py3 py2 text-center text-secondary-light op50>{{ option.display }}</span>
</div>
</template>
<template v-if="isHydrated && moreOptions?.options?.length">
<CommonDropdown placement="bottom" flex cursor-pointer mx-1.25rem>
<CommonTooltip placement="top" no-auto-focus :content="moreOptions.tooltip || t('action.more')">
<button
cursor-pointer
flex
gap-1
w-12
rounded
hover:bg-active
btn-action-icon
op75
px4
group
:aria-label="t('action.more')"
:class="moreOptions.match ? 'text-primary' : 'text-secondary'"
>
<span v-if="moreOptions.icon" :class="moreOptions.icon" text-sm me--1 block />
<span i-ri:arrow-down-s-line text-sm me--1 block />
</button>
</CommonTooltip>
<template #popper>
<NuxtLink
v-for="(option, index) in moreOptions.options.filter(item => !item.hide)"
:key="option?.name || index"
:to="option.to"
>
<CommonDropdownItem>
<span flex="~ row" gap-x-4 items-center :class="option.match ? 'text-primary' : ''">
<span v-if="option.icon" :class="[option.icon, option.match ? 'text-primary' : 'text.secondary']" text-md me--1 block />
<span v-else block>&#160;</span>
<span>{{ option.display }}</span>
</span>
</CommonDropdownItem>
</NuxtLink>
</template>
</commondropdown>
</template>
</div>
</template>

View file

@ -1,5 +1,9 @@
<script setup lang="ts">
const { as = 'div', active } = defineProps<{ as: any; active: boolean }>()
const { as = 'div', active } = defineProps<{
as: any
active: boolean
}>()
const el = ref()
watch(() => active, (active) => {

View file

@ -8,11 +8,9 @@ const { options, command } = defineProps<{
command?: boolean
}>()
const { modelValue } = defineModel<{
modelValue: string
}>()
const modelValue = defineModel<string>({ required: true })
const tabs = $computed(() => {
const tabs = computed(() => {
return options.map((option) => {
if (typeof option === 'string')
return { name: option, display: option }
@ -21,12 +19,12 @@ const tabs = $computed(() => {
})
})
function toValidName(otpion: string) {
return otpion.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
function toValidName(option: string) {
return option.toLowerCase().replace(/[^a-zA-Z0-9]/g, '-')
}
useCommands(() => command
? tabs.map(tab => ({
? tabs.value.map(tab => ({
scope: 'Tabs',
name: tab.display,
@ -51,7 +49,7 @@ useCommands(() => command
><label
flex flex-auto cursor-pointer px3 m1 rounded transition-all
:for="`tab-${toValidName(option.name)}`"
tabindex="1"
tabindex="0"
hover:bg-active transition-100
@keypress.enter="modelValue = option.name"
><span

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import type { Popper as VTooltipType } from 'floating-vue/dist'
import type { Popper as VTooltipType } from 'floating-vue'
export interface Props extends Partial<typeof VTooltipType> {
content?: string
@ -10,6 +10,7 @@ defineProps<Props>()
<template>
<VTooltip
v-if="isHydrated"
v-bind="$attrs"
auto-hide
>

View file

@ -4,20 +4,20 @@ import type { mastodon } from 'masto'
const {
history,
maxDay = 2,
} = $defineProps<{
} = defineProps<{
history: mastodon.v1.TagHistory[]
maxDay?: number
}>()
const ongoingHot = $computed(() => history.slice(0, maxDay))
const ongoingHot = computed(() => history.slice(0, maxDay))
const people = $computed(() =>
ongoingHot.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
const people = computed(() =>
ongoingHot.value.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
)
</script>
<template>
<p>
{{ $t('command.n-people-in-the-past-n-days', [people, maxDay]) }}
{{ $t('command.n_people_in_the_past_n_days', [people, maxDay]) }}
</p>
</template>

View file

@ -6,22 +6,22 @@ const {
history,
width = 60,
height = 40,
} = $defineProps<{
} = defineProps<{
history?: mastodon.v1.TagHistory[]
width?: number
height?: number
}>()
const historyNum = $computed(() => {
const historyNum = computed(() => {
if (!history)
return [1, 1, 1, 1, 1, 1, 1]
return [...history].reverse().map(item => Number(item.accounts) || 0)
})
const sparklineEl = $ref<SVGSVGElement>()
const sparklineEl = ref<SVGSVGElement>()
const sparklineFn = typeof sparkline !== 'function' ? (sparkline as any).default : sparkline
watch([$$(historyNum), $$(sparklineEl)], ([historyNum, sparklineEl]) => {
watch([historyNum, sparklineEl], ([historyNum, sparklineEl]) => {
if (!sparklineEl)
return
sparklineFn(sparklineEl, historyNum)

View file

@ -1,18 +1,18 @@
<script setup lang="ts">
defineOptions({
inheritAttrs: false,
})
const props = defineProps<{
count: number
keypath: string
}>()
defineOptions({
inheritAttrs: false,
})
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(props.count))
const rawNumber = computed(() => formatNumber(props.count))
const humanReadableNumber = computed(() => formatHumanReadableNumber(props.count))
</script>
<template>

View file

@ -6,10 +6,12 @@ defineProps<{
autoBoundaryMaxSize?: boolean
}>()
const dropdown = $ref<any>()
const dropdown = ref<any>()
const colorMode = useColorMode()
const hide = () => dropdown.hide()
function hide() {
return dropdown.value.hide()
}
provide(InjectionKeyDropdownContext, {
hide,
})

View file

@ -15,7 +15,7 @@ const { hide } = useDropdownContext() || {}
const el = ref<HTMLDivElement>()
const handleClick = (evt: MouseEvent) => {
function handleClick(evt: MouseEvent) {
hide?.()
emit('click', evt)
}

View file

@ -4,7 +4,7 @@ const props = defineProps<{
lang?: string
}>()
const raw = $computed(() => decodeURIComponent(props.code).replace(/&#39;/g, '\''))
const raw = computed(() => decodeURIComponent(props.code).replace(/&#39;/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, (langMap[props.lang] || props.lang) as any) : raw
return props.lang ? highlightCode(raw.value, (langMap[props.lang] || props.lang) as any) : raw
})
</script>

View file

@ -5,7 +5,7 @@ const { conversation } = defineProps<{
conversation: mastodon.v1.Conversation
}>()
const withAccounts = $computed(() =>
const withAccounts = computed(() =>
conversation.accounts.filter(account => account.id !== conversation.lastStatus?.account.id),
)
</script>

View file

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

View file

@ -0,0 +1,30 @@
<script setup lang="ts">
const { as, alt, dataEmojiId } = defineProps<{
as: string
alt?: string
dataEmojiId?: string
}>()
const title = ref<string | undefined>()
if (alt) {
if (alt.startsWith(':')) {
title.value = alt.replace(/:/g, '')
}
else {
import('node-emoji').then(({ find }) => {
title.value = find(alt)?.key.replace(/_/g, ' ')
})
}
}
// if it has a data-emoji-id, use that as the title instead
if (dataEmojiId)
title.value = dataEmojiId
</script>
<template>
<component :is="as" v-bind="$attrs" :alt="alt" :data-emoji-id="dataEmojiId" :title="title">
<slot />
</component>
</template>

View file

@ -2,12 +2,14 @@
const emit = defineEmits<{
(event: 'close'): void
}>()
const vAutoFocus = (el: HTMLElement) => el.focus()
</script>
<template>
<div my-8 px-3 sm:px-8 md:max-w-200 flex="~ col gap-4" relative>
<button btn-action-icon absolute top--8 right-0 m1 aria-label="Close" @click="emit('close')">
<div i-ri:close-line />
<button v-auto-focus type="button" btn-action-icon absolute top--8 right-0 m1 aria-label="Close" @click="emit('close')">
<span i-ri:close-line />
</button>
<img :alt="$t('app_logo')" :src="`/${''}logo.svg`" w-20 h-20 height="80" width="80" mxa class="rtl-flip">
@ -28,10 +30,12 @@ const emit = defineEmits<{
</NuxtLink>
{{ $t('help.desc_para6') }}
</p>
{{ $t('help.desc_para3') }}
<p flex="~ gap-2 wrap" mxa>
<NuxtLink hover:text-primary href="https://github.com/sponsors/elk-zone" target="_blank">
{{ $t('help.desc_para3') }}
</NuxtLink>
<p flex="~ gap-2 wrap justify-center" mxa>
<template v-for="team of elkTeamMembers" :key="team.github">
<NuxtLink :href="`https://github.com/sponsors/${team.github}`" target="_blank" external rounded-full transition duration-300 border="~ transparent" hover="scale-105 border-primary">
<NuxtLink :href="team.link" target="_blank" external rounded-full transition duration-300 border="~ transparent" hover="scale-105 border-primary">
<img :src="`/avatars/${team.github}-100x100.png`" :alt="team.display" rounded-full w-15 h-15 height="60" width="60">
</NuxtLink>
</template>
@ -42,7 +46,7 @@ const emit = defineEmits<{
</NuxtLink>
</p>
<button btn-solid mxa tabindex="2" @click="emit('close')">
<button type="button" btn-solid mxa @click="emit('close')">
{{ $t('action.enter_app') }}
</button>
</div>

View file

@ -16,8 +16,8 @@ const isRemoved = ref(false)
async function edit() {
try {
isRemoved.value
? await client.v1.lists.addAccount(list, { accountIds: [account.id] })
: await client.v1.lists.removeAccount(list, { accountIds: [account.id] })
? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
: await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
isRemoved.value = !isRemoved.value
}
catch (err) {

View file

@ -6,9 +6,7 @@ const emit = defineEmits<{
(e: 'listUpdated', list: mastodon.v1.List): void
(e: 'listRemoved', id: string): void
}>()
const { list } = defineModel<{
list: mastodon.v1.List
}>()
const list = defineModel<mastodon.v1.List>({ required: true })
const { t } = useI18n()
const client = useMastoClient()
@ -17,23 +15,23 @@ const { form, isDirty, submitter, reset } = useForm({
form: () => ({ ...list.value }),
})
let isEditing = $ref<boolean>(false)
let deleting = $ref<boolean>(false)
let actionError = $ref<string | undefined>(undefined)
const isEditing = ref<boolean>(false)
const deleting = ref<boolean>(false)
const actionError = ref<string | undefined>(undefined)
const input = ref<HTMLInputElement>()
const editBtn = ref<HTMLButtonElement>()
const deleteBtn = ref<HTMLButtonElement>()
const prepareEdit = async () => {
isEditing = true
actionError = undefined
async function prepareEdit() {
isEditing.value = true
actionError.value = undefined
await nextTick()
input.value?.focus()
}
const cancelEdit = async () => {
isEditing = false
actionError = undefined
async function cancelEdit() {
isEditing.value = false
actionError.value = undefined
reset()
await nextTick()
@ -42,58 +40,59 @@ const cancelEdit = async () => {
const { submit, submitting } = submitter(async () => {
try {
list.value = await client.v1.lists.update(form.id, {
list.value = await client.v1.lists.$select(form.id).update({
title: form.title,
})
cancelEdit()
}
catch (err) {
console.error(err)
actionError = (err as Error).message
actionError.value = (err as Error).message
await nextTick()
input.value?.focus()
}
})
async function removeList() {
if (deleting)
if (deleting.value)
return
const confirmDelete = await openConfirmDialog({
title: t('confirm.delete_list.title', [list.value.title]),
title: t('confirm.delete_list.title'),
description: t('confirm.delete_list.description', [list.value.title]),
confirm: t('confirm.delete_list.confirm'),
cancel: t('confirm.delete_list.cancel'),
})
deleting = true
actionError = undefined
deleting.value = true
actionError.value = undefined
await nextTick()
if (confirmDelete === 'confirm') {
if (confirmDelete.choice === 'confirm') {
await nextTick()
try {
await client.v1.lists.remove(list.value.id)
await client.v1.lists.$select(list.value.id).remove()
emit('listRemoved', list.value.id)
}
catch (err) {
console.error(err)
actionError = (err as Error).message
actionError.value = (err as Error).message
await nextTick()
deleteBtn.value?.focus()
}
finally {
deleting = false
deleting.value = false
}
}
else {
deleting = false
deleting.value = false
}
}
async function clearError() {
actionError = undefined
actionError.value = undefined
await nextTick()
if (isEditing)
if (isEditing.value)
input.value?.focus()
else
deleteBtn.value?.focus()

View file

@ -3,9 +3,9 @@ const { userId } = defineProps<{
userId: string
}>()
const { client } = $(useMasto())
const paginator = client.v1.lists.list()
const listsWithUser = ref((await client.v1.accounts.listLists(userId)).map(list => list.id))
const { client } = useMasto()
const paginator = client.value.v1.lists.list()
const listsWithUser = ref((await client.value.v1.accounts.$select(userId).lists.list()).map(list => list.id))
function indexOfUserInList(listId: string) {
return listsWithUser.value.indexOf(listId)
@ -15,11 +15,11 @@ async function edit(listId: string) {
try {
const index = indexOfUserInList(listId)
if (index === -1) {
await client.v1.lists.addAccount(listId, { accountIds: [userId] })
await client.value.v1.lists.$select(listId).accounts.create({ accountIds: [userId] })
listsWithUser.value.push(listId)
}
else {
await client.v1.lists.removeAccount(listId, { accountIds: [userId] })
await client.value.v1.lists.$select(listId).accounts.remove({ accountIds: [userId] })
listsWithUser.value = listsWithUser.value.filter(id => id !== listId)
}
}
@ -30,7 +30,7 @@ async function edit(listId: string) {
</script>
<template>
<CommonPaginator no-end-message :paginator="paginator">
<CommonPaginator :end-message="false" :paginator="paginator">
<template #default="{ item }">
<div p4 hover:bg-active block w="100%" flex justify-between items-center gap-4>
<p>{{ item.title }}</p>

View file

@ -21,7 +21,10 @@ interface ShortcutItemGroup {
items: ShortcutItem[]
}
const shortcutItemGroups: ShortcutItemGroup[] = [
const isMac = useIsMac()
const modifierKeyName = computed(() => isMac.value ? '⌘' : 'Ctrl')
const shortcutItemGroups = computed<ShortcutItemGroup[]>(() => [
{
name: t('magic_keys.groups.navigation.title'),
items: [
@ -37,6 +40,10 @@ const shortcutItemGroups: ShortcutItemGroup[] = [
// description: t('magic_keys.groups.navigation.previous_status'),
// shortcut: { keys: ['k'], isSequence: false },
// },
{
description: t('magic_keys.groups.navigation.go_to_search'),
shortcut: { keys: ['/'], isSequence: false },
},
{
description: t('magic_keys.groups.navigation.go_to_home'),
shortcut: { keys: ['g', 'h'], isSequence: true },
@ -45,19 +52,63 @@ const shortcutItemGroups: ShortcutItemGroup[] = [
description: t('magic_keys.groups.navigation.go_to_notifications'),
shortcut: { keys: ['g', 'n'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_conversations'),
shortcut: { keys: ['g', 'c'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_favourites'),
shortcut: { keys: ['g', 'f'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_bookmarks'),
shortcut: { keys: ['g', 'b'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_explore'),
shortcut: { keys: ['g', 'e'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_local'),
shortcut: { keys: ['g', 'l'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_federated'),
shortcut: { keys: ['g', 't'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_lists'),
shortcut: { keys: ['g', 'i'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_settings'),
shortcut: { keys: ['g', 's'], isSequence: true },
},
{
description: t('magic_keys.groups.navigation.go_to_profile'),
shortcut: { keys: ['g', 'p'], isSequence: true },
},
],
},
{
name: t('magic_keys.groups.actions.title'),
items: [
{
description: t('magic_keys.groups.actions.search'),
shortcut: { keys: [modifierKeyName.value, 'k'], isSequence: false },
},
{
description: t('magic_keys.groups.actions.command_mode'),
shortcut: { keys: ['cmd', '/'], isSequence: false },
shortcut: { keys: [modifierKeyName.value, '/'], isSequence: false },
},
{
description: t('magic_keys.groups.actions.compose'),
shortcut: { keys: ['c'], isSequence: false },
},
{
description: t('magic_keys.groups.actions.show_new_items'),
shortcut: { keys: ['.'], isSequence: false },
},
{
description: t('magic_keys.groups.actions.favourite'),
shortcut: { keys: ['f'], isSequence: false },
@ -66,17 +117,13 @@ const shortcutItemGroups: ShortcutItemGroup[] = [
description: t('magic_keys.groups.actions.boost'),
shortcut: { keys: ['b'], isSequence: false },
},
{
description: t('magic_keys.groups.actions.zen_mode'),
shortcut: { keys: ['z'], isSequence: false },
},
],
},
{
name: t('magic_keys.groups.media.title'),
items: [],
},
]
])
</script>
<template>

View file

@ -8,17 +8,32 @@ defineProps<{
noOverflowHidden?: boolean
}>()
const container = ref()
const route = useRoute()
const userSettings = useUserSettings()
const { height: windowHeight } = useWindowSize()
const { height: containerHeight } = useElementBounding(container)
const wideLayout = computed(() => route.meta.wideLayout ?? false)
const sticky = computed(() => route.path?.startsWith('/settings/'))
const containerClass = computed(() => {
// we keep original behavior when not in settings page and when the window height is smaller than the container height
if (!isHydrated.value || !sticky.value || (windowHeight.value < containerHeight.value))
return null
return 'lg:sticky lg:top-0'
})
</script>
<template>
<div>
<div ref="container" :class="containerClass">
<div
sticky top-0 z10 backdrop-blur
sticky top-0 z10
pt="[env(safe-area-inset-top,0)]"
bg="[rgba(var(--rgb-bg-base),0.7)]"
class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]"
:class="{
'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>
@ -29,24 +44,25 @@ const wideLayout = computed(() => route.meta.wideLayout ?? false)
>
<div i-ri:arrow-left-line class="rtl-flip" />
</NuxtLink>
<div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-center native-mac:text-center native-mac:sm:justify-start">
<div :truncate="!noOverflowHidden ? '' : false" flex w-full data-tauri-drag-region class="native-mac:justify-start native-mac:text-center">
<slot name="title" />
</div>
<div sm:hidden h-7 w-1px />
</div>
<div flex items-center flex-shrink-0 gap-x-2>
<slot name="actions" />
<PwaBadge lg:hidden />
<PwaBadge xl:hidden />
<NavUser v-if="isHydrated" />
<NavUserSkeleton v-else />
</div>
</div>
<slot name="header">
<div hidden :class="{ 'xl:block': $route.name !== 'tag' }" h-6 />
<div hidden />
</slot>
</div>
<PwaInstallPrompt lg:hidden />
<PwaInstallPrompt xl:hidden />
<div :class="isHydrated && wideLayout ? 'xl:w-full sm:max-w-600px' : 'sm:max-w-600px md:shrink-0'" m-auto>
<div hidden :class="{ 'xl:block': $route.name !== 'tag' && !$slots.header }" h-6 />
<slot />
</div>
</div>

View file

@ -0,0 +1,45 @@
<script setup lang="ts">
const model = defineModel<number>()
const isValid = defineModel<boolean>('isValid')
const days = ref<number | ''>(0)
const hours = ref<number | ''>(1)
const minutes = ref<number | ''>(0)
watchEffect(() => {
if (days.value === '' || hours.value === '' || minutes.value === '') {
isValid.value = false
return
}
const duration
= days.value * 24 * 60 * 60
+ hours.value * 60 * 60
+ minutes.value * 60
if (duration <= 0) {
isValid.value = false
return
}
isValid.value = true
model.value = duration
})
</script>
<template>
<div flex flex-grow-0 gap-2>
<label flex items-center gap-2>
<input v-model="days" type="number" min="0" max="1999" input-base :class="!isValid ? 'input-error' : null">
{{ $t('confirm.mute_account.days', days === '' ? 0 : days) }}
</label>
<label flex items-center gap-2>
<input v-model="hours" type="number" min="0" max="24" input-base :class="!isValid ? 'input-error' : null">
{{ $t('confirm.mute_account.hours', hours === '' ? 0 : hours) }}
</label>
<label flex items-center gap-2>
<input v-model="minutes" type="number" min="0" max="59" step="5" input-base :class="!isValid ? 'input-error' : null">
{{ $t('confirm.mute_account.minute', minutes === '' ? 0 : minutes) }}
</label>
</div>
</template>

View file

@ -1,26 +1,55 @@
<script setup lang="ts">
import type { ConfirmDialogChoice, ConfirmDialogLabel } from '~/types'
import type { ConfirmDialogChoice, ConfirmDialogOptions } from '~/types'
import DurationPicker from '~/components/modal/DurationPicker.vue'
defineProps<ConfirmDialogLabel>()
const props = defineProps<ConfirmDialogOptions>()
const emit = defineEmits<{
(evt: 'choice', choice: ConfirmDialogChoice): void
}>()
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')
function handleChoice(choice: ConfirmDialogChoice['choice']) {
const dialogChoice = {
choice,
...isMute.value && {
extraOptions: {
mute: {
duration: hasDuration.value ? duration.value : 0,
notifications: shouldMuteNotifications.value,
},
},
},
}
emit('choice', dialogChoice)
}
</script>
<template>
<div flex="~ col" gap-6>
<div font-bold text-lg text-center>
<div font-bold text-lg>
{{ title }}
</div>
<div v-if="description">
{{ description }}
</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" />
<CommonCheckbox v-model="shouldMuteNotifications" :label="$t('confirm.mute_account.notifications')" prepend-checkbox checked-icon-color="text-primary" />
</div>
<div flex justify-end gap-2>
<button btn-text @click="emit('choice', 'cancel')">
<button btn-text @click="handleChoice('cancel')">
{{ cancel || $t('confirm.common.cancel') }}
</button>
<button btn-solid @click="emit('choice', 'confirm')">
<button btn-solid :disabled="!isValidDuration" @click="handleChoice('confirm')">
{{ confirm || $t('confirm.common.confirm') }}
</button>
</div>

View file

@ -11,6 +11,7 @@ import {
isMediaPreviewOpen,
isPreviewHelpOpen,
isPublishDialogOpen,
isReportDialogOpen,
isSigninDialogOpen,
} from '~/composables/dialog'
@ -33,21 +34,21 @@ useEventListener('keydown', (e: KeyboardEvent) => {
}
})
const handlePublished = (status: mastodon.v1.Status) => {
function handlePublished(status: mastodon.v1.Status) {
lastPublishDialogStatus.value = status
isPublishDialogOpen.value = false
}
const handlePublishClose = () => {
function handlePublishClose() {
lastPublishDialogStatus.value = null
}
const handleConfirmChoice = (choice: ConfirmDialogChoice) => {
function handleConfirmChoice(choice: ConfirmDialogChoice) {
confirmDialogChoice.value = choice
isConfirmDialogOpen.value = false
}
const handleFavouritedBoostedByClose = () => {
function handleFavouritedBoostedByClose() {
isFavouritedBoostedByDialogOpen.value = false
}
</script>
@ -102,5 +103,8 @@ const handleFavouritedBoostedByClose = () => {
<ModalDialog v-model="isKeyboardShortcutsDialogOpen" max-w-full sm:max-w-140 md:max-w-170 lg:max-w-220 md:min-w-160>
<MagickeysKeyboardShortcuts @close="closeKeyboardShortcuts()" />
</ModalDialog>
<ModalDialog v-model="isReportDialogOpen" keep-alive max-w-175>
<ReportModal v-if="reportAccount" :account="reportAccount" :status="reportStatus" @close="closeReportDialog()" />
</ModalDialog>
</template>
</template>

View file

@ -36,6 +36,10 @@ export interface Props {
dialogLabelledBy?: string
}
defineOptions({
inheritAttrs: false,
})
const props = withDefaults(defineProps<Props>(), {
zIndex: 100,
closeByMask: true,
@ -45,20 +49,14 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits<{
/** v-model dialog visibility */
(event: 'close',): void
(event: 'close'): void
}>()
const { modelValue: visible } = defineModel<{
/** v-model dislog visibility */
modelValue: boolean
}>()
defineOptions({
inheritAttrs: false,
})
const visible = defineModel<boolean>({ required: true })
const deactivated = useDeactivated()
const route = useRoute()
const userSettings = useUserSettings()
/** scrollable HTML element */
const elDialogMain = ref<HTMLDivElement>()
@ -80,6 +78,8 @@ defineExpose({
/** close the dialog */
function close() {
if (!visible.value)
return
visible.value = false
emit('close')
}
@ -119,9 +119,11 @@ const isVShow = computed(() => {
: true
})
const bindTypeToAny = ($attrs: any) => $attrs as any
function bindTypeToAny($attrs: any) {
return $attrs as any
}
const trapFocusDialog = () => {
function trapFocusDialog() {
if (isVShow.value)
nextTick().then(() => activate())
}
@ -155,7 +157,13 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<!-- corresponding to issue: #106, so please don't remove it. -->
<!-- Mask layer: blur -->
<div class="dialog-mask" absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter backdrop-blur-sm touch-none />
<div
class="dialog-mask"
:class="{
'backdrop-blur-sm': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter touch-none
/>
<!-- Mask layer: dimming -->
<div class="dialog-mask" absolute inset-0 z-0 bg-black opacity-48 touch-none h="[calc(100%+0.5px)]" @click="clickMask" />
<!-- Dialog container -->

View file

@ -37,7 +37,7 @@ onUnmounted(() => locked.value = false)
</script>
<template>
<div relative h-full w-full flex pt-12 w-100vh @click="onClick">
<div relative h-full w-full flex pt-12 @click="onClick">
<button
v-if="hasNext" pointer-events-auto btn-action-icon bg="black/20" :aria-label="$t('action.previous')"
hover:bg="black/40" dark:bg="white/30" dark-hover:bg="white/20" absolute top="1/2" right-1 z5
@ -53,21 +53,19 @@ onUnmounted(() => locked.value = false)
<div i-ri:arrow-left-s-line text-white />
</button>
<div flex flex-row items-center mxa>
<div flex="~ col center" max-h-full max-w-full>
<ModalMediaPreviewCarousel v-model="index" :media="mediaPreviewList" @close="emit('close')" />
<div flex="~ col center" h-full w-full>
<ModalMediaPreviewCarousel v-model="index" :media="mediaPreviewList" @close="emit('close')" />
<div bg="black/30" dark:bg="white/10" ms-4 mb-6 mt-4 text-white rounded-full flex="~ center shrink-0" overflow-hidden>
<div v-if="mediaPreviewList.length > 1" p="y-1 x-3" rounded-r-0 shrink-0>
{{ index + 1 }} / {{ mediaPreviewList.length }}
</div>
<p
v-if="current.description" bg="dark/30" dark:bg="white/10" p="y-1 x-3" rounded-ie-full line-clamp-1
ws-pre-wrap break-all :title="current.description" w-full
>
{{ current.description }}
</p>
<div bg="black/30" dark:bg="white/10" mb-6 mt-4 text-white rounded-full flex="~ center shrink-0" overflow-hidden>
<div v-if="mediaPreviewList.length > 1" p="y-1 x-3" rounded-r-0 shrink-0>
{{ index + 1 }} / {{ mediaPreviewList.length }}
</div>
<p
v-if="current.description" bg="dark/30" dark:bg="white/10" p="y-1 x-3" rounded-ie-full line-clamp-1
ws-pre-wrap break-all :title="current.description" w-full
>
{{ current.description }}
</p>
</div>
</div>

View file

@ -1,105 +1,285 @@
<script setup lang="ts">
import { SwipeDirection } from '@vueuse/core'
import type { Vector2 } from '@vueuse/gesture'
import { useGesture } from '@vueuse/gesture'
import type { PermissiveMotionProperties } from '@vueuse/motion'
import { useReducedMotion } from '@vueuse/motion'
import type { mastodon } from 'masto'
const { media = [], threshold = 20 } = defineProps<{
const { media = [] } = defineProps<{
media?: mastodon.v1.MediaAttachment[]
threshold?: number
}>()
const emit = defineEmits<{
(event: 'close'): void
}>()
const { modelValue } = defineModel<{
modelValue: number
}>()
const modelValue = defineModel<number>({ required: true })
const target = ref()
const slideGap = 20
const doubleTapThreshold = 250
const animateTimeout = useTimeout(10)
const reduceMotion = process.server ? ref(false) : useReducedMotion()
const view = ref()
const slider = ref()
const slide = ref()
const image = ref()
const canAnimate = computed(() => !reduceMotion.value && animateTimeout.value)
const reduceMotion = import.meta.server ? ref(false) : useReducedMotion()
const isInitialScrollDone = useTimeout(350)
const canAnimate = computed(() => isInitialScrollDone.value && !reduceMotion.value)
const { motionProperties } = useMotionProperties(target, {
cursor: 'grab',
scale: 1,
x: 0,
y: 0,
})
const { set } = useSpring(motionProperties as Partial<PermissiveMotionProperties>)
const scale = ref(1)
const x = ref(0)
const y = ref(0)
function resetZoom() {
set({ scale: 1 })
const isDragging = ref(false)
const isPinching = ref(false)
const maxZoomOut = ref(1)
const isZoomedIn = computed(() => scale.value > 1)
const enableAutoplay = usePreferences('enableAutoplay')
function goToFocusedSlide() {
scale.value = 1
x.value = slide.value[modelValue.value].offsetLeft * scale.value
y.value = 0
}
watch(modelValue, resetZoom)
onMounted(() => {
const slideGapAsScale = slideGap / view.value.clientWidth
maxZoomOut.value = 1 - slideGapAsScale
const { width, height } = useElementSize(target)
const { isSwiping, lengthX, lengthY, direction } = useSwipe(target, {
threshold: 5,
passive: false,
onSwipeEnd(e, direction) {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (direction === SwipeDirection.RIGHT && Math.abs(distanceX.value) > threshold) {
modelValue.value = Math.max(0, modelValue.value - 1)
resetZoom()
}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (direction === SwipeDirection.LEFT && Math.abs(distanceX.value) > threshold) {
modelValue.value = Math.min(media.length - 1, modelValue.value + 1)
resetZoom()
}
// eslint-disable-next-line @typescript-eslint/no-use-before-define
if (direction === SwipeDirection.UP && Math.abs(distanceY.value) > threshold)
emit('close')
},
goToFocusedSlide()
})
watch(modelValue, goToFocusedSlide)
let lastOrigin = [0, 0]
let initialScale = 0
useGesture({
onPinch({ offset: [distance, _angle] }) {
set({ scale: Math.max(0.5, 1 + distance / 200) })
onPinch({ first, initial: [initialDistance], movement: [deltaDistance], da: [distance], origin, touches }) {
isPinching.value = true
if (first) {
initialScale = scale.value
}
else {
if (touches === 0)
handleMouseWheelZoom(initialScale, deltaDistance, origin)
else
handlePinchZoom(initialScale, initialDistance, distance, origin)
}
lastOrigin = origin
},
onMove({ movement: [x, y], dragging, pinching }) {
if (dragging && !pinching)
set({ x, y })
onPinchEnd() {
isPinching.value = false
isDragging.value = false
if (!isZoomedIn.value)
goToFocusedSlide()
},
onDrag({ movement, delta, pinching, tap, last, swipe, event, xy }) {
event.preventDefault()
if (pinching)
return
if (last)
handleLastDrag(tap, swipe, movement, xy)
else
handleDrag(delta, movement)
},
}, {
domTarget: target,
domTarget: view,
eventOptions: {
passive: true,
passive: false,
},
})
const distanceX = computed(() => {
if (width.value === 0)
return 0
const shiftRestrictions = computed(() => {
const focusedImage = image.value[modelValue.value]
const focusedSlide = slide.value[modelValue.value]
if (!isSwiping.value || (direction.value !== SwipeDirection.LEFT && direction.value !== SwipeDirection.RIGHT))
return modelValue.value * 100 * -1
const scaledImageWidth = focusedImage.offsetWidth * scale.value
const scaledHorizontalOverflow = scaledImageWidth / 2 - view.value.clientWidth / 2 + slideGap
const horizontalOverflow = Math.max(0, scaledHorizontalOverflow / scale.value)
return (lengthX.value / width.value) * 100 * -1 + (modelValue.value * 100) * -1
const scaledImageHeight = focusedImage.offsetHeight * scale.value
const scaledVerticalOverflow = scaledImageHeight / 2 - view.value.clientHeight / 2 + slideGap
const verticalOverflow = Math.max(0, scaledVerticalOverflow / scale.value)
return {
left: focusedSlide.offsetLeft - horizontalOverflow,
right: focusedSlide.offsetLeft + horizontalOverflow,
top: focusedSlide.offsetTop - verticalOverflow,
bottom: focusedSlide.offsetTop + verticalOverflow,
}
})
const distanceY = computed(() => {
if (height.value === 0 || !isSwiping.value || direction.value !== SwipeDirection.UP)
return 0
function handlePinchZoom(initialScale: number, initialDistance: number, distance: number, [originX, originY]: Vector2) {
scale.value = initialScale * (distance / initialDistance)
scale.value = Math.max(maxZoomOut.value, scale.value)
return (lengthY.value / height.value) * 100 * -1
const deltaCenterX = originX - lastOrigin[0]
const deltaCenterY = originY - lastOrigin[1]
handleZoomDrag([deltaCenterX, deltaCenterY])
}
function handleMouseWheelZoom(initialScale: number, deltaDistance: number, [originX, originY]: Vector2) {
scale.value = initialScale + (deltaDistance / 1000)
scale.value = Math.max(maxZoomOut.value, scale.value)
const deltaCenterX = lastOrigin[0] - originX
const deltaCenterY = lastOrigin[1] - originY
handleZoomDrag([deltaCenterX, deltaCenterY])
}
function handleLastDrag(tap: boolean, swipe: Vector2, movement: Vector2, position: Vector2) {
isDragging.value = false
if (tap)
handleTap(position)
else if (swipe[0] || swipe[1])
handleSwipe(swipe, movement)
else if (!isZoomedIn.value)
slideToClosestSlide()
}
let lastTapAt = 0
function handleTap([positionX, positionY]: Vector2) {
const now = Date.now()
const isDoubleTap = now - lastTapAt < doubleTapThreshold
lastTapAt = now
if (!isDoubleTap)
return
if (isZoomedIn.value) {
goToFocusedSlide()
}
else {
const focusedSlideBounding = slide.value[modelValue.value].getBoundingClientRect()
const slideCenterX = focusedSlideBounding.left + focusedSlideBounding.width / 2
const slideCenterY = focusedSlideBounding.top + focusedSlideBounding.height / 2
scale.value = 3
x.value += positionX - slideCenterX
y.value += positionY - slideCenterY
restrictShiftToInsideSlide()
}
}
function handleSwipe([horiz, vert]: Vector2, [movementX, movementY]: Vector2) {
if (isZoomedIn.value || isPinching.value)
return
const isHorizontalDrag = Math.abs(movementX) >= Math.abs(movementY)
if (isHorizontalDrag) {
if (horiz === 1) // left
modelValue.value = Math.max(0, modelValue.value - 1)
if (horiz === -1) // right
modelValue.value = Math.min(media.length - 1, modelValue.value + 1)
}
else if (vert === 1 || vert === -1) {
emit('close')
}
goToFocusedSlide()
}
function slideToClosestSlide() {
const startOfFocusedSlide = slide.value[modelValue.value].offsetLeft * scale.value
const slideWidth = slide.value[modelValue.value].offsetWidth * scale.value
if (x.value > startOfFocusedSlide + slideWidth / 2)
modelValue.value = Math.min(media.length - 1, modelValue.value + 1)
else if (x.value < startOfFocusedSlide - slideWidth / 2)
modelValue.value = Math.max(0, modelValue.value - 1)
goToFocusedSlide()
}
function handleDrag(delta: Vector2, movement: Vector2) {
isDragging.value = true
if (isZoomedIn.value)
handleZoomDrag(delta)
else
handleSlideDrag(movement)
}
function handleZoomDrag([deltaX, deltaY]: Vector2) {
x.value -= deltaX / scale.value
y.value -= deltaY / scale.value
restrictShiftToInsideSlide()
}
function handleSlideDrag([movementX, movementY]: Vector2) {
goToFocusedSlide()
if (Math.abs(movementY) > Math.abs(movementX)) // vertical movement is more than horizontal
y.value -= movementY / scale.value
else
x.value -= movementX / scale.value
if (media.length === 1)
x.value = 0
}
function restrictShiftToInsideSlide() {
x.value = Math.min(shiftRestrictions.value.right, Math.max(shiftRestrictions.value.left, x.value))
y.value = Math.min(shiftRestrictions.value.bottom, Math.max(shiftRestrictions.value.top, y.value))
}
const sliderStyle = computed(() => {
const style = {
transform: `scale(${scale.value}) translate(${-x.value}px, ${-y.value}px)`,
transition: 'none',
gap: `${slideGap}px`,
}
if (canAnimate.value && !isDragging.value && !isPinching.value)
style.transition = 'all 0.3s ease'
return style
})
const imageStyle = computed(() => ({
cursor: isDragging.value ? 'grabbing' : 'grab',
}))
</script>
<template>
<div ref="target" flex flex-row max-h-full max-w-full overflow-hidden>
<div flex :style="{ transform: `translateX(${distanceX}%) translateY(${distanceY}%)`, transition: isSwiping ? 'none' : canAnimate ? 'all 0.5s ease' : 'none' }">
<div v-for="item in media" :key="item.id" p4 select-none w-full flex-shrink-0 flex flex-col place-items-center>
<img max-h-full max-w-full :draggable="false" select-none :src="item.url || item.previewUrl" :alt="item.description || ''">
<div ref="view" flex flex-row h-full w-full overflow-hidden>
<div ref="slider" :style="sliderStyle" w-full h-full flex items-center>
<div
v-for="item in media"
:key="item.id"
ref="slide"
flex-shrink-0
w-full
h-full
flex
items-center
justify-center
>
<component
:is="item.type === 'gifv' ? 'video' : 'img'"
ref="image"
:autoplay="enableAutoplay"
controls
loop
select-none
max-w-full
max-h-full
:style="imageStyle"
:draggable="false"
:src="item.url || item.previewUrl"
:alt="item.description || ''"
/>
</div>
</div>
</div>

View file

@ -1,8 +1,12 @@
<script setup lang="ts">
// only one icon can be lit up at the same time
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
const moreMenuVisible = ref(false)
const { notifications } = useNotifications()
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
</script>
<template>
@ -16,10 +20,10 @@ const { notifications } = useNotifications()
<NuxtLink to="/home" :aria-label="$t('nav.home')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:home-5-line />
</NuxtLink>
<NuxtLink :to="isHydrated ? `/${currentServer}/explore` : '/explore'" :aria-label="$t('nav.explore')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<NuxtLink to="/search" :aria-label="$t('nav.search')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:search-line />
</NuxtLink>
<NuxtLink to="/notifications" :aria-label="$t('nav.notifications')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<NuxtLink :to="`/notifications/${lastAccessedNotificationRoute}`" :aria-label="$t('nav.notifications')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div flex relative>
<div class="i-ri:notification-4-line" text-xl />
<div v-if="notifications" class="top-[-0.3rem] right-[-0.3rem]" absolute font-bold rounded-full h-4 w-4 text-xs bg-primary text-inverted flex items-center justify-center>
@ -32,8 +36,8 @@ const { notifications } = useNotifications()
</NuxtLink>
</template>
<template v-else>
<NuxtLink :to="`/${currentServer}/explore`" :aria-label="$t('nav.explore')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:hashtag />
<NuxtLink :to="`/${currentServer}/explore/${lastAccessedExploreRoute}`" :aria-label="$t('nav.explore')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:compass-3-line />
</NuxtLink>
<NuxtLink group :to="`/${currentServer}/public/local`" :aria-label="$t('nav.local')" :active-class="moreMenuVisible ? '' : 'text-primary'" flex flex-row items-center place-content-center h-full flex-1 class="coarse-pointer:select-none" @click="$scrollToTop">
<div i-ri:group-2-line />
@ -43,14 +47,14 @@ const { notifications } = useNotifications()
</NuxtLink>
</template>
<NavBottomMoreMenu v-slot="{ toggleVisible, show }" v-model="moreMenuVisible" flex flex-row items-center place-content-center h-full flex-1 cursor-pointer>
<label
<button
flex items-center place-content-center h-full flex-1 class="select-none"
:class="show ? '!text-primary' : ''"
aria-label="More menu"
@click="toggleVisible"
>
<input type="checkbox" z="-1" absolute inset-0 opacity-0 @click="toggleVisible">
<span v-show="show" i-ri:close-fill />
<span v-show="!show" i-ri:more-fill />
</label>
<span :class="show ? 'i-ri:close-fill' : 'i-ri:more-fill'" />
</button>
</NavBottomMoreMenu>
</nav>
</template>

View file

@ -1,22 +1,27 @@
<script lang="ts" setup>
let { modelValue } = $defineModel<{
modelValue: boolean
}>()
import { invoke } from '@vueuse/core'
const modelValue = defineModel<boolean>({ required: true })
const colorMode = useColorMode()
const userSettings = useUserSettings()
const drawerEl = ref<HTMLDivElement>()
function toggleVisible() {
modelValue = !modelValue
modelValue.value = !modelValue.value
}
const buttonEl = ref<HTMLDivElement>()
/** Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened */
/**
* Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened
* @param mouse
*/
function clickEvent(mouse: MouseEvent) {
if (mouse.target && !buttonEl.value?.children[0].contains(mouse.target as any)) {
if (modelValue) {
if (modelValue.value) {
document.removeEventListener('click', clickEvent)
modelValue = false
modelValue.value = false
}
}
}
@ -25,7 +30,7 @@ function toggleDark() {
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
}
watch($$(modelValue), (val) => {
watch(modelValue, (val) => {
if (val && typeof document !== 'undefined')
document.addEventListener('click', clickEvent)
})
@ -33,6 +38,80 @@ watch($$(modelValue), (val) => {
onBeforeUnmount(() => {
document.removeEventListener('click', clickEvent)
})
// Pull down to close
const { dragging, dragDistance } = invoke(() => {
const triggerDistance = 120
let scrollTop = 0
let beforeTouchPointY = 0
const dragDistance = ref(0)
const dragging = ref(false)
useEventListener(drawerEl, 'scroll', (e: Event) => {
scrollTop = (e.target as HTMLDivElement).scrollTop
// Prevent the page from scrolling when the drawer is being dragged.
if (dragDistance.value > 0)
(e.target as HTMLDivElement).scrollTop = 0
}, { passive: true })
useEventListener(drawerEl, 'touchstart', (e: TouchEvent) => {
if (!modelValue.value)
return
beforeTouchPointY = e.touches[0].pageY
dragDistance.value = 0
}, { passive: true })
useEventListener(drawerEl, 'touchmove', (e: TouchEvent) => {
if (!modelValue.value)
return
// Do not move the entire drawer when its contents are not scrolled to the top.
if (scrollTop > 0 && dragDistance.value <= 0) {
dragging.value = false
beforeTouchPointY = e.touches[0].pageY
return
}
const { pageY } = e.touches[0]
// Calculate the drag distance.
dragDistance.value += pageY - beforeTouchPointY
if (dragDistance.value < 0)
dragDistance.value = 0
beforeTouchPointY = pageY
// Marked as dragging.
if (dragDistance.value > 1)
dragging.value = true
// Prevent the page from scrolling when the drawer is being dragged.
if (dragDistance.value > 0) {
if (e?.cancelable && e?.preventDefault)
e.preventDefault()
e?.stopPropagation()
}
}, { passive: true })
useEventListener(drawerEl, 'touchend', () => {
if (!modelValue.value)
return
if (dragDistance.value >= triggerDistance)
modelValue.value = false
dragging.value = false
// code
}, { passive: true })
return {
dragDistance,
dragging,
}
})
</script>
<template>
@ -41,12 +120,12 @@ onBeforeUnmount(() => {
<!-- Drawer -->
<Transition
enter-active-class="transition duration-250 ease-out children:(transition duration-250 ease-out)"
enter-from-class="opacity-0 children:(transform translate-y-full)"
enter-to-class="opacity-100 children:(transform translate-y-0)"
leave-active-class="transition duration-250 ease-in children:(transition duration-250 ease-in)"
leave-from-class="opacity-100 children:(transform translate-y-0)"
leave-to-class="opacity-0 children:(transform translate-y-full)"
enter-active-class="transition duration-250 ease-out"
enter-from-class="opacity-0 children:(translate-y-full)"
enter-to-class="opacity-100 children:(translate-y-0)"
leave-active-class="transition duration-250 ease-in"
leave-from-class="opacity-100 children:(translate-y-0)"
leave-to-class="opacity-0 children:(translate-y-full)"
>
<div
v-show="modelValue"
@ -58,10 +137,19 @@ onBeforeUnmount(() => {
<!-- corresponding to issue: #106, so please don't remove it. -->
<div absolute inset-0 opacity-0 h="[calc(100vh+0.5px)]" />
<div
ref="drawerEl"
:style="{
transform: dragging ? `translateY(${dragDistance}px)` : '',
}"
:class="{
'duration-0': dragging,
'duration-250': !dragging,
'backdrop-blur-md': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
transition="transform ease-in"
flex-1 min-w-48 py-6 mb="-1px"
of-y-auto scrollbar-hide overscroll-none max-h="[calc(100vh-200px)]"
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter backdrop-blur-md
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter
border-t-1 border-base
>
<!-- Nav -->
@ -93,9 +181,9 @@ onBeforeUnmount(() => {
transition-colors duration-200 transform
hover="bg-gray-100 dark:(bg-gray-700 text-white)"
:aria-label="$t('nav.zen_mode')"
@click="userSettings.zenMode = !userSettings.zenMode"
@click="togglePreferences('zenMode')"
>
<span :class="userSettings.zenMode ? 'i-ri:layout-right-2-line' : 'i-ri:layout-right-line'" class="flex-shrink-0 text-xl me-4 !align-middle" />
<span :class="getPreferences(userSettings, 'zenMode') ? 'i-ri:layout-right-2-line' : 'i-ri:layout-right-line'" class="flex-shrink-0 text-xl me-4 !align-middle" />
{{ $t('nav.zen_mode') }}
</button>
</div>

View file

@ -23,11 +23,14 @@ function toggleDark() {
<button
flex
text-lg
:class="userSettings.zenMode ? 'i-ri:layout-right-2-line' : 'i-ri:layout-right-line'"
:class="getPreferences(userSettings, 'zenMode') ? 'i-ri:layout-right-2-line' : 'i-ri:layout-right-line'"
:aria-label="$t('nav.zen_mode')"
@click="userSettings.zenMode = !userSettings.zenMode"
@click="togglePreferences('zenMode')"
/>
</CommonTooltip>
<CommonTooltip :content="$t('magic_keys.dialog_header')">
<button flex i-ri:keyboard-box-line dark-i-ri:keyboard-box-line text-lg :aria-label="$t('magic_keys.dialog_header')" @click="toggleKeyboardShortcuts" />
</CommonTooltip>
<CommonTooltip :content="$t('settings.about.sponsor_action')">
<NuxtLink
flex

View file

@ -3,37 +3,43 @@
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"
>
<mask
id="a"
width="240"
height="234"
x="4"
y="1"
maskUnits="userSpaceOnUse"
style="mask-type:alpha">
<path
fill="#D9D9D9"
d="M244 123c0 64.617-38.383 112-103 112-64.617 0-103-30.883-103-95.5C38 111.194-8.729 36.236 8 16 29.46-9.959 88.689 6 125 6c64.617 0 119 52.383 119 117Z"
id="path19" />
</mask>
<g
mask="url(#a)"
id="g28"
transform="matrix(0.90923731,0,0,1.0049564,13.520015,-3.1040835)">
<path
class="body"
d="m 116.94,88.1 c -13.344,1.552 -20.436,-2.019 -24.706,10.71 0,0 14.336,21.655 52.54,21.112 -2.135,8.848 -1.144,15.368 -1.144,23.207 0,26.079 -20.589,48.821 -65.961,48.821 -23.03,0 -51.015,4.191 -72.367,15.911 -15.175,8.305 -27.048,20.336 -32.302,37.023 l 5.956,8.461 11.4,0.155 v 47.889 l -13.91,21.966 3.998,63.645 H -6.364 L -5.22,335.773 C 1.338,331.892 16.36,321.802 29.171,306.279 46.557,285.4 59.902,255.052 44.193,217.486 l 11.744,-5.045 c 12.887,30.814 8.388,57.514 -2.898,79.013 21.58,-0.698 40.11,-2.095 55.819,-4.734 l -3.584,-43.698 12.659,-1.087 L 129.98,387 h 13.116 l 2.212,-94.459 c 10.447,-4.502 34.239,-21.034 45.372,-78.47 1.372,-6.986 2.135,-12.885 2.516,-17.93 1.754,-12.806 2.745,-27.243 3.051,-43.698 l -18.683,-5.976 h 57.42 l 5.567,-12.807 c -5.414,0.233 -11.896,-2.639 -11.896,-2.639 l 1.297,-6.209 H 242 L 176.801,90.428 c -7.244,2.794 -14.87,6.442 -20.208,10.866 -4.27,-3.105 -19.063,-12.807 -39.653,-13.195 z"
id="path22" />
<path
class="wood"
d="M 6.217,24.493 18.494,21 c 5.948,21.577 13.345,33.375 22.648,39.352 8.388,5.099 19.75,5.239 31.799,4.579 C 69.433,63.767 66.154,62.137 63.104,59.886 56.317,54.841 50.522,46.458 46.175,31.246 l 12.201,-3.649 c 3.279,11.488 7.092,18.085 12.201,21.888 5.11,3.726 11.286,4.657 18.606,5.433 13.726,1.553 30.884,2.174 52.312,12.264 2.898,1.086 5.872,2.483 8.769,4.036 -0.381,-0.776 -0.762,-1.553 -1.296,-2.406 -3.66,-5.822 -10.828,-11.953 -24.097,-16.92 l 4.27,-12.109 c 21.581,7.917 30.121,19.171 33.553,28.097 3.965,10.168 1.525,18.124 1.525,18.124 -3.05,1.009 -6.1,2.406 -9.608,3.492 -6.634,-4.579 -12.887,-8.033 -18.835,-10.75 C 113.814,70.442 92.31,76.108 73.246,77.893 58.91,79.213 45.794,78.591 34.432,71.295 23.222,64.155 13.385,50.495 6.217,24.493 Z"
id="path24" />
<path
class="wood"
d="M 90.098,45.294 C 87.582,39.55 86.057,32.487 86.743,23.794 l 12.659,0.932 c -0.763,10.555 2.897,17.696 7.015,22.353 -5.338,-0.931 -10.447,-1.04 -16.319,-1.785 z m 80.069,-1.32 8.312,-9.702 c 21.58,19.094 8.159,46.415 8.159,46.415 l -11.819,-1.32 c -0.382,-6.24 -1.144,-17.836 -6.635,-24.371 3.584,1.84 6.635,3.865 9.99,6.908 0,-5.666 -1.754,-12.341 -8.007,-17.93 z"
id="path26" />
</g>
</svg>
<mask
id="a"
width="240"
height="234"
x="4"
y="1"
maskUnits="userSpaceOnUse"
style="mask-type:alpha"
>
<path
id="path19"
fill="#D9D9D9"
d="M244 123c0 64.617-38.383 112-103 112-64.617 0-103-30.883-103-95.5C38 111.194-8.729 36.236 8 16 29.46-9.959 88.689 6 125 6c64.617 0 119 52.383 119 117Z"
/>
</mask>
<g
id="g28"
mask="url(#a)"
transform="matrix(0.90923731,0,0,1.0049564,13.520015,-3.1040835)"
>
<path
id="path22"
class="body"
d="m 116.94,88.1 c -13.344,1.552 -20.436,-2.019 -24.706,10.71 0,0 14.336,21.655 52.54,21.112 -2.135,8.848 -1.144,15.368 -1.144,23.207 0,26.079 -20.589,48.821 -65.961,48.821 -23.03,0 -51.015,4.191 -72.367,15.911 -15.175,8.305 -27.048,20.336 -32.302,37.023 l 5.956,8.461 11.4,0.155 v 47.889 l -13.91,21.966 3.998,63.645 H -6.364 L -5.22,335.773 C 1.338,331.892 16.36,321.802 29.171,306.279 46.557,285.4 59.902,255.052 44.193,217.486 l 11.744,-5.045 c 12.887,30.814 8.388,57.514 -2.898,79.013 21.58,-0.698 40.11,-2.095 55.819,-4.734 l -3.584,-43.698 12.659,-1.087 L 129.98,387 h 13.116 l 2.212,-94.459 c 10.447,-4.502 34.239,-21.034 45.372,-78.47 1.372,-6.986 2.135,-12.885 2.516,-17.93 1.754,-12.806 2.745,-27.243 3.051,-43.698 l -18.683,-5.976 h 57.42 l 5.567,-12.807 c -5.414,0.233 -11.896,-2.639 -11.896,-2.639 l 1.297,-6.209 H 242 L 176.801,90.428 c -7.244,2.794 -14.87,6.442 -20.208,10.866 -4.27,-3.105 -19.063,-12.807 -39.653,-13.195 z"
/>
<path
id="path24"
class="wood"
d="M 6.217,24.493 18.494,21 c 5.948,21.577 13.345,33.375 22.648,39.352 8.388,5.099 19.75,5.239 31.799,4.579 C 69.433,63.767 66.154,62.137 63.104,59.886 56.317,54.841 50.522,46.458 46.175,31.246 l 12.201,-3.649 c 3.279,11.488 7.092,18.085 12.201,21.888 5.11,3.726 11.286,4.657 18.606,5.433 13.726,1.553 30.884,2.174 52.312,12.264 2.898,1.086 5.872,2.483 8.769,4.036 -0.381,-0.776 -0.762,-1.553 -1.296,-2.406 -3.66,-5.822 -10.828,-11.953 -24.097,-16.92 l 4.27,-12.109 c 21.581,7.917 30.121,19.171 33.553,28.097 3.965,10.168 1.525,18.124 1.525,18.124 -3.05,1.009 -6.1,2.406 -9.608,3.492 -6.634,-4.579 -12.887,-8.033 -18.835,-10.75 C 113.814,70.442 92.31,76.108 73.246,77.893 58.91,79.213 45.794,78.591 34.432,71.295 23.222,64.155 13.385,50.495 6.217,24.493 Z"
/>
<path
id="path26"
class="wood"
d="M 90.098,45.294 C 87.582,39.55 86.057,32.487 86.743,23.794 l 12.659,0.932 c -0.763,10.555 2.897,17.696 7.015,22.353 -5.338,-0.931 -10.447,-1.04 -16.319,-1.785 z m 80.069,-1.32 8.312,-9.702 c 21.58,19.094 8.159,46.415 8.159,46.415 l -11.819,-1.32 c -0.382,-6.24 -1.144,-17.836 -6.635,-24.371 3.584,1.84 6.635,3.865 9.99,6.908 0,-5.666 -1.754,-12.341 -8.007,-17.93 z"
/>
</g>
</svg>
</span>
</template>

View file

@ -1,18 +1,22 @@
<script setup lang="ts">
import { STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
const { command } = defineProps<{
command?: boolean
}>()
const { notifications } = useNotifications()
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
const lastAccessedExploreRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_EXPLORE_ROUTE, '')
</script>
<template>
<nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg h-full mt-1>
<SearchWidget lg:ms-1 lg:me-5 hidden xl:block />
<NavSideItem :text="$t('nav.search')" :to="isHydrated ? `/${currentServer}/explore` : '/explore'" icon="i-ri:search-line" hidden sm:block xl:hidden :command="command" />
<nav sm:px3 flex="~ col gap2" shrink text-size-base leading-normal md:text-lg h-full mt-1 overflow-y-auto>
<NavSideItem :text="$t('nav.search')" to="/search" icon="i-ri:search-line" xl:hidden :command="command" />
<div shrink hidden sm:block mt-2 />
<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.notifications')" to="/notifications" icon="i-ri:notification-4-line" user-only :command="command">
<NavSideItem :text="$t('nav.notifications')" :to="`/notifications/${lastAccessedNotificationRoute}`" icon="i-ri:notification-4-line" user-only :command="command">
<template #icon>
<div flex relative>
<div class="i-ri:notification-4-line" text-xl />
@ -23,17 +27,31 @@ const { notifications } = useNotifications()
</template>
</NavSideItem>
<NavSideItem :text="$t('nav.conversations')" to="/conversations" icon="i-ri:at-line" user-only :command="command" />
<NavSideItem :text="$t('nav.favourites')" to="/favourites" icon="i-ri:heart-3-line" user-only :command="command" />
<NavSideItem :text="$t('nav.favourites')" to="/favourites" :icon="useStarFavoriteIcon ? 'i-ri:star-line' : 'i-ri:heart-3-line'" user-only :command="command" />
<NavSideItem :text="$t('nav.bookmarks')" to="/bookmarks" icon="i-ri:bookmark-line" user-only :command="command" />
<div class="spacer" shrink hidden sm:block />
<NavSideItem :text="$t('action.compose')" to="/compose" icon="i-ri:quill-pen-line" user-only :command="command" />
<div shrink hidden sm:block mt-4 />
<NavSideItem :text="$t('nav.explore')" :to="isHydrated ? `/${currentServer}/explore` : '/explore'" icon="i-ri:hashtag" :command="command" xs:hidden sm:hidden xl: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.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.lists')" :to="isHydrated ? `/${currentServer}/lists` : '/lists'" icon="i-ri:list-check" user-only :command="command" />
<NavSideItem :text="$t('nav.hashtags')" to="/hashtags" icon="i-ri:hashtag" user-only :command="command" />
<div shrink hidden sm:block mt-4 />
<div class="spacer" shrink hidden sm:block />
<NavSideItem :text="$t('nav.settings')" to="/settings" icon="i-ri:settings-3-line" :command="command" />
</nav>
</template>
<style scoped>
.spacer {
margin-top: 0.5em;
}
@media screen and ( max-height: 920px ) and ( min-width: 640px ) {
.spacer {
margin-top: 0;
}
}
</style>

View file

@ -10,8 +10,8 @@ const props = withDefaults(defineProps<{
})
defineSlots<{
icon: {}
default: {}
icon: (props: object) => void
default: (props: object) => void
}>()
const router = useRouter()
@ -28,13 +28,13 @@ useCommand({
},
})
let activeClass = $ref('text-primary')
const activeClass = ref('text-primary')
onHydrated(async () => {
// TODO: force NuxtLink to reevaluate, we now we are in this route though, so we should force it to active
// we don't have currentServer defined until later
activeClass = ''
activeClass.value = ''
await nextTick()
activeClass = 'text-primary'
activeClass.value = 'text-primary'
})
// Optimize rendering for the common case of being logged in, only show visual feedback for disabled user-only items
@ -55,12 +55,23 @@ const noUserVisual = computed(() => isHydrated.value && props.userOnly && !curre
>
<CommonTooltip :disabled="!isMediumOrLargeScreen" :content="text" placement="right">
<div
class="item"
flex items-center gap4
w-fit rounded-3
px2 py2 mx3 sm:mxa
xl="ml0 mr5 px5 w-auto"
transition-100
elk-group-hover="bg-active" group-focus-visible:ring="2 current"
:class="isSmallScreen
? `
w-full
px5 sm:mxa
transition-colors duration-200 transform
hover-bg-gray-100 hover-dark:(bg-gray-700 text-white)
` : `
w-fit rounded-3
px2 mx3 sm:mxa
transition-100
elk-group-hover-bg-active
group-focus-visible:ring-2
group-focus-visible:ring-current
`"
>
<slot name="icon">
<div :class="icon" text-xl />
@ -72,3 +83,28 @@ const noUserVisual = computed(() => isHydrated.value && props.userOnly && !curre
</CommonTooltip>
</NuxtLink>
</template>
<style scoped>
.item {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
@media screen and ( max-height: 820px ) and ( min-width: 1280px ) {
.item {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
}
@media screen and ( max-height: 780px ) and ( min-width: 640px ) {
.item {
padding-top: 0.35rem;
padding-bottom: 0.35rem;
}
}
@media screen and ( max-height: 780px ) and ( min-width: 1280px ) {
.item {
padding-top: 0.05rem;
padding-bottom: 0.05rem;
}
}
</style>

View file

@ -5,7 +5,7 @@ const back = ref<any>('')
const nuxtApp = useNuxtApp()
const onClickLogo = () => {
function onClickLogo() {
nuxtApp.hooks.callHook('elk-logo:click')
}
@ -29,20 +29,22 @@ router.afterEach(() => {
@click.prevent="onClickLogo"
>
<NavLogo shrink-0 aspect="1/1" sm:h-8 xl:h-10 class="rtl-flip" />
<div hidden xl:block text-secondary>
<div v-show="isHydrated" hidden xl:block text-secondary>
{{ $t('app_name') }} <sup text-sm italic mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
</div>
</NuxtLink>
<div
hidden xl:flex items-center me-8 mt-2
:class="{ 'pointer-events-none op0': !back || back === '/', 'xl:flex': $route.name !== 'tag' }"
hidden xl:flex items-center me-8 mt-2 gap-1
>
<NuxtLink
:aria-label="$t('nav.back')"
@click="$router.go(-1)"
>
<div i-ri:arrow-left-line class="rtl-flip" btn-text />
</NuxtLink>
<CommonTooltip :content="$t('nav.back')">
<NuxtLink
:aria-label="$t('nav.back')"
: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>
</CommonTooltip>
</div>
</div>
</template>

View file

@ -34,7 +34,13 @@ const { busy, oauth, singleInstanceServer } = useSignIn()
<strong>{{ currentServer }}</strong>
</i18n-t>
</button>
<button v-else btn-solid text-sm px-2 py-1 text-center xl:hidden @click="openSigninDialog()">
<button
v-else
flex="~ row"
gap-x-1 items-center justify-center btn-solid text-sm px-2 py-1 xl:hidden
@click="openSigninDialog()"
>
<span aria-hidden="true" block i-ri:login-circle-line class="rtl-flip" />
{{ $t('action.sign_in') }}
</button>
</template>

View file

@ -4,6 +4,13 @@ import type { mastodon } from 'masto'
const { notification } = defineProps<{
notification: mastodon.v1.Notification
}>()
const { t } = useI18n()
// well-known emoji reactions types Elk does not support yet
const unsupportedEmojiReactionTypes = ['pleroma:emoji_reaction', 'reaction']
if (unsupportedEmojiReactionTypes.includes(notification.type))
console.warn(`[DEV] ${t('notification.missing_type')} '${notification.type}' (notification.id: ${notification.id})`)
</script>
<template>
@ -15,37 +22,62 @@ const { notification } = defineProps<{
ps-3 pe-4 inset-is-0
rounded-ie-be-3
py-3 bg-base top-0
:lang="notification.status?.language ?? undefined"
>
<div i-ri:user-follow-fill me-1 color-primary />
<div i-ri-user-3-line text-xl me-3 color-blue />
<AccountDisplayName :account="notification.account" text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all />
<span ws-nowrap>
{{ $t('notification.followed_you') }}
</span>
</div>
<AccountBigCard
ms10
:account="notification.account"
:lang="notification.status?.language ?? undefined"
/>
</NuxtLink>
</template>
<template v-else-if="notification.type === 'admin.sign_up'">
<div flex p3 items-center bg-shaded>
<div i-ri:admin-fill me-1 color-purple />
<AccountDisplayName
:account="notification.account"
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<span>{{ $t("notification.signed_up") }}</span>
</div>
<NuxtLink :to="getAccountRoute(notification.account)">
<div flex p4 items-center bg-shaded>
<div i-ri:user-add-line text-xl me-2 color-purple />
<AccountDisplayName
:account="notification.account"
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<span>{{ $t("notification.signed_up") }}</span>
</div>
</NuxtLink>
</template>
<template v-else-if="notification.type === 'admin.report'">
<NuxtLink :to="getReportRoute(notification.report?.id!)">
<div flex p4 items-center bg-shaded>
<div i-ri:flag-line text-xl me-2 color-purple />
<i18n-t keypath="notification.reported">
<AccountDisplayName
:account="notification.account"
text-purple me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<AccountDisplayName
:account="notification.report?.targetAccount!"
text-purple ms-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
</i18n-t>
</div>
</NuxtLink>
</template>
<template v-else-if="notification.type === 'follow_request'">
<div flex ms-4 items-center class="-top-2.5" absolute inset-ie-2 px-2>
<div i-ri:user-follow-fill text-xl me-1 />
<AccountInlineInfo :account="notification.account" me1 />
<div flex px-3 py-2>
<div i-ri-user-shared-line text-xl me-3 color-blue />
<AccountDisplayName
:account="notification.account"
text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all
/>
<span me-1 ws-nowrap>
{{ $t('notification.request_to_follow') }}
</span>
</div>
<!-- TODO: accept request -->
<AccountCard :account="notification.account" />
<AccountCard p="s-2 e-4 b-2" hover-card :account="notification.account">
<AccountFollowRequestButton :account="notification.account" />
</AccountCard>
</template>
<template v-else-if="notification.type === 'update'">
<StatusCard :status="notification.status!" :in-notification="true" :actions="false">
@ -63,7 +95,8 @@ const { notification } = defineProps<{
<template v-else-if="notification.type === 'mention' || notification.type === 'poll' || notification.type === 'status'">
<StatusCard :status="notification.status!" />
</template>
<template v-else>
<template v-else-if="!unsupportedEmojiReactionTypes.includes(notification.type)">
<!-- prevent showing errors for dev for known emoji reaction types -->
<!-- type 'favourite' and 'reblog' should always rendered by NotificationGroupedLikes -->
<div text-red font-bold>
[DEV] {{ $t('notification.missing_type') }} '{{ notification.type }}'

View file

@ -10,7 +10,7 @@ defineProps<{
defineEmits(['hide', 'subscribe'])
defineSlots<{
error: {}
error: (props: object) => void
}>()
const xl = useMediaQuery('(min-width: 1280px)')

View file

@ -5,17 +5,17 @@ const { items } = defineProps<{
items: GroupedNotifications
}>()
const count = $computed(() => items.items.length)
const count = computed(() => items.items.length)
const isExpanded = ref(false)
const lang = $computed(() => {
return (count > 1 || count === 0) ? undefined : items.items[0].status?.language
const lang = computed(() => {
return (count.value > 1 || count.value === 0) ? undefined : items.items[0].status?.language
})
</script>
<template>
<article flex flex-col relative :lang="lang ?? undefined">
<div flex items-center top-0 left-2 pt-2 px-3>
<div i-ri:user-follow-fill me-3 color-primary aria-hidden="true" />
<div :class="count > 1 ? 'i-ri-group-line' : 'i-ri-user-3-line'" me-3 color-blue text-xl aria-hidden="true" />
<template v-if="count > 1">
<CommonLocalizedNumber
keypath="notification.followed_you_count"
@ -32,7 +32,7 @@ const lang = $computed(() => {
</span>
</template>
</div>
<div pb-2>
<div pb-2 ps8>
<div v-if="isExpanded">
<AccountCard
v-for="item in items.items"

View file

@ -4,17 +4,18 @@ import type { GroupedLikeNotifications } from '~/types'
const { group } = defineProps<{
group: GroupedLikeNotifications
}>()
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
const reblogs = $computed(() => group.likes.filter(i => i.reblog))
const likes = $computed(() => group.likes.filter(i => i.favourite && !i.reblog))
const reblogs = computed(() => group.likes.filter(i => i.reblog))
const likes = computed(() => group.likes.filter(i => i.favourite && !i.reblog))
</script>
<template>
<article flex flex-col relative>
<StatusLink :status="group.status!" pb2 pt3>
<div flex flex-col gap-2>
<StatusLink :status="group.status!" pb4 pt5>
<div flex flex-col gap-3>
<div v-if="reblogs.length" flex="~ gap-1">
<div i-ri:repeat-fill text-xl me-1 color-green />
<div i-ri:repeat-fill text-xl me-2 color-green />
<template v-for="i, idx of reblogs" :key="idx">
<AccountHoverWrapper :account="i.account">
<NuxtLink :to="getAccountRoute(i.account)">
@ -27,7 +28,7 @@ const likes = $computed(() => group.likes.filter(i => i.favourite && !i.reblog))
</div>
</div>
<div v-if="likes.length" flex="~ gap-1">
<div i-ri:heart-fill text-xl me-1 color-red />
<div :class="useStarFavoriteIcon ? 'i-ri:star-line color-yellow' : 'i-ri:heart-line color-red'" text-xl me-2 />
<template v-for="i, idx of likes" :key="idx">
<AccountHoverWrapper :account="i.account">
<NuxtLink :to="getAccountRoute(i.account)">
@ -35,12 +36,12 @@ const likes = $computed(() => group.likes.filter(i => i.favourite && !i.reblog))
</NuxtLink>
</AccountHoverWrapper>
</template>
<div ml1>
<div ms1>
{{ $t('notification.favourited_post') }}
</div>
</div>
</div>
<div pl8 mt-1>
<div ps9 mt-1>
<StatusBody :status="group.status!" text-secondary />
<!-- When no text content is presented, we show media instead -->
<template v-if="!group.status!.content">

View file

@ -1,21 +1,31 @@
<script setup lang="ts">
// @ts-expect-error missing types
import { DynamicScrollerItem } from 'vue-virtual-scroller'
import type { Paginator, WsEvents, mastodon } from 'masto'
import type { mastodon } from 'masto'
import type { GroupedAccountLike, NotificationSlot } from '~/types'
const { paginator, stream } = defineProps<{
paginator: Paginator<mastodon.v1.Notification[], mastodon.v1.ListNotificationsParams>
stream?: Promise<WsEvents>
paginator: mastodon.Paginator<mastodon.v1.Notification[], mastodon.rest.v1.ListNotificationsParams>
stream?: mastodon.streaming.Subscription
}>()
const virtualScroller = false // TODO: fix flickering issue with virtual scroll
const groupCapacity = Number.MAX_VALUE // No limit
const includeNotificationTypes: mastodon.v1.NotificationType[] = ['update', 'mention', 'poll', 'status']
function includeNotificationsForStatusCard({ type, status }: mastodon.v1.Notification) {
// Exclude update, mention, pool and status notifications without the status entry:
// no makes sense to include them
// Those notifications will be shown using StatusCard SFC:
// check NotificationCard SFC L68 and L81 => :status="notification.status!"
return status || !includeNotificationTypes.includes(type)
}
// Group by type (and status when applicable)
const groupId = (item: mastodon.v1.Notification): string => {
// If the update is related to an status, group notifications from the same account (boost + favorite the same status)
function groupId(item: mastodon.v1.Notification): string {
// If the update is related to a status, group notifications from the same account (boost + favorite the same status)
const id = item.status
? {
status: item.status?.id,
@ -75,7 +85,12 @@ function groupItems(items: mastodon.v1.Notification[]): NotificationSlot[] {
}
return
}
else if (group.length && group[0].status && (group[0].type === 'reblog' || group[0].type === 'favourite')) {
else if (group.length && (group[0].type === 'reblog' || group[0].type === 'favourite')) {
if (!group[0].status) {
// Ignore favourite or reblog if status is null, sometimes the API is sending these
// notifications
return
}
// All notifications in these group are reblogs or favourites of the same status
const likes: GroupedAccountLike[] = []
for (const notification of group) {
@ -103,9 +118,9 @@ function groupItems(items: mastodon.v1.Notification[]): NotificationSlot[] {
results.push(...group)
}
for (const item of items) {
for (const item of items.filter(includeNotificationsForStatusCard)) {
const itemId = groupId(item)
// Finalize group if it already has too many notifications
// Finalize the group if it already has too many notifications
if (currentGroupId !== itemId || currentGroup.length >= groupCapacity)
processGroup()
@ -150,17 +165,17 @@ const { clearNotifications } = useNotifications()
const { formatNumber } = useHumanReadableNumber()
</script>
<!-- eslint-disable vue/attribute-hyphenation -->
<template>
<CommonPaginator
:paginator="paginator"
:preprocess="preprocess"
:stream="stream"
:eager="3"
:virtual-scroller="virtualScroller"
event-type="notification"
eventType="notification"
:virtualScroller="virtualScroller"
>
<template #updater="{ number, update }">
<button py-4 border="b base" flex="~ col" p-3 w-full text-primary font-bold @click="() => { update(); clearNotifications() }">
<button id="elk_show_new_items" py-4 border="b base" flex="~ col" p-3 w-full text-primary font-bold @click="() => { update(); clearNotifications() }">
{{ $t('timeline.show_new_items', number, { named: { v: formatNumber(number) } }) }}
</button>
</template>

View file

@ -17,35 +17,35 @@ const { t } = useI18n()
const pwaEnabled = useAppConfig().pwaEnabled
let busy = $ref<boolean>(false)
let animateSave = $ref<boolean>(false)
let animateSubscription = $ref<boolean>(false)
let animateRemoveSubscription = $ref<boolean>(false)
let subscribeError = $ref<string>('')
let showSubscribeError = $ref<boolean>(false)
const busy = ref<boolean>(false)
const animateSave = ref<boolean>(false)
const animateSubscription = ref<boolean>(false)
const animateRemoveSubscription = ref<boolean>(false)
const subscribeError = ref<string>('')
const showSubscribeError = ref<boolean>(false)
const hideNotification = () => {
function hideNotification() {
const key = currentUser.value?.account?.acct
if (key)
hiddenNotification.value[key] = true
}
const showWarning = $computed(() => {
const showWarning = computed(() => {
if (!pwaEnabled)
return false
return isSupported
&& (!isSubscribed.value || !notificationPermission.value || notificationPermission.value === 'prompt')
&& !(hiddenNotification.value[currentUser.value?.account?.acct ?? ''] === true)
&& (!isSubscribed.value || !notificationPermission.value || notificationPermission.value === 'prompt')
&& !(hiddenNotification.value[currentUser.value?.account?.acct ?? ''])
})
const saveSettings = async () => {
if (busy)
async function saveSettings() {
if (busy.value)
return
busy = true
busy.value = true
await nextTick()
animateSave = true
animateSave.value = true
try {
await updateSubscription()
@ -55,48 +55,48 @@ const saveSettings = async () => {
console.error(err)
}
finally {
busy = false
animateSave = false
busy.value = false
animateSave.value = false
}
}
const doSubscribe = async () => {
if (busy)
async function doSubscribe() {
if (busy.value)
return
busy = true
busy.value = true
await nextTick()
animateSubscription = true
animateSubscription.value = true
try {
const result = await subscribe()
if (result !== 'subscribed') {
subscribeError = t(`settings.notifications.push_notifications.subscription_error.${result === 'notification-denied' ? 'permission_denied' : 'request_error'}`)
showSubscribeError = true
subscribeError.value = t(`settings.notifications.push_notifications.subscription_error.${result === 'notification-denied' ? 'permission_denied' : 'request_error'}`)
showSubscribeError.value = true
}
}
catch (err) {
if (err instanceof PushSubscriptionError) {
subscribeError = t(`settings.notifications.push_notifications.subscription_error.${err.code}`)
subscribeError.value = t(`settings.notifications.push_notifications.subscription_error.${err.code}`)
}
else {
console.error(err)
subscribeError = t('settings.notifications.push_notifications.subscription_error.request_error')
subscribeError.value = t('settings.notifications.push_notifications.subscription_error.request_error')
}
showSubscribeError = true
showSubscribeError.value = true
}
finally {
busy = false
animateSubscription = false
busy.value = false
animateSubscription.value = false
}
}
const removeSubscription = async () => {
if (busy)
async function removeSubscription() {
if (busy.value)
return
busy = true
busy.value = true
await nextTick()
animateRemoveSubscription = true
animateRemoveSubscription.value = true
try {
await unsubscribe()
}
@ -104,11 +104,11 @@ const removeSubscription = async () => {
console.error(err)
}
finally {
busy = false
animateRemoveSubscription = false
busy.value = false
animateRemoveSubscription.value = false
}
}
onActivated(() => (busy = false))
onActivated(() => (busy.value = false))
</script>
<template>

View file

@ -3,9 +3,7 @@ defineProps<{
title?: string
message: string
}>()
const { modelValue } = defineModel<{
modelValue: boolean
}>()
const modelValue = defineModel<boolean>({ required: true })
</script>
<template>

View file

@ -20,9 +20,10 @@ const maxDescriptionLength = 1500
const isEditDialogOpen = ref(false)
const description = ref(props.attachment.description ?? '')
const toggleApply = () => {
function toggleApply() {
isEditDialogOpen.value = false
emit('setDescription', unref(description))
emit('setDescription', description.value)
}
</script>

View file

@ -1,5 +1,6 @@
<script setup lang="ts">
import type { Editor } from '@tiptap/core'
const { editor } = defineProps<{
editor: Editor
}>()
@ -7,9 +8,10 @@ const { editor } = defineProps<{
<template>
<CommonTooltip placement="top" :content="$t('tooltip.open_editor_tools')">
<VDropdown v-if="editor" placement="top">
<VDropdown v-if="editor" placement="bottom">
<button
btn-action-icon
:aria-label="$t('tooltip.open_editor_tools')"
>
<div i-ri:font-size-2 />
</button>

View file

@ -9,16 +9,16 @@ const emit = defineEmits<{
const { locale } = useI18n()
const el = $ref<HTMLElement>()
let picker = $ref<Picker>()
const el = ref<HTMLElement>()
const picker = ref<Picker>()
const colorMode = useColorMode()
async function openEmojiPicker() {
await updateCustomEmojis()
if (picker) {
picker.update({
theme: colorMode.value,
if (picker.value) {
picker.value.update({
theme: colorMode,
custom: customEmojisData.value,
})
}
@ -29,7 +29,7 @@ async function openEmojiPicker() {
importEmojiLang(locale.value.split('-')[0]),
])
picker = new Picker({
picker.value = new Picker({
data: () => dataPromise,
onEmojiSelect({ native, src, alt, name }: any) {
native
@ -37,19 +37,19 @@ async function openEmojiPicker() {
: emit('selectCustom', { src, alt, 'data-emoji-id': name })
},
set: 'twitter',
theme: colorMode.value,
theme: colorMode,
custom: customEmojisData.value,
i18n,
})
}
await nextTick()
// TODO: custom picker
el?.appendChild(picker as any as HTMLElement)
el.value?.appendChild(picker.value as any as HTMLElement)
}
const hideEmojiPicker = () => {
if (picker)
el?.removeChild(picker as any as HTMLElement)
function hideEmojiPicker() {
if (picker.value)
el.value?.removeChild(picker.value as any as HTMLElement)
}
</script>

View file

@ -1,26 +1,28 @@
<script setup lang="ts">
import Fuse from 'fuse.js'
let { modelValue } = $defineModel<{
modelValue: string
}>()
const modelValue = defineModel<string>({ required: true })
const { t } = useI18n()
const userSettings = useUserSettings()
const languageKeyword = $ref('')
const languageKeyword = ref('')
const fuse = new Fuse(languagesNameList, {
keys: ['code', 'nativeName', 'name'],
shouldSort: true,
})
const languages = $computed(() =>
languageKeyword.trim()
? fuse.search(languageKeyword).map(r => r.item)
const languages = computed(() =>
languageKeyword.value.trim()
? fuse.search(languageKeyword.value).map(r => r.item)
: [...languagesNameList].filter(entry => !userSettings.value.disabledTranslationLanguages.includes(entry.code))
.sort(({ code: a }, { code: b }) => {
return a === modelValue ? -1 : b === modelValue ? 1 : a.localeCompare(b)
// Put English on the top
if (a === 'en')
return -1
return a === modelValue.value ? -1 : b === modelValue.value ? 1 : a.localeCompare(b)
}),
)
@ -37,7 +39,7 @@ const preferredLanguages = computed(() => {
)
function chooseLanguage(language: string) {
modelValue = language
modelValue.value = language
}
</script>

View file

@ -3,16 +3,16 @@ const { editing } = defineProps<{
editing?: boolean
}>()
let { modelValue } = $defineModel<{
modelValue: string
}>()
const modelValue = defineModel<string>({
required: true,
})
const currentVisibility = $computed(() =>
statusVisibilities.find(v => v.value === modelValue) || statusVisibilities[0],
const currentVisibility = computed(() =>
statusVisibilities.find(v => v.value === modelValue.value) || statusVisibilities[0],
)
const chooseVisibility = (visibility: string) => {
modelValue = visibility
function chooseVisibility(visibility: string) {
modelValue.value = visibility
}
</script>

View file

@ -27,43 +27,98 @@ const emit = defineEmits<{
const { t } = useI18n()
const draftState = useDraft(draftKey, initial)
const { draft } = $(draftState)
const { draft } = draftState
const {
isExceedingAttachmentLimit, isUploading, failedAttachments, isOverDropZone,
uploadAttachments, pickAttachments, setDescription, removeAttachment,
isExceedingAttachmentLimit,
isUploading,
failedAttachments,
isOverDropZone,
uploadAttachments,
pickAttachments,
setDescription,
removeAttachment,
dropZoneRef,
} = $(useUploadMediaAttachment($$(draft)))
} = useUploadMediaAttachment(draft)
let { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft, failedMessages, preferredLanguage, publishSpoilerText } = $(usePublish(
const { shouldExpanded, isExpanded, isSending, isPublishDisabled, publishDraft, failedMessages, preferredLanguage, publishSpoilerText } = usePublish(
{
draftState,
...$$({ expanded, isUploading, initialDraft: initial }),
...{ expanded: toRef(() => expanded), isUploading, initialDraft: toRef(() => initial) },
},
))
)
const { editor } = useTiptap({
content: computed({
get: () => draft.params.status,
get: () => draft.value.params.status,
set: (newVal) => {
draft.params.status = newVal
draft.lastUpdated = Date.now()
draft.value.params.status = newVal
draft.value.lastUpdated = Date.now()
},
}),
placeholder: computed(() => placeholder ?? draft.params.inReplyToId ? t('placeholder.replying') : t('placeholder.default_1')),
autofocus: shouldExpanded,
placeholder: computed(() => placeholder ?? draft.value.params.inReplyToId ? t('placeholder.replying') : t('placeholder.default_1')),
autofocus: shouldExpanded.value,
onSubmit: publish,
onFocus() {
if (!isExpanded && draft.initialText) {
editor.value?.chain().insertContent(`${draft.initialText} `).focus('end').run()
draft.initialText = ''
if (!isExpanded && draft.value.initialText) {
editor.value?.chain().insertContent(`${draft.value.initialText} `).focus('end').run()
draft.value.initialText = ''
}
isExpanded = true
isExpanded.value = true
},
onPaste: handlePaste,
})
const characterCount = $computed(() => {
function trimPollOptions() {
const indexLastNonEmpty = draft.value.params.poll!.options.findLastIndex(option => option.trim().length > 0)
const trimmedOptions = draft.value.params.poll!.options.slice(0, indexLastNonEmpty + 1)
if (currentInstance.value?.configuration
&& trimmedOptions.length >= currentInstance.value?.configuration?.polls.maxOptions)
draft.value.params.poll!.options = trimmedOptions
else
draft.value.params.poll!.options = [...trimmedOptions, '']
}
function editPollOptionDraft(event: Event, index: number) {
draft.value.params.poll!.options = Object.assign(draft.value.params.poll!.options.slice(), { [index]: (event.target as HTMLInputElement).value })
trimPollOptions()
}
function deletePollOption(index: number) {
const newPollOptions = draft.value.params.poll!.options.slice()
newPollOptions.splice(index, 1)
draft.value.params.poll!.options = newPollOptions
trimPollOptions()
}
const expiresInOptions = computed(() => [
{
seconds: 1 * 60 * 60,
label: t('time_ago_options.hour_future', 1),
},
{
seconds: 2 * 60 * 60,
label: t('time_ago_options.hour_future', 2),
},
{
seconds: 1 * 24 * 60 * 60,
label: t('time_ago_options.day_future', 1),
},
{
seconds: 2 * 24 * 60 * 60,
label: t('time_ago_options.day_future', 2),
},
{
seconds: 7 * 24 * 60 * 60,
label: t('time_ago_options.day_future', 7),
},
])
const expiresInDefaultOptionIndex = 2
const characterCount = computed(() => {
const text = htmlToText(editor.value?.getHTML() || '')
let length = stringLength(text)
@ -84,24 +139,26 @@ const characterCount = $computed(() => {
for (const [fullMatch, before, _handle, username] of text.matchAll(countableMentionRegex))
length -= fullMatch.length - (before + username).length - 1 // - 1 for the @
if (draft.mentions) {
// + 1 is needed as mentions always need a space seperator at the end
length += draft.mentions.map((mention) => {
if (draft.value.mentions) {
// + 1 is needed as mentions always need a space separator at the end
length += draft.value.mentions.map((mention) => {
const [handle] = mention.split('@')
return `@${handle}`
}).join(' ').length + 1
}
length += stringLength(publishSpoilerText)
length += stringLength(publishSpoilerText.value)
return length
})
const isExceedingCharacterLimit = $computed(() => {
return characterCount > characterLimit.value
const isExceedingCharacterLimit = computed(() => {
return characterCount.value > characterLimit.value
})
const postLanguageDisplay = $computed(() => languagesNameList.find(i => i.code === (draft.params.language || preferredLanguage))?.nativeName)
const postLanguageDisplay = computed(() => languagesNameList.find(i => i.code === (draft.value.params.language || preferredLanguage))?.nativeName)
const isDM = computed(() => draft.value.params.visibility === 'direct')
async function handlePaste(evt: ClipboardEvent) {
const files = evt.clipboardData?.files
@ -120,7 +177,7 @@ function insertCustomEmoji(image: any) {
}
async function toggleSensitive() {
draft.params.sensitive = !draft.params.sensitive
draft.value.params.sensitive = !draft.value.params.sensitive
}
async function publish() {
@ -153,22 +210,27 @@ defineExpose({
editor.value?.commands?.focus?.()
},
})
function stopQuestionMarkPropagation(e: KeyboardEvent) {
if (e.key === '?')
e.stopImmediatePropagation()
}
onDeactivated(() => {
clearEmptyDrafts()
})
</script>
<template>
<div v-if="isHydrated && currentUser" flex="~ col gap-4" py3 px2 sm:px4 aria-roledescription="publish-widget">
<template v-if="draft.editingStatus">
<div flex="~ col gap-1">
<div id="state-editing" text-secondary self-center>
{{ $t('state.editing') }}
</div>
<StatusCard :status="draft.editingStatus" :actions="false" :hover="false" is-preview px-0 />
<div id="state-editing" text-secondary self-center>
{{ $t('state.editing') }}
</div>
<div border="b dashed gray/40" />
</template>
<div flex gap-3 flex-1>
<NuxtLink :to="getAccountRoute(currentUser.account)">
<NuxtLink self-start :to="getAccountRoute(currentUser.account)">
<AccountBigAvatar :account="currentUser.account" square />
</NuxtLink>
<!-- This `w-0` style is used to avoid overflow problems in flex layoutsso don't remove it unless you know what you're doing -->
@ -217,11 +279,16 @@ defineExpose({
</ol>
</CommonErrorMessage>
<div relative flex-1 flex flex-col>
<div relative flex-1 flex flex-col min-h-30>
<EditorContent
:editor="editor"
flex max-w-full
:class="shouldExpanded ? 'min-h-30 md:max-h-[calc(100vh-200px)] sm:max-h-[calc(100vh-400px)] max-h-35 of-y-auto overscroll-contain' : ''"
:class="{
'md:max-h-[calc(100vh-200px)] sm:max-h-[calc(100vh-400px)] max-h-35 of-y-auto overscroll-contain': shouldExpanded,
'py2 px3.5 bg-dm rounded-4 me--1 ms--1 mt--1': isDM,
}"
@keydown="stopQuestionMarkPropagation"
@keydown.esc.prevent="editor?.commands.blur()"
/>
</div>
@ -273,92 +340,175 @@ defineExpose({
</div>
<div flex gap-4>
<div w-12 h-full sm:block hidden />
<div
v-if="shouldExpanded" flex="~ gap-1 1 wrap" m="s--1" pt-2 justify="end" max-w-full
border="t base"
>
<PublishEmojiPicker
@select="insertEmoji"
@select-custom="insertCustomEmoji"
<div flex="~ col 1" max-w-full>
<form v-if="isExpanded && draft.params.poll" my-4 flex="~ 1 col" gap-3 m="s--1">
<div
v-for="(option, index) in draft.params.poll.options"
:key="index"
flex="~ row"
gap-3
>
<input
:value="option"
bg-base
border="~ base" flex-1 h10 pe-4 rounded-2 w-full flex="~ row"
items-center relative focus-within:box-shadow-outline gap-3
px-4 py-2
:placeholder="$t('polls.option_placeholder', { current: index + 1, max: currentInstance?.configuration?.polls.maxOptions })"
class="option-input"
@input="editPollOptionDraft($event, index)"
>
<CommonTooltip placement="top" :content="$t('polls.remove_option')" class="delete-button">
<button
btn-action-icon class="hover:bg-red/75"
:disabled="index === draft.params.poll!.options.length - 1 && (index + 1 !== currentInstance?.configuration?.polls.maxOptions || draft.params.poll!.options[index].length === 0)"
@click.prevent="deletePollOption(index)"
>
<div i-ri:delete-bin-line />
</button>
</CommonTooltip>
<span
v-if="currentInstance?.configuration?.polls.maxCharactersPerOption"
class="char-limit-radial"
aspect-ratio-1
h-10
:style="{ background: `radial-gradient(closest-side, rgba(var(--rgb-bg-base)) 79%, transparent 80% 100%), conic-gradient(${draft.params.poll!.options[index].length / currentInstance?.configuration?.polls.maxCharactersPerOption > 1 ? 'var(--c-danger)' : 'var(--c-primary)'} ${draft.params.poll!.options[index].length / currentInstance?.configuration?.polls.maxCharactersPerOption * 100}%, var(--c-primary-fade) 0)` }"
>{{ draft.params.poll!.options[index].length }}</span>
</div>
</form>
<div
v-if="shouldExpanded" flex="~ gap-1 1 wrap" m="s--1" pt-2 justify="end" max-w-full
border="t base"
>
<button btn-action-icon :title="$t('tooltip.emoji')">
<div i-ri:emotion-line />
</button>
</PublishEmojiPicker>
<CommonTooltip placement="top" :content="$t('tooltip.add_media')">
<button btn-action-icon :aria-label="$t('tooltip.add_media')" @click="pickAttachments">
<div i-ri:image-add-line />
</button>
</CommonTooltip>
<PublishEditorTools v-if="editor" :editor="editor" />
<div flex-auto />
<PublishCharacterCounter :max="characterLimit" :length="characterCount" />
<CommonTooltip placement="top" :content="$t('tooltip.change_language')">
<CommonDropdown placement="bottom" auto-boundary-max-size>
<button btn-action-icon :aria-label="$t('tooltip.change_language')" w-max mr1>
<span v-if="postLanguageDisplay" text-secondary text-sm ml1>{{ postLanguageDisplay }}</span>
<div v-else i-ri:translate-2 />
<div i-ri:arrow-down-s-line text-sm text-secondary me--1 />
<PublishEmojiPicker
@select="insertEmoji"
@select-custom="insertCustomEmoji"
>
<button btn-action-icon :title="$t('tooltip.emojis')" :aria-label="$t('tooltip.add_emojis')">
<div i-ri:emotion-line />
</button>
</PublishEmojiPicker>
<template #popper>
<PublishLanguagePicker v-model="draft.params.language" min-w-80 />
</template>
</CommonDropdown>
</CommonTooltip>
<CommonTooltip placement="top" :content="$t('tooltip.add_content_warning')">
<button btn-action-icon :aria-label="$t('tooltip.add_content_warning')" @click="toggleSensitive">
<div v-if="draft.params.sensitive" i-ri:alarm-warning-fill text-orange />
<div v-else i-ri:alarm-warning-line />
</button>
</CommonTooltip>
<PublishVisibilityPicker v-model="draft.params.visibility" :editing="!!draft.editingStatus">
<template #default="{ visibility }">
<button :disabled="!!draft.editingStatus" :aria-label="$t('tooltip.change_content_visibility')" btn-action-icon :class="{ 'w-12': !draft.editingStatus }">
<div :class="visibility.icon" />
<div v-if="!draft.editingStatus" i-ri:arrow-down-s-line text-sm text-secondary me--1 />
<CommonTooltip v-if="draft.params.poll === undefined" placement="top" :content="$t('tooltip.add_media')" no-auto-focus>
<button btn-action-icon :aria-label="$t('tooltip.add_media')" @click="pickAttachments">
<div i-ri:image-add-line />
</button>
</CommonTooltip>
<template v-if="draft.attachments.length === 0">
<CommonTooltip v-if="!draft.params.poll" placement="top" :content="$t('polls.create')" no-auto-focus>
<button btn-action-icon :aria-label="$t('polls.create')" @click="draft.params.poll = { options: [''], expiresIn: expiresInOptions[expiresInDefaultOptionIndex].seconds }">
<div i-ri:chat-poll-line />
</button>
</CommonTooltip>
<div v-else rounded-full b-1 border-dark flex="~ row" gap-1>
<CommonTooltip placement="top" :content="$t('polls.cancel')" no-auto-focus>
<button btn-action-icon b-r border-dark :aria-label="$t('polls.cancel')" @click="draft.params.poll = undefined">
<div i-ri:close-line />
</button>
</CommonTooltip>
<CommonDropdown placement="top">
<CommonTooltip placement="top" :content="$t('polls.settings')" no-auto-focus>
<button :aria-label="$t('polls.settings')" btn-action-icon w-12>
<div i-ri:list-settings-line />
<div i-ri:arrow-down-s-line text-sm text-secondary me--1 />
</button>
</CommonTooltip>
<template #popper>
<div flex="~ col" gap-1 p-2>
<CommonCheckbox v-model="draft.params.poll.multiple" :label="draft.params.poll.multiple ? $t('polls.disallow_multiple') : $t('polls.allow_multiple')" px-2 gap-3 h-9 flex justify-center hover:bg-active rounded-full icon-checked="i-ri:checkbox-multiple-blank-line" icon-unchecked="i-ri:checkbox-blank-circle-line" />
<CommonCheckbox v-model="draft.params.poll.hideTotals" :label="draft.params.poll.hideTotals ? $t('polls.show_votes') : $t('polls.hide_votes')" px-2 gap-3 h-9 flex justify-center hover:bg-active rounded-full icon-checked="i-ri:eye-close-line" icon-unchecked="i-ri:eye-line" />
</div>
</template>
</CommonDropdown>
<CommonDropdown placement="bottom">
<CommonTooltip placement="top" :content="$t('polls.expiration')" no-auto-focus>
<button :aria-label="$t('polls.expiration')" btn-action-icon w-12>
<div i-ri:hourglass-line />
<div i-ri:arrow-down-s-line text-sm text-secondary me--1 />
</button>
</CommonTooltip>
<template #popper>
<CommonDropdownItem
v-for="expiresInOption in expiresInOptions"
:key="expiresInOption.seconds"
:text="expiresInOption.label"
:checked="draft.params.poll!.expiresIn === expiresInOption.seconds"
@click="draft.params.poll!.expiresIn = expiresInOption.seconds"
/>
</template>
</CommonDropdown>
</div>
</template>
</PublishVisibilityPicker>
<CommonTooltip v-if="failedMessages.length > 0" id="publish-failed-tooltip" placement="top" :content="$t('tooltip.publish_failed')">
<button
btn-danger rounded-3 text-sm w-full flex="~ gap1" items-center md:w-fit aria-describedby="publish-failed-tooltip"
>
<span block>
<div block i-carbon:face-dizzy-filled />
</span>
<span>{{ $t('state.publish_failed') }}</span>
</button>
</CommonTooltip>
<PublishEditorTools v-if="editor" :editor="editor" />
<CommonTooltip v-else id="publish-tooltip" placement="top" :content="$t('tooltip.add_publishable_content')" :disabled="!(isPublishDisabled || isExceedingCharacterLimit)">
<button
btn-solid rounded-3 text-sm w-full flex="~ gap1" items-center
md:w-fit
class="publish-button"
:aria-disabled="isPublishDisabled || isExceedingCharacterLimit"
aria-describedby="publish-tooltip"
@click="publish"
>
<span v-if="isSending" block animate-spin preserve-3d>
<div block i-ri:loader-2-fill />
</span>
<span v-if="failedMessages.length" block>
<div block i-carbon:face-dizzy-filled />
</span>
<span v-if="draft.editingStatus">{{ $t('action.save_changes') }}</span>
<span v-else-if="draft.params.inReplyToId">{{ $t('action.reply') }}</span>
<span v-else>{{ !isSending ? $t('action.publish') : $t('state.publishing') }}</span>
</button>
</CommonTooltip>
<div flex-auto />
<PublishCharacterCounter :max="characterLimit" :length="characterCount" />
<CommonTooltip placement="top" :content="$t('tooltip.change_language')" no-auto-focus>
<CommonDropdown placement="bottom" auto-boundary-max-size>
<button btn-action-icon :aria-label="$t('tooltip.change_language')" w-max mr1>
<span v-if="postLanguageDisplay" text-secondary text-sm ml1>{{ postLanguageDisplay }}</span>
<div v-else i-ri:translate-2 />
<div i-ri:arrow-down-s-line text-sm text-secondary me--1 />
</button>
<template #popper>
<PublishLanguagePicker v-model="draft.params.language" min-w-80 />
</template>
</CommonDropdown>
</CommonTooltip>
<CommonTooltip placement="top" :content="$t('tooltip.add_content_warning')" no-auto-focus>
<button btn-action-icon :aria-label="$t('tooltip.add_content_warning')" @click="toggleSensitive">
<div v-if="draft.params.sensitive" i-ri:alarm-warning-fill text-orange />
<div v-else i-ri:alarm-warning-line />
</button>
</CommonTooltip>
<PublishVisibilityPicker v-model="draft.params.visibility" :editing="!!draft.editingStatus">
<template #default="{ visibility }">
<button :disabled="!!draft.editingStatus" :aria-label="$t('tooltip.change_content_visibility')" btn-action-icon :class="{ 'w-12': !draft.editingStatus }">
<div :class="visibility.icon" />
<div v-if="!draft.editingStatus" i-ri:arrow-down-s-line text-sm text-secondary me--1 />
</button>
</template>
</PublishVisibilityPicker>
<CommonTooltip v-if="failedMessages.length > 0" id="publish-failed-tooltip" placement="top" :content="$t('tooltip.publish_failed')" no-auto-focus>
<button
btn-danger rounded-3 text-sm w-full flex="~ gap1" items-center md:w-fit aria-describedby="publish-failed-tooltip"
>
<span block>
<div block i-carbon:face-dizzy-filled />
</span>
<span>{{ $t('state.publish_failed') }}</span>
</button>
</CommonTooltip>
<CommonTooltip v-else id="publish-tooltip" placement="top" :content="$t('tooltip.add_publishable_content')" :disabled="!(isPublishDisabled || isExceedingCharacterLimit)" no-auto-focus>
<button
btn-solid rounded-3 text-sm w-full flex="~ gap1" items-center
md:w-fit
class="publish-button"
:aria-disabled="isPublishDisabled || isExceedingCharacterLimit"
aria-describedby="publish-tooltip"
@click="publish"
>
<span v-if="isSending" block animate-spin preserve-3d>
<div block i-ri:loader-2-fill />
</span>
<span v-if="failedMessages.length" block>
<div block i-carbon:face-dizzy-filled />
</span>
<span v-if="draft.editingStatus">{{ $t('action.save_changes') }}</span>
<span v-else-if="draft.params.inReplyToId">{{ $t('action.reply') }}</span>
<span v-else>{{ !isSending ? $t('action.publish') : $t('state.publishing') }}</span>
</button>
</CommonTooltip>
</div>
</div>
</div>
</div>
@ -374,4 +524,18 @@ defineExpose({
background-color: var(--c-bg-btn-disabled);
color: var(--c-text-btn-disabled);
}
.option-input:focus + .delete-button {
display: none;
}
.option-input:not(:focus) + .delete-button + .char-limit-radial {
display: none;
}
.char-limit-radial {
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
}
</style>

View file

@ -5,19 +5,19 @@ const route = useRoute()
const { formatNumber } = useHumanReadableNumber()
const timeAgoOptions = useTimeAgoOptions()
let draftKey = $ref('home')
const draftKey = ref('home')
const draftKeys = $computed(() => Object.keys(currentUserDrafts.value))
const nonEmptyDrafts = $computed(() => draftKeys
.filter(i => i !== draftKey && !isEmptyDraft(currentUserDrafts.value[i]))
const draftKeys = computed(() => Object.keys(currentUserDrafts.value))
const nonEmptyDrafts = computed(() => draftKeys.value
.filter(i => i !== draftKey.value && !isEmptyDraft(currentUserDrafts.value[i]))
.map(i => [i, currentUserDrafts.value[i]] as const),
)
watchEffect(() => {
draftKey = route.query.draft?.toString() || 'home'
draftKey.value = route.query.draft?.toString() || 'home'
})
onMounted(() => {
onDeactivated(() => {
clearEmptyDrafts()
})
</script>

View file

@ -1,9 +1,9 @@
<template>
<button
v-if="$pwa?.needRefresh"
v-if="useNuxtApp().$pwa?.needRefresh"
bg="primary-fade" relative rounded
flex="~ gap-1 center" px3 py1 text-primary
@click="$pwa.updateServiceWorker()"
@click="useNuxtApp().$pwa?.updateServiceWorker()"
>
<div i-ri-download-cloud-2-line />
<h2 flex="~ gap-2" items-center>

View file

@ -1,6 +1,6 @@
<template>
<div
v-if="$pwa?.showInstallPrompt && !$pwa?.needRefresh"
v-if="useNuxtApp().$pwa?.showInstallPrompt && !useNuxtApp().$pwa?.needRefresh"
m-2 p5 bg="primary-fade" relative
rounded-lg of-hidden
flex="~ col gap-3"
@ -10,10 +10,10 @@
{{ $t('pwa.install_title') }}
</h2>
<div flex="~ gap-1">
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="$pwa.install()">
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="useNuxtApp().$pwa?.install()">
{{ $t('pwa.install') }}
</button>
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="$pwa.cancelInstall()">
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="useNuxtApp().$pwa?.cancelInstall()">
{{ $t('pwa.dismiss') }}
</button>
</div>

View file

@ -1,6 +1,6 @@
<template>
<div
v-if="$pwa?.needRefresh"
v-if="useNuxtApp().$pwa?.needRefresh"
m-2 p5 bg="primary-fade" relative
rounded-lg of-hidden
flex="~ col gap-3"
@ -9,10 +9,10 @@
{{ $t('pwa.title') }}
</h2>
<div flex="~ gap-1">
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="$pwa.updateServiceWorker()">
<button type="button" btn-solid px-4 py-1 text-center text-sm @click="useNuxtApp().$pwa?.updateServiceWorker()">
{{ $t('pwa.update') }}
</button>
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="$pwa.close()">
<button type="button" btn-text filter-saturate-0 px-4 py-1 text-center text-sm @click="useNuxtApp().$pwa?.close()">
{{ $t('pwa.dismiss') }}
</button>
</div>

View file

@ -0,0 +1,266 @@
<script setup lang="ts">
import type { mastodon } from 'masto'
import { toggleBlockAccount, toggleFollowAccount, toggleMuteAccount, useRelationship } from '~~/composables/masto/relationship'
const { account, status } = defineProps<{
account: mastodon.v1.Account
status?: mastodon.v1.Status
}>()
const emit = defineEmits<{
(event: 'close'): void
}>()
const { client } = useMasto()
const step = ref('selectCategory')
const serverRules = ref((await client.value.v2.instance.fetch()).rules || [])
const reportReason = ref('')
const selectedRuleIds = ref([])
const availableStatuses = ref(status ? [status] : [])
const selectedStatusIds = ref(status ? [status.id] : [])
const additionalComments = ref('')
const forwardReport = ref(false)
const dismissButton = ref<HTMLDivElement>()
loadStatuses() // Load statuses asynchronously ahead of time
function categoryChosen() {
step.value = reportReason.value === 'dontlike' ? 'furtherActions' : 'selectStatuses'
resetModal()
}
async function loadStatuses() {
if (status) {
// Load the 5 statuses before and after the reported status
const prevStatuses = await client.value.v1.accounts.$select(account.id).statuses.list({
maxId: status.id,
limit: 5,
})
const nextStatuses = await client.value.v1.accounts.$select(account.id).statuses.list({
minId: status.id,
limit: 5,
})
availableStatuses.value = availableStatuses.value.concat(prevStatuses)
availableStatuses.value = availableStatuses.value.concat(nextStatuses)
}
else {
// Reporting an account directly
// Load the 10 most recent statuses
const mostRecentStatuses = await client.value.v1.accounts.$select(account.id).statuses.list({
limit: 10,
})
availableStatuses.value = mostRecentStatuses
}
availableStatuses.value.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
}
async function submitReport() {
await client.value.v1.reports.create({
accountId: account.id,
statusIds: selectedStatusIds.value,
comment: additionalComments.value,
forward: forwardReport.value,
category: reportReason.value === 'spam' ? 'spam' : reportReason.value === 'violation' ? 'violation' : 'other',
ruleIds: reportReason.value === 'violation' ? selectedRuleIds.value : null,
})
step.value = 'furtherActions'
resetModal()
}
function unfollow() {
emit('close')
toggleFollowAccount(useRelationship(account).value!, account)
}
function mute() {
emit('close')
toggleMuteAccount(useRelationship(account).value!, account)
}
function block() {
emit('close')
toggleBlockAccount(useRelationship(account).value!, account)
}
function resetModal() {
// TODO: extract this scroll/reset logic into ModalDialog element
dismissButton.value?.scrollIntoView() // scroll to top
}
</script>
<template>
<div my-8 px-3 sm:px-8 flex="~ col gap-4" relative>
<h2 mxa text-xl>
<i18n-t :keypath="reportReason === 'dontlike' ? 'report.limiting' : 'report.reporting'">
<b text-primary>@{{ account.acct }}</b>
</i18n-t>
</h2>
<button ref="dismissButton" btn-action-icon absolute top--8 right-0 m1 aria-label="Close" @click="emit('close')">
<div i-ri:close-line />
</button>
<template v-if="step === 'selectCategory'">
<h1 mxa text-4xl mb4>
{{ status ? $t('report.whats_wrong_post') : $t('report.whats_wrong_account') }}
</h1>
<p text-xl>
{{ $t('report.select_one') }}
</p>
<div>
<input id="dontlike" v-model="reportReason" type="radio" value="dontlike">
<label pl-2 for="dontlike" font-bold>{{ $t('report.dontlike') }}</label>
<p pl-6>
{{ $t('report.dontlike_desc') }}
</p>
</div>
<div>
<input id="spam" v-model="reportReason" type="radio" value="spam">
<label pl-2 for="spam" font-bold>{{ $t('report.spam') }}</label>
<p pl-6>
{{ $t('report.spam_desc') }}
</p>
</div>
<div v-if="serverRules.length > 0">
<input id="violation" v-model="reportReason" type="radio" value="violation">
<label pl-2 for="violation" font-bold>{{ $t('report.violation') }}</label>
<p v-if="reportReason === 'violation'" pl-6 pt-2 text-primary font-bold>
{{ $t('report.select_many') }}
</p>
<ul pl-6>
<li v-for="rule in serverRules" :key="rule.id" pt-2>
<input
:id="rule.id"
v-model="selectedRuleIds"
type="checkbox"
:value="rule.id"
:disabled="reportReason !== 'violation'"
>
<label pl-2 :for="rule.id">{{ rule.text }}</label>
</li>
</ul>
</div>
<div>
<input id="other" v-model="reportReason" type="radio" value="other">
<label pl-2 for="other" font-bold>{{ $t('report.other') }}</label>
<p pl-6>
{{ $t('report.other_desc') }}
</p>
</div>
<div v-if="reportReason && reportReason !== 'dontlike'">
<h3 mt-8 mb-4 font-bold>
{{ $t('report.anything_else') }}
</h3>
<textarea v-model="additionalComments" w-full h-20 p-3 border :placeholder="$t('report.additional_comments')" />
<div v-if="getServerName(account) && getServerName(account) !== currentServer">
<h3 mt-8 mb-2 font-bold>
{{ $t('report.another_server') }}
</h3>
<p pb-1>
{{ $t('report.forward_question') }}
</p>
<input id="forward" v-model="forwardReport" type="checkbox" value="rule.id">
<label pl-2 for="forward"><b>{{ $t('report.forward', [getServerName(account)]) }}</b></label>
</div>
</div>
<button
btn-solid mxa mt-10
:disabled="!reportReason || (reportReason === 'violation' && selectedRuleIds.length < 1)"
@click="categoryChosen()"
>
{{ $t('action.next') }}
</button>
</template>
<template v-else-if="step === 'selectStatuses'">
<h1 mxa text-4xl mb4>
{{ status ? $t('report.select_posts_other') : $t('report.select_posts') }}
</h1>
<p text-primary font-bold>
{{ $t('report.select_many') }}
</p>
<table>
<tr v-for="availableStatus in availableStatuses" :key="availableStatus.id">
<td>
<input
:id="availableStatus.id"
v-model="selectedStatusIds"
type="checkbox"
:value="availableStatus.id"
>
</td>
<td>
<label :for="availableStatus.id">
<StatusCard :status="availableStatus" :actions="false" pointer-events-none />
</label>
</td>
</tr>
</table>
<button
btn-solid mxa mt-5
@click="submitReport()"
>
{{ $t('report.submit') }}
</button>
</template>
<template v-else-if="step === 'furtherActions'">
<h1 mxa text-4xl mb4>
{{ reportReason === 'dontlike' ? $t('report.further_actions.limit.title') : $t('report.further_actions.report.title') }}
</h1>
<p text-xl>
{{ reportReason === 'dontlike' ? $t('report.further_actions.limit.description') : $t('report.further_actions.report.description') }}
</p>
<div v-if="useRelationship(account).value?.following">
<button btn-outline mxa mt-4 mb-2 @click="unfollow()">
<i18n-t keypath="menu.unfollow_account">
<b>@{{ account.acct }}</b>
</i18n-t>
</button><br>
{{ $t('report.unfollow_desc') }}
</div>
<div v-if="!useRelationship(account).value?.muting">
<button btn-outline mxa mt-4 mb-2 @click="mute()">
<i18n-t keypath="menu.mute_account">
<b>@{{ account.acct }}</b>
</i18n-t>
</button><br>
{{ $t('report.mute_desc') }}
</div>
<div v-if="!useRelationship(account).value?.blocking">
<button btn-outline mxa mt-4 mb-2 @click="block()">
<i18n-t keypath="menu.block_account">
<b>@{{ account.acct }}</b>
</i18n-t>
</button><br>
{{ $t('report.block_desc') }}
</div>
<button btn-solid mxa mt-10 @click="emit('close')">
{{ $t('action.done') }}
</button>
</template>
</div>
</template>
<style>
tr {
border-bottom-width: 1px;
}
tr:last-child {
border: none;
}
td {
padding-top: 10px;
padding-bottom: 10px;
}
</style>

View file

@ -6,12 +6,15 @@ defineProps<{
}>()
</script>
<!-- TODO: reuse AccountInfo.vue -->
<template>
<div flex gap-2 items-center>
<AccountAvatar w-10 h-10 :account="account" shrink-0 />
<div flex="~ col gap1" shrink h-full overflow-hidden leading-none>
<div flex="~" gap-2>
<AccountDisplayName :account="account" line-clamp-1 ws-pre-wrap break-all text-base />
<AccountLockIndicator v-if="account.locked" text-xs />
<AccountBotIndicator v-if="account.bot" text-xs />
</div>
<AccountHandle text-sm :account="account" text-secondary-light />

View file

@ -5,7 +5,7 @@ const { hashtag } = defineProps<{
hashtag: mastodon.v1.Tag
}>()
const totalTrend = $computed(() =>
const totalTrend = computed(() =>
hashtag.history?.reduce((total: number, item) => total + (Number(item.accounts) || 0), 0),
)
</script>

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