refactor: ⬆️ Update @lysand-org/client to 0.2.0, use its types instead

This commit is contained in:
Jesse Wierzbinski 2024-06-19 13:57:38 -10:00
parent cd1fb48b68
commit 8a984abfb2
No known key found for this signature in database
75 changed files with 63 additions and 640 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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<{