diff --git a/components/account/AccountAvatar.vue b/components/account/AccountAvatar.vue
index 41a6880f..195a9d44 100644
--- a/components/account/AccountAvatar.vue
+++ b/components/account/AccountAvatar.vue
@@ -1,7 +1,7 @@
import type { mastodon } from 'masto'
-const { account, hideEmojis = false } = defineProps<{
+const { hideEmojis = false } = defineProps<{
account: mastodon.v1.Account
hideEmojis?: boolean
}>()
diff --git a/components/account/AccountFollowButton.vue b/components/account/AccountFollowButton.vue
index 3ecd3c20..10061519 100644
--- a/components/account/AccountFollowButton.vue
+++ b/components/account/AccountFollowButton.vue
@@ -2,7 +2,7 @@
import type { mastodon } from 'masto'
import { toggleFollowAccount, useRelationship } from '~~/composables/masto/relationship'
-const { account, command, context, ...props } = defineProps<{
+const { account, context, command, ...props } = defineProps<{
account: mastodon.v1.Account
relationship?: mastodon.v1.Relationship
context?: 'followedBy' | 'following'
diff --git a/components/account/AccountInfo.vue b/components/account/AccountInfo.vue
index 91d30387..9a5ef804 100644
--- a/components/account/AccountInfo.vue
+++ b/components/account/AccountInfo.vue
@@ -5,7 +5,7 @@ defineOptions({
inheritAttrs: false,
})
-const { account, as = 'div' } = defineProps<{
+const { as = 'div' } = defineProps<{
account: mastodon.v1.Account
as?: string
hoverCard?: boolean
diff --git a/components/account/AccountPaginator.vue b/components/account/AccountPaginator.vue
index 8777a05d..664eb89c 100644
--- a/components/account/AccountPaginator.vue
+++ b/components/account/AccountPaginator.vue
@@ -1,7 +1,7 @@
diff --git a/components/common/CommonBlurhash.vue b/components/common/CommonBlurhash.vue
index dbdee4c8..3babe634 100644
--- a/components/common/CommonBlurhash.vue
+++ b/components/common/CommonBlurhash.vue
@@ -3,7 +3,7 @@ defineOptions({
inheritAttrs: false,
})
-const { blurhash = '', src, srcset, shouldLoadImage = true } = defineProps<{
+const { blurhash = '', shouldLoadImage = true } = defineProps<{
blurhash?: string
src: string
srcset?: string
diff --git a/components/common/CommonCropImage.vue b/components/common/CommonCropImage.vue
index fee5a802..7ee942be 100644
--- a/components/common/CommonCropImage.vue
+++ b/components/common/CommonCropImage.vue
@@ -3,25 +3,18 @@ import type { Boundaries } from 'vue-advanced-cropper'
import { Cropper } from 'vue-advanced-cropper'
import 'vue-advanced-cropper/dist/style.css'
-export interface Props {
+const { stencilAspectRatio = 1 / 1, stencilSizePercentage = 0.9 } = defineProps<{
/** Crop frame aspect ratio (width/height), default 1/1 */
stencilAspectRatio?: number
/** The ratio of the longest edge of the cut box to the length of the cut screen, default 0.9, not more than 1 */
stencilSizePercentage?: number
-}
-const props = withDefaults(defineProps(), {
- stencilAspectRatio: 1 / 1,
- stencilSizePercentage: 0.9,
-})
+}>()
const file = defineModel()
const cropperDialog = ref(false)
-
const cropper = ref>()
-
const cropperFlag = ref(false)
-
const cropperImage = reactive({
src: '',
type: 'image/jpg',
@@ -29,8 +22,8 @@ const cropperImage = reactive({
function stencilSize({ boundaries }: { boundaries: Boundaries }) {
return {
- width: boundaries.width * props.stencilSizePercentage,
- height: boundaries.height * props.stencilSizePercentage,
+ width: boundaries.width * stencilSizePercentage,
+ height: boundaries.height * stencilSizePercentage,
}
}
@@ -82,7 +75,7 @@ function cropImage() {
}"
:stencil-size="stencilSize"
:stencil-props="{
- aspectRatio: props.stencilAspectRatio,
+ aspectRatio: stencilAspectRatio,
movable: false,
resizable: false,
handlers: {},
diff --git a/components/common/CommonInputImage.vue b/components/common/CommonInputImage.vue
index 92c13825..68de6049 100644
--- a/components/common/CommonInputImage.vue
+++ b/components/common/CommonInputImage.vue
@@ -2,21 +2,21 @@
import type { FileWithHandle } from 'browser-fs-access'
import { fileOpen } from 'browser-fs-access'
-const props = withDefaults(defineProps<{
+const {
+ original,
+ allowedFileTypes = ['image/jpeg', 'image/png'],
+ allowedFileSize = 1024 * 1024 * 5, // 5 MB
+} = defineProps<{
/** The image src before change */
original?: string
/** Allowed file types */
allowedFileTypes?: string[]
/** Allowed file size */
allowedFileSize?: number
-
imgClass?: string
-
loading?: boolean
-}>(), {
- allowedFileTypes: () => ['image/jpeg', 'image/png'],
- allowedFileSize: 1024 * 1024 * 5, // 5 MB
-})
+}>()
+
const emit = defineEmits<{
(event: 'pick', value: FileWithHandle): void
(event: 'error', code: number, message: string): void
@@ -26,7 +26,7 @@ const file = defineModel()
const { t } = useI18n()
-const defaultImage = computed(() => props.original || '')
+const defaultImage = computed(() => original || '')
/** Preview of selected images */
const previewImage = ref('')
/** The current images on display */
@@ -37,14 +37,14 @@ async function pickImage() {
return
const image = await fileOpen({
description: 'Image',
- mimeTypes: props.allowedFileTypes,
+ mimeTypes: allowedFileTypes,
})
- if (!props.allowedFileTypes.includes(image.type)) {
+ if (!allowedFileTypes.includes(image.type)) {
emit('error', 1, t('error.unsupported_file_format'))
return
}
- else if (image.size > props.allowedFileSize) {
+ else if (image.size > allowedFileSize) {
emit('error', 2, t('error.file_size_cannot_exceed_n_mb', [5]))
return
}
diff --git a/components/common/CommonMask.vue b/components/common/CommonMask.vue
index a2f926ba..ac56f533 100644
--- a/components/common/CommonMask.vue
+++ b/components/common/CommonMask.vue
@@ -2,7 +2,7 @@
const {
zIndex = 100,
background = 'transparent',
-} = $defineProps<{
+} = defineProps<{
zIndex?: number
background?: string
}>()
diff --git a/components/common/CommonPaginator.vue b/components/common/CommonPaginator.vue
index 9b32ac32..1849c27f 100644
--- a/components/common/CommonPaginator.vue
+++ b/components/common/CommonPaginator.vue
@@ -6,10 +6,10 @@ import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
const {
paginator,
- stream,
- eventType,
keyProp = 'id',
virtualScroller = false,
+ stream,
+ eventType,
preprocess,
endMessage = true,
} = defineProps<{
diff --git a/components/common/CommonRouteTabs.vue b/components/common/CommonRouteTabs.vue
index 6f2a16ac..62deaa6a 100644
--- a/components/common/CommonRouteTabs.vue
+++ b/components/common/CommonRouteTabs.vue
@@ -1,7 +1,7 @@
diff --git a/components/common/dropdown/DropdownItem.vue b/components/common/dropdown/DropdownItem.vue
index 525e71b7..1aed87df 100644
--- a/components/common/dropdown/DropdownItem.vue
+++ b/components/common/dropdown/DropdownItem.vue
@@ -4,7 +4,6 @@ const {
text,
description,
icon,
- checked,
command,
} = defineProps<{
is?: string
diff --git a/components/content/ContentCode.vue b/components/content/ContentCode.vue
index 531bbe98..61223631 100644
--- a/components/content/ContentCode.vue
+++ b/components/content/ContentCode.vue
@@ -1,10 +1,10 @@
diff --git a/components/conversation/ConversationPaginator.vue b/components/conversation/ConversationPaginator.vue
index 74a62609..b41af33f 100644
--- a/components/conversation/ConversationPaginator.vue
+++ b/components/conversation/ConversationPaginator.vue
@@ -1,7 +1,7 @@
diff --git a/components/nav/button/Notification.vue b/components/nav/button/Notification.vue
index 3e4aa5e7..cf000368 100644
--- a/components/nav/button/Notification.vue
+++ b/components/nav/button/Notification.vue
@@ -4,6 +4,7 @@ import { STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE } from '~/constants'
defineProps<{
activeClass: string
}>()
+
const { notifications } = useNotifications()
const lastAccessedNotificationRoute = useLocalStorage(STORAGE_KEY_LAST_ACCESSED_NOTIFICATION_ROUTE, '')
diff --git a/components/notification/NotificationPaginator.vue b/components/notification/NotificationPaginator.vue
index 7944be99..628d8e6f 100644
--- a/components/notification/NotificationPaginator.vue
+++ b/components/notification/NotificationPaginator.vue
@@ -4,7 +4,7 @@ import type { GroupedAccountLike, NotificationSlot } from '~/types'
// @ts-expect-error missing types
import { DynamicScrollerItem } from 'vue-virtual-scroller'
-const { paginator, stream } = defineProps<{
+defineProps<{
paginator: mastodon.Paginator
stream?: mastodon.streaming.Subscription
}>()
diff --git a/components/publish/PublishAttachment.vue b/components/publish/PublishAttachment.vue
index 5c2e2ec8..40ffc0ca 100644
--- a/components/publish/PublishAttachment.vue
+++ b/components/publish/PublishAttachment.vue
@@ -1,14 +1,12 @@
diff --git a/components/publish/PublishThreadTools.vue b/components/publish/PublishThreadTools.vue
index ee0ce842..1850392e 100644
--- a/components/publish/PublishThreadTools.vue
+++ b/components/publish/PublishThreadTools.vue
@@ -1,16 +1,16 @@
diff --git a/components/status/StatusAccountDetails.vue b/components/status/StatusAccountDetails.vue
index 224cba85..c0133ac9 100644
--- a/components/status/StatusAccountDetails.vue
+++ b/components/status/StatusAccountDetails.vue
@@ -1,7 +1,7 @@
diff --git a/components/status/StatusPreviewCardNormal.vue b/components/status/StatusPreviewCardNormal.vue
index ab5fa6ce..c79b3817 100644
--- a/components/status/StatusPreviewCardNormal.vue
+++ b/components/status/StatusPreviewCardNormal.vue
@@ -1,7 +1,7 @@
diff --git a/components/status/edit/StatusEditPreview.vue b/components/status/edit/StatusEditPreview.vue
index c0bc3496..f16fe76c 100644
--- a/components/status/edit/StatusEditPreview.vue
+++ b/components/status/edit/StatusEditPreview.vue
@@ -1,7 +1,7 @@
diff --git a/components/tag/TagCardPaginator.vue b/components/tag/TagCardPaginator.vue
index a00a6bb6..fe0988da 100644
--- a/components/tag/TagCardPaginator.vue
+++ b/components/tag/TagCardPaginator.vue
@@ -1,7 +1,7 @@
diff --git a/components/timeline/TimelinePaginator.vue b/components/timeline/TimelinePaginator.vue
index c9a400a8..5c1d7b97 100644
--- a/components/timeline/TimelinePaginator.vue
+++ b/components/timeline/TimelinePaginator.vue
@@ -4,7 +4,7 @@ import type { mastodon } from 'masto'
import { DynamicScrollerItem } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
-const { paginator, stream, account, buffer = 10, endMessage = true } = defineProps<{
+const { account, buffer = 10, endMessage = true } = defineProps<{
paginator: mastodon.Paginator
stream?: mastodon.streaming.Subscription
context?: mastodon.v2.FilterContext
diff --git a/components/tiptap/TiptapCodeBlock.vue b/components/tiptap/TiptapCodeBlock.vue
index df054407..2aff9b3c 100644
--- a/components/tiptap/TiptapCodeBlock.vue
+++ b/components/tiptap/TiptapCodeBlock.vue
@@ -1,7 +1,7 @@
diff --git a/docs/components/global/ClipboardIcon.vue b/docs/components/global/ClipboardIcon.vue
index a66f6af1..ae3f6853 100644
--- a/docs/components/global/ClipboardIcon.vue
+++ b/docs/components/global/ClipboardIcon.vue
@@ -1,5 +1,5 @@
diff --git a/docs/components/global/ToggleIcon.vue b/docs/components/global/ToggleIcon.vue
index b3913ffd..3e404bd2 100644
--- a/docs/components/global/ToggleIcon.vue
+++ b/docs/components/global/ToggleIcon.vue
@@ -1,5 +1,5 @@