mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 11:39:16 +01:00
refactor: ⬆️ Update @lysand-org/client to 0.2.0, use its types instead
This commit is contained in:
parent
cd1fb48b68
commit
8a984abfb2
75 changed files with 63 additions and 640 deletions
|
|
@ -46,9 +46,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Instance, Status } from "@lysand-org/client/types";
|
||||
import { nanoid } from "nanoid";
|
||||
import type { Instance } from "~/types/mastodon/instance";
|
||||
import type { Status } from "~/types/mastodon/status";
|
||||
import { OverlayScrollbarsComponent } from "#imports";
|
||||
import type FileUploader from "./file-uploader.vue";
|
||||
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Emoji } from "@lysand-org/client/types";
|
||||
import { distance } from "fastest-levenshtein";
|
||||
import type { CustomEmoji } from "~/composables/Identities";
|
||||
const props = defineProps<{
|
||||
currentlyTypingEmoji: string | null;
|
||||
textarea: HTMLTextAreaElement | undefined;
|
||||
|
|
@ -30,7 +30,7 @@ const { Tab, ArrowRight, ArrowLeft, Enter } = useMagicKeys({
|
|||
},
|
||||
});
|
||||
const identity = useCurrentIdentity();
|
||||
const topEmojis = ref<CustomEmoji[] | null>(null);
|
||||
const topEmojis = ref<Emoji[] | null>(null);
|
||||
const selectedEmojiIndex = ref<number | null>(null);
|
||||
|
||||
watchEffect(() => {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Account } from "@lysand-org/client/types";
|
||||
import { distance } from "fastest-levenshtein";
|
||||
import type { Account } from "~/types/mastodon/account";
|
||||
const props = defineProps<{
|
||||
currentlyTypingMention: string | null;
|
||||
textarea: HTMLTextAreaElement | undefined;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
|
||||
<div class="mt-3 px-4">
|
||||
<InputsRichTextbox v-model:model-content="note" :max-characters="noteCharacterLimit" :disabled="loading"
|
||||
<InputsRichTextbox v-model:model-content="note" :max-characters="bio" :disabled="loading"
|
||||
class="rounded ring-white/10 ring-2 focus:ring-primary-600 px-4 py-2 max-h-[40dvh] max-w-full" />
|
||||
</div>
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ const account = computed(() => identity.value?.account);
|
|||
const note = ref(account.value?.source?.note ?? "");
|
||||
const displayName = ref(account.value?.display_name ?? "");
|
||||
const acct = ref(account.value?.acct ?? "");
|
||||
const noteCharacterLimit = computed(
|
||||
const bio = computed(
|
||||
() => identity.value?.instance.configuration.statuses.max_characters ?? 0,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { Dialog } from "@ark-ui/vue";
|
||||
import type { Attachment } from "~/types/mastodon/attachment";
|
||||
import type { Attachment } from "@lysand-org/client/types";
|
||||
|
||||
const lightbox = ref(false);
|
||||
const attachment = ref<Attachment | null>(null);
|
||||
|
|
|
|||
|
|
@ -16,14 +16,14 @@
|
|||
<iconify-icon icon="tabler:file" width="none" class="size-10 text-gray-300" />
|
||||
<p class="text-gray-300 text-sm font-mono">{{ getFilename(attachment.url) }}</p>
|
||||
<p class="text-gray-300 text-xs" v-if="attachment.meta?.length">{{
|
||||
formatBytes(Number(attachment.meta?.length)) }}</p>
|
||||
formatBytes(Number(attachment.meta?.length)) }}</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Alt text viewer -->
|
||||
<Popover.Root :positioning="{
|
||||
strategy: 'fixed',
|
||||
}" v-if="attachment.description">
|
||||
strategy: 'fixed',
|
||||
}" v-if="attachment.description">
|
||||
<Popover.Trigger aria-hidden="true"
|
||||
class="absolute top-2 right-2 p-1 bg-dark-800 ring-1 ring-white/5 text-white text-xs rounded size-8">
|
||||
<iconify-icon icon="tabler:alt" width="none" class="size-6" />
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { Popover } from "@ark-ui/vue";
|
||||
import type { Attachment } from "~/types/mastodon/attachment";
|
||||
import type { Attachment } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
attachment: Attachment;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<NuxtLink :href="accountUrl" class="font-semibold text-gray-200 line-clamp-1 break-all">
|
||||
<Skeleton :enabled="!note" :min-width="90" :max-width="170" shape="rect">
|
||||
{{
|
||||
note?.account.display_name }}
|
||||
note?.account.display_name }}
|
||||
</Skeleton>
|
||||
</NuxtLink>
|
||||
<NuxtLink :href="noteUrl" class="text-gray-300 ml-2 line-clamp-1 break-all shrink-0">
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<NuxtLink :href="accountUrl" class="font-semibold text-gray-200 line-clamp-1 break-all">
|
||||
<Skeleton :enabled="!note" :min-width="90" :max-width="170" shape="rect">
|
||||
{{
|
||||
note?.account.display_name }}
|
||||
note?.account.display_name }}
|
||||
</Skeleton>
|
||||
</NuxtLink>
|
||||
<NuxtLink :href="noteUrl" class="text-gray-300 text-sm ml-2 line-clamp-1 break-all shrink-0"
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<Skeleton :enabled="!note" :min-width="130" :max-width="250" shape="rect">
|
||||
<span class="group-hover:hidden">
|
||||
@{{
|
||||
note?.account.acct
|
||||
note?.account.acct
|
||||
}}</span>
|
||||
<span @click="copyAccount" v-if="!hasCopied"
|
||||
class="hidden select-none group-hover:flex cursor-pointer items-center gap-x-1">
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Status } from "~/types/mastodon/status";
|
||||
import type { Status } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
note?: Status;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Account } from "~/types/mastodon/account";
|
||||
import type { Account } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
account: Account;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Status } from "~/types/mastodon/status";
|
||||
import type { Status } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
content: string | null;
|
||||
|
|
|
|||
|
|
@ -130,11 +130,11 @@
|
|||
<Menu.Item value="">
|
||||
<ButtonsDropdownElement @click="outputtedNote && useEvent('note:report', outputtedNote)"
|
||||
icon="tabler:flag" class="w-full"
|
||||
:disabled="!permissions.includes(RolePermissions.MANAGE_OWN_REPORTS)">
|
||||
:disabled="!permissions.includes(RolePermission.ManageOwnReports)">
|
||||
Report
|
||||
</ButtonsDropdownElement>
|
||||
</Menu.Item>
|
||||
<Menu.Item value="" v-if="permissions.includes(RolePermissions.MANAGE_ACCOUNTS)">
|
||||
<Menu.Item value="" v-if="permissions.includes(RolePermission.ManageAccounts)">
|
||||
<ButtonsDropdownElement icon="tabler:shield-bolt" class="w-full">
|
||||
Open Moderation Panel
|
||||
</ButtonsDropdownElement>
|
||||
|
|
@ -149,8 +149,8 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { Menu } from "@ark-ui/vue";
|
||||
import { RolePermission, type Status } from "@lysand-org/client/types";
|
||||
import Skeleton from "~/components/skeleton/Skeleton.vue";
|
||||
import type { Status } from "~/types/mastodon/status";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
|
|
|||
|
|
@ -29,8 +29,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Notification } from "~/types/mastodon/notification";
|
||||
import type { Relationship } from "~/types/mastodon/relationship";
|
||||
import type { Notification, Relationship } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
notification?: Notification;
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Account } from "~/types/mastodon/account";
|
||||
import type { Account } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
account?: Account;
|
||||
|
|
|
|||
|
|
@ -11,14 +11,14 @@
|
|||
<div class="font-semibold text-gray-200 line-clamp-1 break-all">
|
||||
<Skeleton :enabled="!account" :min-width="90" :max-width="170" shape="rect">
|
||||
{{
|
||||
account?.display_name }}
|
||||
account?.display_name }}
|
||||
</Skeleton>
|
||||
</div>
|
||||
</div>
|
||||
<span class="text-gray-400 text-sm line-clamp-1 break-all w-full">
|
||||
<Skeleton :enabled="!account" :min-width="130" :max-width="250" shape="rect">
|
||||
@{{
|
||||
account?.acct
|
||||
account?.acct
|
||||
}}
|
||||
</Skeleton>
|
||||
</span>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Account } from "~/types/mastodon/account";
|
||||
import type { Account } from "@lysand-org/client/types";
|
||||
import { NuxtLink } from "#components";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Status } from "~/types/mastodon/status";
|
||||
import type { Status } from "@lysand-org/client/types";
|
||||
|
||||
const props = defineProps<{
|
||||
timeline: Status[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue