mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
chore: ⬆️ Upgrade dependencies
This commit is contained in:
parent
3e28801709
commit
7649ecfb80
14 changed files with 947 additions and 627 deletions
|
|
@ -3,15 +3,28 @@
|
|||
<Note :note="relation.note" :hide-actions="true" :small-layout="true" />
|
||||
</div>
|
||||
|
||||
<Input v-model:model-value="state.contentWarning" v-if="state.sensitive"
|
||||
placeholder="Put your content warning here" />
|
||||
<Input
|
||||
v-model:model-value="state.contentWarning"
|
||||
v-if="state.sensitive"
|
||||
placeholder="Put your content warning here"
|
||||
/>
|
||||
|
||||
<EditorContent v-model:content="state.content" :placeholder="chosenSplash"
|
||||
<EditorContent
|
||||
v-model:content="state.content"
|
||||
:placeholder="chosenSplash"
|
||||
class="*:!border-none *:!ring-0 *:!outline-none *:rounded-none p-0 *:max-h-[50dvh] *:overflow-y-auto *:min-h-48 *:!ring-offset-0 *:h-full"
|
||||
:disabled="sending" :mode="state.contentType === 'text/html' ? 'rich' : 'plain'" />
|
||||
:disabled="sending"
|
||||
:mode="state.contentType === 'text/html' ? 'rich' : 'plain'"
|
||||
/>
|
||||
|
||||
<div class="w-full flex flex-row gap-2 overflow-x-auto *:shrink-0 pb-2">
|
||||
<input type="file" ref="fileInput" @change="uploadFileFromEvent" class="hidden" multiple />
|
||||
<input
|
||||
type="file"
|
||||
ref="fileInput"
|
||||
@change="uploadFileFromEvent"
|
||||
class="hidden"
|
||||
multiple
|
||||
/>
|
||||
<Files v-model:files="state.files" />
|
||||
</div>
|
||||
|
||||
|
|
@ -28,11 +41,15 @@
|
|||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as="div">
|
||||
<Toggle variant="default" size="sm" :pressed="state.contentType === 'text/html'" @update:pressed="(i) =>
|
||||
(state.contentType = i
|
||||
? 'text/html'
|
||||
: 'text/plain')
|
||||
">
|
||||
<Toggle
|
||||
variant="default"
|
||||
size="sm"
|
||||
:pressed="state.contentType === 'text/html'"
|
||||
@update:pressed="
|
||||
(i) =>
|
||||
(state.contentType = i ? 'text/html' : 'text/plain')
|
||||
"
|
||||
>
|
||||
<LetterText class="!size-5" />
|
||||
</Toggle>
|
||||
</TooltipTrigger>
|
||||
|
|
@ -41,14 +58,27 @@
|
|||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<Select v-model:model-value="state.visibility">
|
||||
<SelectTrigger :as-child="true" :disabled="relation?.type === 'edit'">
|
||||
<SelectTrigger
|
||||
:as-child="true"
|
||||
:disabled="relation?.type === 'edit'"
|
||||
>
|
||||
<Button variant="ghost" size="icon">
|
||||
<component :is="visibilities[state.visibility].icon" class="!size-5" />
|
||||
<component
|
||||
:is="visibilities[state.visibility].icon"
|
||||
class="!size-5"
|
||||
/>
|
||||
</Button>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem v-for="(v, k) in visibilities" :key="k" @click="state.visibility = k" :value="k">
|
||||
<div class="flex flex-row gap-4 items-center w-full justify-between">
|
||||
<SelectItem
|
||||
v-for="(v, k) in visibilities"
|
||||
:key="k"
|
||||
@click="state.visibility = k"
|
||||
:value="k"
|
||||
>
|
||||
<div
|
||||
class="flex flex-row gap-4 items-center w-full justify-between"
|
||||
>
|
||||
<div class="flex flex-col gap-1">
|
||||
<span class="font-semibold">{{ v.name }}</span>
|
||||
<span>{{ v.text }}</span>
|
||||
|
|
@ -80,7 +110,11 @@
|
|||
</Tooltip>
|
||||
<Tooltip>
|
||||
<TooltipTrigger as="div">
|
||||
<Toggle variant="default" size="sm" v-model:pressed="state.sensitive">
|
||||
<Toggle
|
||||
variant="default"
|
||||
size="sm"
|
||||
v-model:pressed="state.sensitive"
|
||||
>
|
||||
<TriangleAlert class="!size-5" />
|
||||
</Toggle>
|
||||
</TooltipTrigger>
|
||||
|
|
@ -88,7 +122,13 @@
|
|||
<p>{{ m.frail_broad_mallard_dart() }}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<Button type="submit" size="lg" class="ml-auto" :disabled="sending" @click="submit">
|
||||
<Button
|
||||
type="submit"
|
||||
size="lg"
|
||||
class="ml-auto"
|
||||
:disabled="sending"
|
||||
@click="submit"
|
||||
>
|
||||
<Loader v-if="sending" class="!size-5 animate-spin" />
|
||||
{{
|
||||
relation?.type === "edit"
|
||||
|
|
@ -123,7 +163,9 @@ import EditorContent from "../editor/content.vue";
|
|||
import { Button } from "../ui/button";
|
||||
import { Input } from "../ui/input";
|
||||
import { Toggle } from "../ui/toggle";
|
||||
import { DialogFooter } from "../ui/dialog";
|
||||
import Files from "./files.vue";
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
|
||||
|
||||
const { Control_Enter, Command_Enter } = useMagicKeys();
|
||||
const ctrlEnterSend = useSetting(SettingIds.CtrlEnterToSend);
|
||||
|
|
@ -179,7 +221,7 @@ const state = reactive({
|
|||
contentType: "text/html" as "text/html" | "text/plain",
|
||||
visibility: (relation?.type === "edit"
|
||||
? relation.note.visibility
|
||||
: (defaultVisibility.value.value ?? "public")) as Status["visibility"],
|
||||
: defaultVisibility.value.value ?? "public") as Status["visibility"],
|
||||
files: (relation?.type === "edit"
|
||||
? relation.note.media_attachments.map((a) => ({
|
||||
apiId: a.id,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<script setup lang="ts">
|
||||
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import type { Status, StatusSource } from "@versia/client/types";
|
||||
import { toast } from "vue-sonner";
|
||||
import * as m from "~/paraglide/messages.js";
|
||||
|
|
@ -55,26 +60,43 @@ const relation = ref(
|
|||
type: "reply" | "quote" | "edit";
|
||||
note: Status;
|
||||
source?: StatusSource;
|
||||
} | null,
|
||||
} | null
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model:open="open" @update:open="o => {
|
||||
if (!o) {
|
||||
relation = null; // Unfocus the active element
|
||||
activeElement?.blur();
|
||||
}
|
||||
}">
|
||||
<DialogContent :hide-close="true"
|
||||
class="sm:max-w-xl max-w-full w-[calc(100%-2*0.5rem)] grid-rows-[minmax(0,1fr)_auto] max-h-[90dvh] p-5 pt-6 top-2 sm:top-1/2 translate-y-0 sm:-translate-y-1/2 rounded">
|
||||
<Dialog
|
||||
v-model:open="open"
|
||||
@update:open="
|
||||
(o) => {
|
||||
if (!o) {
|
||||
relation = null; // Unfocus the active element
|
||||
activeElement?.blur();
|
||||
}
|
||||
}
|
||||
"
|
||||
>
|
||||
<DialogContent
|
||||
:hide-close="true"
|
||||
class="sm:max-w-xl max-w-full w-[calc(100%-2*0.5rem)] grid-rows-[minmax(0,1fr)_auto] max-h-[90dvh] p-5 pt-6 top-2 sm:top-1/2 translate-y-0 sm:-translate-y-1/2 rounded"
|
||||
>
|
||||
<DialogTitle class="sr-only">
|
||||
{{ relation?.type === "reply" ? m.loved_busy_mantis_slide() : relation?.type === "quote" ? "Quote" :
|
||||
m.chunky_dull_marlin_trip() }}
|
||||
{{
|
||||
relation?.type === "reply"
|
||||
? m.loved_busy_mantis_slide()
|
||||
: relation?.type === "quote"
|
||||
? "Quote"
|
||||
: m.chunky_dull_marlin_trip()
|
||||
}}
|
||||
</DialogTitle>
|
||||
<DialogDescription class="sr-only">
|
||||
{{ relation?.type === "reply" ? m.tired_grassy_vulture_forgive() : relation?.type === "quote" ?
|
||||
m.livid_livid_nils_snip() : m.brief_cool_capybara_fear() }}
|
||||
{{
|
||||
relation?.type === "reply"
|
||||
? m.tired_grassy_vulture_forgive()
|
||||
: relation?.type === "quote"
|
||||
? m.livid_livid_nils_snip()
|
||||
: m.brief_cool_capybara_fear()
|
||||
}}
|
||||
</DialogDescription>
|
||||
<Composer :relation="relation ?? undefined" />
|
||||
</DialogContent>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue