From 7fc8a2a7b04d8550abdf55259bde4c857bd462a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:57:54 +0900 Subject: [PATCH 01/27] =?UTF-8?q?fix(frontend):=20=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E3=81=AE=E3=83=8E=E3=83=BC=E3=83=88=E8=A1=A8=E7=A4=BA=E3=81=A7?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AB=E3=81=8B=E3=81=8B=E3=82=8F=E3=82=89?= =?UTF-8?q?=E3=81=9A=E3=82=BB=E3=83=B3=E3=82=B7=E3=83=86=E3=82=A3=E3=83=96?= =?UTF-8?q?=E3=81=AA=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E5=90=AB?= =?UTF-8?q?=E3=82=80=E3=83=8E=E3=83=BC=E3=83=88=E3=81=8C=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E5=8C=96=E3=81=95=E3=82=8C=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix https://github.com/misskey-dev/misskey/pull/14772#discussion_r1821707117 --- packages/frontend/src/components/MkNote.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index be1339ecc4..3de69d6d09 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -227,7 +227,7 @@ const emit = defineEmits<{ }>(); const inTimeline = inject('inTimeline', false); -const tl_withSensitive = inject>('tl_withSensitive', ref(false)); +const tl_withSensitive = inject>('tl_withSensitive', ref(true)); const inChannel = inject('inChannel', null); const currentClip = inject | null>('currentClip', null); From 17d9aca5a7ec6149a8dbf0c1607c81ab188e7015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:46:42 +0900 Subject: [PATCH 02/27] =?UTF-8?q?refactor(frontend):=20as=E3=81=A8any?= =?UTF-8?q?=E3=82=92=E3=81=99=E3=81=90=E3=81=AA=E3=81=8A=E3=81=9B=E3=82=8B?= =?UTF-8?q?=E7=AF=84=E5=9B=B2=E3=81=A7=E9=99=A4=E5=8E=BB=20(#14848)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(frontend): できるだけanyを除去 * refactor * lint * fix * remove unused * Update packages/frontend/src/components/MkReactionsViewer.details.vue * Update packages/frontend/src/components/MkUsersTooltip.vue --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- .../src/components/MkAntennaEditor.vue | 2 +- .../src/components/MkChannelPreview.vue | 3 +- packages/frontend/src/components/MkDialog.vue | 4 +-- packages/frontend/src/components/MkDrive.vue | 8 ++--- .../src/components/MkEmojiPicker.section.vue | 2 +- .../frontend/src/components/MkEmojiPicker.vue | 4 +-- .../src/components/MkExtensionInstaller.vue | 2 +- packages/frontend/src/components/MkInput.vue | 8 ++--- .../components/MkNotificationSelectWindow.vue | 2 +- .../src/components/MkObjectView.value.vue | 10 +++--- .../frontend/src/components/MkPageWindow.vue | 2 +- .../frontend/src/components/MkPopupMenu.vue | 2 +- .../frontend/src/components/MkPostForm.vue | 20 +++-------- .../src/components/MkPostFormAttaches.vue | 8 ++--- .../src/components/MkPostFormDialog.vue | 16 ++------- packages/frontend/src/components/MkRadio.vue | 8 ++--- .../components/MkReactionsViewer.details.vue | 3 +- .../frontend/src/components/MkSuperMenu.vue | 33 +++++++++++++++++-- .../frontend/src/components/MkUrlPreview.vue | 10 +++--- .../MkUserAnnouncementEditDialog.vue | 8 +++-- .../src/components/MkUsersTooltip.vue | 4 +-- packages/frontend/src/components/MkWindow.vue | 11 +++++-- .../frontend/src/components/form/suspense.vue | 6 ++-- .../frontend/src/components/global/MkMfm.ts | 4 +-- packages/frontend/src/nirax.ts | 12 ++++--- packages/frontend/src/os.ts | 23 ++++++------- packages/frontend/src/pages/admin/users.vue | 6 ++-- .../src/pages/custom-emojis-manager.vue | 26 +++++++-------- .../frontend/src/pages/emoji-edit-dialog.vue | 19 ++++++----- .../frontend/src/pages/follow-requests.vue | 4 +-- packages/frontend/src/pages/lookup.vue | 2 +- .../frontend/src/pages/my-clips/index.vue | 6 ++-- packages/frontend/src/pages/my-lists/list.vue | 4 +-- .../page-editor/els/page-editor.el.image.vue | 5 +-- .../page-editor/els/page-editor.el.note.vue | 13 +++++--- .../els/page-editor.el.section.vue | 12 +++---- .../page-editor/els/page-editor.el.text.vue | 5 +-- packages/frontend/src/pages/registry.keys.vue | 2 +- .../src/pages/reversi/game.setting.vue | 6 ++-- packages/frontend/src/pages/scratchpad.vue | 6 +++- .../src/pages/settings/2fa.qrdialog.vue | 7 ++-- .../frontend/src/pages/settings/accounts.vue | 2 +- packages/frontend/src/pages/settings/apps.vue | 3 +- .../settings/avatar-decoration.dialog.vue | 8 ++--- packages/frontend/src/pages/user/home.vue | 2 +- packages/frontend/src/router/definition.ts | 2 +- packages/frontend/src/router/main.ts | 8 ++--- .../frontend/src/scripts/check-word-mute.ts | 3 +- packages/frontend/src/scripts/form.ts | 16 ++++----- packages/frontend/src/scripts/misskey-api.ts | 6 ++-- packages/frontend/src/scripts/select-file.ts | 6 ++-- packages/frontend/src/scripts/shuffle.ts | 5 +-- packages/frontend/src/scripts/upload.ts | 8 ++--- packages/frontend/src/store.ts | 9 ++--- packages/frontend/src/types/post-form.ts | 22 +++++++++++++ .../frontend/src/widgets/WidgetPhotos.vue | 4 +-- 56 files changed, 250 insertions(+), 192 deletions(-) create mode 100644 packages/frontend/src/types/post-form.ts diff --git a/packages/frontend/src/components/MkAntennaEditor.vue b/packages/frontend/src/components/MkAntennaEditor.vue index 2386ba6fa7..e622d57f1e 100644 --- a/packages/frontend/src/components/MkAntennaEditor.vue +++ b/packages/frontend/src/components/MkAntennaEditor.vue @@ -160,7 +160,7 @@ async function deleteAntenna() { function addUser() { os.selectUser({ includeSelf: true }).then(user => { users.value = users.value.trim(); - users.value += '\n@' + Misskey.acct.toString(user as any); + users.value += '\n@' + Misskey.acct.toString(user); users.value = users.value.trim(); }); } diff --git a/packages/frontend/src/components/MkChannelPreview.vue b/packages/frontend/src/components/MkChannelPreview.vue index 99580df5e2..c470042b79 100644 --- a/packages/frontend/src/components/MkChannelPreview.vue +++ b/packages/frontend/src/components/MkChannelPreview.vue @@ -47,11 +47,12 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 219950f135..8187d991e7 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -409,7 +409,7 @@ function computeButtonTitle(ev: MouseEvent): void { elm.title = getEmojiName(emoji); } -function chosen(emoji: any, ev?: MouseEvent) { +function chosen(emoji: string | Misskey.entities.EmojiSimple | UnicodeEmojiDef, ev?: MouseEvent) { const el = ev && (ev.currentTarget ?? ev.target) as HTMLElement | null | undefined; if (el) { const rect = el.getBoundingClientRect(); @@ -426,7 +426,7 @@ function chosen(emoji: any, ev?: MouseEvent) { // 最近使った絵文字更新 if (!pinned.value?.includes(key)) { let recents = defaultStore.state.recentlyUsedEmojis; - recents = recents.filter((emoji: any) => emoji !== key); + recents = recents.filter((emoji) => emoji !== key); recents.unshift(key); defaultStore.set('recentlyUsedEmojis', recents.splice(0, 32)); } diff --git a/packages/frontend/src/components/MkExtensionInstaller.vue b/packages/frontend/src/components/MkExtensionInstaller.vue index b41604b2c3..d59b20435e 100644 --- a/packages/frontend/src/components/MkExtensionInstaller.vue +++ b/packages/frontend/src/components/MkExtensionInstaller.vue @@ -73,7 +73,7 @@ export type Extension = { author: string; description?: string; permissions?: string[]; - config?: Record; + config?: Record; }; } | { type: 'theme'; diff --git a/packages/frontend/src/components/MkInput.vue b/packages/frontend/src/components/MkInput.vue index e01ff86c5a..08817fd6a8 100644 --- a/packages/frontend/src/components/MkInput.vue +++ b/packages/frontend/src/components/MkInput.vue @@ -44,7 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkPageWindow.vue b/packages/frontend/src/components/MkPageWindow.vue index 4777da2848..02c84df447 100644 --- a/packages/frontend/src/components/MkPageWindow.vue +++ b/packages/frontend/src/components/MkPageWindow.vue @@ -58,7 +58,7 @@ const windowRouter = routerFactory(props.initialPath); const contents = shallowRef(null); const pageMetadata = ref(null); const windowEl = shallowRef>(); -const history = ref<{ path: string; key: any; }[]>([{ +const history = ref<{ path: string; key: string; }[]>([{ path: windowRouter.getCurrentPath(), key: windowRouter.getCurrentKey(), }]); diff --git a/packages/frontend/src/components/MkPopupMenu.vue b/packages/frontend/src/components/MkPopupMenu.vue index 26c251a8d2..df664e49f7 100644 --- a/packages/frontend/src/components/MkPopupMenu.vue +++ b/packages/frontend/src/components/MkPopupMenu.vue @@ -19,7 +19,7 @@ defineProps<{ items: MenuItem[]; align?: 'center' | string; width?: number; - src?: any; + src?: HTMLElement | null; returnFocusTo?: HTMLElement | null; }>(); diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index b6b80082d3..f2fe048449 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -129,25 +129,13 @@ import { miLocalStorage } from '@/local-storage.js'; import { claimAchievement } from '@/scripts/achievements.js'; import { emojiPicker } from '@/scripts/emoji-picker.js'; import { mfmFunctionPicker } from '@/scripts/mfm-function-picker.js'; +import type { PostFormProps } from '@/types/post-form.js'; const $i = signinRequired(); const modal = inject('modal'); -const props = withDefaults(defineProps<{ - reply?: Misskey.entities.Note; - renote?: Misskey.entities.Note; - channel?: Misskey.entities.Channel; // TODO - mention?: Misskey.entities.User; - specified?: Misskey.entities.UserDetailed; - initialText?: string; - initialCw?: string; - initialVisibility?: (typeof Misskey.noteVisibilities)[number]; - initialFiles?: Misskey.entities.DriveFile[]; - initialLocalOnly?: boolean; - initialVisibleUsers?: Misskey.entities.UserDetailed[]; - initialNote?: Misskey.entities.Note; - instant?: boolean; +const props = withDefaults(defineProps { - if (typeof key !== 'string') return; + }, (key, value) => { + if (typeof key !== 'string' || typeof value !== 'string') return; if (key === 'text') { text.value = value; } if (key === 'cw') { useCw.value = value !== null; cw.value = value; } }); diff --git a/packages/frontend/src/components/MkPostFormAttaches.vue b/packages/frontend/src/components/MkPostFormAttaches.vue index ee7038df64..56e026aa3c 100644 --- a/packages/frontend/src/components/MkPostFormAttaches.vue +++ b/packages/frontend/src/components/MkPostFormAttaches.vue @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only