Skip to content

Commit

Permalink
chore: merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Cl0v1s committed Feb 8, 2025
2 parents eb6cd9d + fed5701 commit 2d0310a
Show file tree
Hide file tree
Showing 16 changed files with 70 additions and 44 deletions.
2 changes: 1 addition & 1 deletion elk/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ We've added some `UnoCSS` utilities styles to help you with that:

We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://v8.i18n.nuxtjs.org/) to handle internationalization.

You can check the current [translation status](https://docs.elk.zone/docs/guide/contributing#translation-status): more instructions on the table caption.
You can check the current [translation status](https://docs.elk.zone/guide/contributing#translation-status): more instructions on the table caption.

If you are updating a translation in your local environment, you can run the following commands to check the status:
- from root folder: `nr prepare-translation-status`
Expand Down
7 changes: 5 additions & 2 deletions elk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ WORKDIR /elk

FROM base AS builder

# Prepare yarn
RUN corepack enable
# Prepare pnpm https://pnpm.io/installation#using-corepack
# workaround for npm registry key change
# ref. `[email protected]` / `[email protected]` cannot be installed due to key id mismatch · Issue #612 · nodejs/corepack
# - https://github.com/nodejs/corepack/issues/612#issuecomment-2629496091
RUN npm i -g corepack@latest && corepack enable

# Prepare deps
RUN apk update
Expand Down
2 changes: 1 addition & 1 deletion elk/components/modal/ModalConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function handleChoice(choice: ConfirmDialogChoice['choice']) {
</div>
<div v-if="isMute" flex-col flex gap-4>
<CommonCheckbox v-model="hasDuration" :label="$t('confirm.mute_account.specify_duration')" prepend-checkbox checked-icon-color="text-primary" />
<DurationPicker v-if="hasDuration" v-model="duration" v-model:is-valid="isValidDuration" />
<ModalDurationPicker v-if="hasDuration" v-model="duration" v-model:is-valid="isValidDuration" />
<CommonCheckbox v-model="shouldMuteNotifications" :label="$t('confirm.mute_account.notifications')" prepend-checkbox checked-icon-color="text-primary" />
</div>

Expand Down
4 changes: 4 additions & 0 deletions elk/components/status/StatusPoll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ async function vote(e: Event) {
}
async function refresh() {
if (loading.value) {
return
}
loading.value = true
try {
const newPoll = await client.value.v1.polls.$select(poll.id).fetch()
Expand Down
2 changes: 1 addition & 1 deletion elk/components/status/StatusPreviewCardNormal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function loadAttachment() {
<StatusPreviewCardInfo :p="isSquare ? 'x-4' : '4'" :root="root" :card="card" :provider="providerName" />
</div>
<StatusPreviewCardMoreFromAuthor
v-if="card?.authors?.[0].account"
v-if="card?.authors?.[0]?.account"
:account="card.authors[0].account"
/>
</NuxtLink>
Expand Down
11 changes: 1 addition & 10 deletions elk/composables/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { akkoma } from '@bdxtown/akko'
import { STORAGE_KEY_FIRST_VISIT } from '~/constants'
import type { ConfirmDialogChoice, ConfirmDialogOptions, DraftItem, ErrorDialogData } from '~/types'

export const confirmDialogChoice = ref<ConfirmDialogChoice>()
Expand All @@ -17,14 +16,12 @@ export const reportStatus = ref<akkoma.v1.Status>()

export const commandPanelInput = ref('')

export const isFirstVisit = useLocalStorage(STORAGE_KEY_FIRST_VISIT, !process.mock)

export const isSigninDialogOpen = ref(false)
export const isPublishDialogOpen = ref(false)
export const isKeyboardShortcutsDialogOpen = ref(false)
export const isMediaPreviewOpen = ref(false)
export const isEditHistoryDialogOpen = ref(false)
export const isPreviewHelpOpen = ref(isFirstVisit.value)
export const isPreviewHelpOpen = ref(false)
export const isCommandPanelOpen = ref(false)
export const isConfirmDialogOpen = ref(false)
export const isErrorDialogOpen = ref(false)
Expand Down Expand Up @@ -77,12 +74,6 @@ export async function openFavoridedBoostedByDialog(statusId: string) {
favouritedBoostedByStatusId.value = statusId
}

if (isPreviewHelpOpen.value) {
watch(isPreviewHelpOpen, () => {
isFirstVisit.value = false
})
}

function restoreMediaPreviewFromState() {
mediaPreviewList.value = JSON.parse(history.state?.mediaPreviewList ?? '[]')
mediaPreviewIndex.value = history.state?.mediaPreviewIndex ?? 0
Expand Down
3 changes: 2 additions & 1 deletion elk/composables/tiptap/shiki-parser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Parser } from 'prosemirror-highlight/shiki'
import type { BuiltinLanguage } from 'shiki'
import { createParser, type Parser } from 'prosemirror-highlight/shiki'
import { createParser } from 'prosemirror-highlight/shiki'

let parser: Parser | undefined

Expand Down
1 change: 0 additions & 1 deletion elk/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const STORAGE_KEY_SERVERS = 'elk-servers'
export const STORAGE_KEY_NODES = 'elk-nodes'
export const STORAGE_KEY_CURRENT_USER_HANDLE = 'elk-current-user-handle'
export const STORAGE_KEY_NOTIFY_TAB = 'elk-notify-tab'
export const STORAGE_KEY_FIRST_VISIT = 'elk-first-visit'
export const STORAGE_KEY_SETTINGS = 'elk-settings'
export const STORAGE_KEY_CUSTOM_EMOJIS = 'elk-custom-emojis'
export const STORAGE_KEY_HIDE_EXPLORE_POSTS_TIPS = 'elk-hide-explore-posts-tips'
Expand Down
8 changes: 8 additions & 0 deletions elk/locales/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"switch_account": "Account wechseln",
"vote": "Abstimmen"
},
"actions": {
"more": "Mehr"
},
"app_desc_short": "Ein flinker Mastodon Web-Client",
"app_logo": "Elk Logo",
"app_name": "Elk",
Expand Down Expand Up @@ -654,6 +657,10 @@
"list": "Liste",
"media": "Medien",
"news": "Nachrichten",
"notifications_admin": {
"report": "Meldung",
"sign_up": "Registrierung"
},
"notifications_all": "Alle",
"notifications_favourite": "Favorisiert",
"notifications_follow": "Folgen",
Expand Down Expand Up @@ -722,6 +729,7 @@
"change_content_visibility": "Sichtbarkeit von Inhalten ändern",
"change_language": "Sprache ändern",
"emoji": "Emoji",
"emojis": "Emojis",
"explore_links_intro": "Diese Nachrichten werden gerade von Leuten auf diesem und anderen Servern des dezentralen Netzwerks besprochen.",
"explore_posts_intro": "Diese Beiträge von diesem Server gewinnen gerade unter den Leuten von diesem und anderen Servern des dezentralen Netzwerks an Reichweite.",
"explore_tags_intro": "Diese Hashtags gewinnen gerade unter den Leuten von diesem und anderen Servern des dezentralen Netzweks an Reichweite.",
Expand Down
3 changes: 2 additions & 1 deletion elk/locales/eu-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@
"poll": {
"count": "{0} boto|boto {0}|{0} boto",
"ends": "epemuga: {0}",
"finished": "amaiera: {0}"
"finished": "amaiera: {0}",
"update": "Freskatu"
},
"replying_to": "{0}(r)i erantzunez",
"show_full_thread": "Erakutsi hari osoa",
Expand Down
5 changes: 3 additions & 2 deletions elk/locales/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,8 @@
"poll": {
"count": "{0} voti|{0} voto|{0} voti",
"ends": "termina {0}",
"finished": "terminato {0}"
"finished": "terminato {0}",
"update": "Aggiorna sondaggio"
},
"replying_to": "In risposta a {0}",
"show_full_thread": "Mostra discussione",
Expand Down Expand Up @@ -749,7 +750,7 @@
"add_existing": "Aggiungi account esistente",
"server_address_label": "Indirizzo istanza Mastodon",
"sign_in_desc": "Accedi per seguire profili o hashtag, apprezzare, condividere e rispondere a post o interagire dal tuo account su un'altra istanza.",
"sign_in_notice_title": "Visualizzando {0} dati pubblici",
"sign_in_notice_title": "Visualizzando i dati pubblici di {0}",
"sign_out_account": "Esci {0}",
"single_instance_sign_in_desc": "Accedi per seguire profili o hastag, apprezzare condividere o rispondere a post.",
"tip_no_account": "Se ancora non hai un account Mastodon, {0}.",
Expand Down
5 changes: 3 additions & 2 deletions elk/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
"favourite": "Favoritos",
"follow": "Novos seguidores",
"mention": "Menções",
"poll": "Votações",
"poll": "Sondagens",
"reblog": "Partilha das sua publicação",
"title": "Que notificações quer receber?"
},
Expand Down Expand Up @@ -639,7 +639,8 @@
"poll": {
"count": "{0} votos|{0} voto|{0} votos",
"ends": "termina {0}",
"finished": "terminou {0}"
"finished": "terminou {0}",
"update": "Atualizar sondagem"
},
"replying_to": "Em resposta a {0}",
"show_full_thread": "Mostrar toda a conversa",
Expand Down
27 changes: 26 additions & 1 deletion elk/locales/tl-PH.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"boost": "I-boost",
"boost_count": "{0} nag-boost",
"boosted": "Nai-boost na",
"clear": "I-clear",
"clear_publish_failed": "I-clear ang mga error sa pag-publish",
"clear_save_failed": "I-clear ang mga error sa pag-save",
"clear_upload_failed": "I-clear ang mga error sa pag-upload ng file",
Expand All @@ -72,8 +73,10 @@
"favourited": "Nai-favorite na",
"more": "Iba pa",
"next": "Susunod",
"open_image_preview_dialog": "Buksan ang image preview",
"prev": "Nakaraan",
"publish": "I-publish",
"publish_thread": "I-publish ang thread",
"reply": "Sumagot",
"reply_count": "{0} sumagot",
"reset": "I-reset",
Expand Down Expand Up @@ -220,6 +223,7 @@
"error": "Mayroong error sa paglikha ng listahan",
"error_prefix": "Error: ",
"list_title_placeholder": "Pangalan ng listahan",
"manage": "I-manage",
"modify_account": "Baguhin ang mga listahan sa account",
"remove_account": "Tanggalin ang account sa listahan",
"save": "I-save ang mga pagbabago"
Expand Down Expand Up @@ -306,6 +310,7 @@
"built_at": "Build version mula noong {0}",
"compose": "Lumikha ng Mensahe",
"conversations": "Mga Usapang Pribado",
"docs": "Dokumentasyon",
"explore": "Mag-Explore",
"favourites": "Mga Paborito",
"federated": "Pederal",
Expand All @@ -314,6 +319,7 @@
"list": "Listahan",
"lists": "Mga Listahan",
"local": "Lokal",
"more_menu": "Higit pang menu",
"muted_users": "Mga Naka-Mute na User",
"notifications": "Mga Abiso",
"privacy": "Privacy",
Expand All @@ -328,11 +334,14 @@
"zen_mode": "Zen Mode"
},
"notification": {
"and": "at",
"favourited_post": "nag-favorite ng iyong post",
"followed_you": "nag-follow sa iyo",
"followed_you_count": "{0} na tao ang nag-follow sa iyo|{0} na tao ang nag-follow sa iyo|{0} na tao ang nag-follow sa iyo",
"missing_type": "MISSING notification.type:",
"others": "{0} iba pa|{0} iba pa|{0} iba pa",
"reblogged_post": "bumoost ng iyong post",
"reported": "ni-report ni {0} si {1}",
"request_to_follow": "humiling na sumunod sa iyo",
"signed_up": "nag-sign up",
"update_status": "nag-update ng kanilang post"
Expand Down Expand Up @@ -447,6 +456,8 @@
"label": "Mga account setting"
},
"interface": {
"bottom_nav": "Ibabang Nabigasyon",
"bottom_nav_instructions": "Pumili ng hanggang limang navigation button para sa ibabang nabigasyon. Dapat isama ang button na \"Higit pang menu.\"",
"color_mode": "Mode ng Kulay",
"dark_mode": "Madilim",
"default": " (default)",
Expand All @@ -458,6 +469,7 @@
},
"language": {
"display_language": "Ipakita ang Wika",
"how_to_contribute": "Paano mag-contribute?",
"label": "Wika",
"post_language": "Posting Language",
"status": "Kalagayan ng Pagsasalin: {0}/{1} ({2}%)",
Expand Down Expand Up @@ -539,6 +551,7 @@
"hide_boost_count": "Itago ang boost count",
"hide_react_count": "Itago ang favorite count",
"hide_follower_count": "Itago ang following/follower count",
"hide_gif_indi_on_posts": "Itago ang indicator ng mga GIF",
"hide_news": "Itago ang mga balita",
"hide_reply_count": "Itago ang reply count",
"hide_tag_hover_card": "Itago ang tag hover card",
Expand All @@ -552,6 +565,7 @@
"user_picker": "Pagpipilian na mga Account",
"user_picker_description": "Ipakita ang mga avatar ng mga naka-login na account sa kaliwang ibaba para makalipat sa mga ito.",
"virtual_scroll": "Virtual na Scrolling",
"virtual_scroll_description": "Gumamit ng isang virtual list sa mga timeline, upang ang mas marami pang mga items ang mai-render nang mas mabilis.",
"wellbeing": "Kalusugan at Kagalingan",
"zen_mode": "Modong Zen",
"zen_mode_description": "Itago ang ibang mga elemento sa timeline at mga asides maliban kung naka-focus ang mouse cursor sa kanila."
Expand Down Expand Up @@ -589,7 +603,11 @@
},
"state": {
"attachments_exceed_server_limit": "Nalagpasan na ang bilang ng mga attachments na pinapayagan bawat post.",
"attachments_limit_audio_error": "Lumagpas sa limit ng audio file size: {0}",
"attachments_limit_error": "Lumagpas sa limitasyon bawat post",
"attachments_limit_image_error": "Lumagpas sa limit ng image file size: {0}",
"attachments_limit_unknown_error": "Lumagpas sa limit ng file size: {0}",
"attachments_limit_video_error": "Lumagpas sa limit ng video file size: {0}",
"edited": "(Naedit)",
"editing": "Pinaeedit",
"loading": "Nagloload...",
Expand All @@ -610,16 +628,19 @@
"favourited_by": "Pumaborito si",
"filter_hidden_phrase": "Nakafilter dahil sa",
"filter_show_anyway": "Ipakita pa rin",
"gif": "GIF",
"img_alt": {
"ALT": "ALT",
"desc": "Paglalarawan",
"dismiss": "I-dismiss",
"read": "Basahin ang {0} paglalarawan"
},
"pinned": "Naka-pin",
"poll": {
"count": "{0} boto|{0} boto|{0} mga boto",
"ends": "magtatapos {0}",
"finished": "natapos {0}"
"finished": "natapos {0}",
"update": "I-update ang poll"
},
"replying_to": "Sumasagot kay {0}",
"show_full_thread": "Ipakita ang buong thread",
Expand Down Expand Up @@ -696,6 +717,7 @@
"year_past": "0 taon na ang nakalipas|nakaraang taon|{n} taon na ang nakalipas"
},
"timeline": {
"no_posts": "Walang mga post dito!",
"show_new_items": "Ipakita ang {v} bagong item|Ipakita ang {v} bagong item|Ipakita ang {v} bagong item",
"view_older_posts": "Maaaring hindi ipakita ang mga lumang post mula sa ibang pagkakataon."
},
Expand All @@ -708,6 +730,7 @@
"add_emojis": "Magdagdag ng mga emoji",
"add_media": "Magdagdag ng mga larawan, isang video o isang audio file",
"add_publishable_content": "Magdagdag ng nilalamang ilalathala",
"add_thread_item": "Magdagdag ng item sa thread",
"change_content_visibility": "Baguhin ang visibility ng nilalaman",
"change_language": "Baguhin ang wika",
"emoji": "Emoji",
Expand All @@ -717,6 +740,8 @@
"open_editor_tools": "Mga tool sa editor",
"pick_an_icon": "Pumili ng icon",
"publish_failed": "Isara ang mga nabigong mensahe sa tuktok ng editor upang muling i-publish ang mga post",
"remove_thread_item": "Mag-tanggal ng item sa thread",
"start_thread": "Magsimula ng thread",
"toggle_bold": "I-toggle ang bold",
"toggle_code_block": "I-toggle ang block ng code",
"toggle_italic": "I-toggle ang italic"
Expand Down
12 changes: 7 additions & 5 deletions elk/locales/vi-VN.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,16 @@
"zen_mode": "Tập Trung"
},
"notification": {
"favourited_post": "thích tút của bạn",
"followed_you": "theo dõi bạn",
"and": "",
"favourited_post": "đã thích tút của bạn",
"followed_you": "đã theo dõi bạn",
"followed_you_count": "{0} người theo dõi bạn|{0} người theo dõi bạn|{0} người theo dõi bạn",
"missing_type": "THIẾU notification.type:",
"reblogged_post": "đăng lại tút của bạn",
"reported": "{0} báo cáo {1}",
"others": "{0} người khác|{0} người khác|{0} người khác",
"reblogged_post": "đã đăng lại tút của bạn",
"reported": "{0} đã báo cáo {1}",
"request_to_follow": "yêu cầu theo dõi bạn",
"signed_up": "tham gia máy chủ",
"signed_up": "đã tham gia máy chủ",
"update_status": "cập nhật tút"
},
"placeholder": {
Expand Down
19 changes: 4 additions & 15 deletions elk/modules/pwa/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
import type { Buffer } from 'node:buffer'
import type { Plugin } from 'vite'
import type { ManifestOptions, VitePluginPWAAPI } from 'vite-plugin-pwa'
import type { VitePluginPWAAPI } from 'vite-plugin-pwa'
import type { VitePWANuxtOptions } from './types'
import { mkdir, readFile, writeFile } from 'node:fs/promises'
import { dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
import { mkdir, writeFile } from 'node:fs/promises'
import { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'
import { join, resolve } from 'pathe'
import { join } from 'pathe'
import { VitePWA } from 'vite-plugin-pwa'
import { configurePWAOptions } from './config'
import { createI18n, type LocalizedWebManifest, pwaLocales } from './i18n'
import { createI18n, pwaLocales } from './i18n'

export * from './types'

interface PwaDevIcon {
src: string
type: string
}

interface ResolvedPwaDevIcon extends PwaDevIcon {
data: Promise<Buffer>
}

export default defineNuxtModule<VitePWANuxtOptions>({
meta: {
name: 'elk-pwa',
Expand Down
3 changes: 2 additions & 1 deletion elk/utils/elk-idb.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { UseStore } from 'idb-keyval'
import {
del as delIdb,
get as getIdb,
promisifyRequest,
set as setIdb,
update as updateIdb,
type UseStore,

} from 'idb-keyval'

const databases: IDBOpenDBRequest[] = []
Expand Down

0 comments on commit 2d0310a

Please sign in to comment.