From dec7c4f722f2ac766b367fa5f1442a41f5e408b6 Mon Sep 17 00:00:00 2001 From: "Richard \"EpicKitty\" Bowey" Date: Fri, 26 Nov 2021 04:39:57 +0000 Subject: [PATCH 01/11] Implemented a rotate MFM (#8016) Co-authored-by: Richard Bowey --- locales/en-US.yml | 2 ++ packages/client/src/components/mfm.ts | 5 +++++ packages/client/src/pages/mfm-cheat-sheet.vue | 11 +++++++++++ packages/client/src/scripts/mfm-tags.ts | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 37da6fdc95..c5c8afb50f 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -931,6 +931,8 @@ _mfm: rainbowDescription: "Makes the content appear in rainbow colors." sparkle: "Sparkle" sparkleDescription: "Gives content a sparkling particle effect." + rotate: "Rotate" + rotateDescription: "Rotates the content by 90 degrees" _reversi: reversi: "Reversi" gameSettings: "Game settings" diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index d41cf6fc2b..d1da365d9a 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -184,6 +184,11 @@ export default defineComponent({ count, speed, }, genEl(token.children)); } + case 'rotate': { + const degrees = parseInt(token.props.args.deg) || '90'; + style = `transform: rotate(${degrees}deg); transform-origin: center center;`; + break; + } } if (style == null) { return h('span', {}, ['$[', token.props.name, ' ', ...genEl(token.children), ']']); diff --git a/packages/client/src/pages/mfm-cheat-sheet.vue b/packages/client/src/pages/mfm-cheat-sheet.vue index e9a3b6debc..ee9d807e71 100644 --- a/packages/client/src/pages/mfm-cheat-sheet.vue +++ b/packages/client/src/pages/mfm-cheat-sheet.vue @@ -281,6 +281,16 @@ +
+
{{ $ts._mfm.rotate }}
+
+

{{ $ts._mfm.rotateDescription }}

+
+ + MFM +
+
+
@@ -328,6 +338,7 @@ export default defineComponent({ preview_blur: `$[blur ${this.$ts._mfm.dummy}]`, preview_rainbow: `$[rainbow 🍮]`, preview_sparkle: `$[sparkle 🍮]`, + preview_rotate: `$[rotate 🍮]`, } }, }); diff --git a/packages/client/src/scripts/mfm-tags.ts b/packages/client/src/scripts/mfm-tags.ts index 1b18210aa9..18e8d7038a 100644 --- a/packages/client/src/scripts/mfm-tags.ts +++ b/packages/client/src/scripts/mfm-tags.ts @@ -1 +1 @@ -export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle']; +export const MFM_TAGS = ['tada', 'jelly', 'twitch', 'shake', 'spin', 'jump', 'bounce', 'flip', 'x2', 'x3', 'x4', 'font', 'blur', 'rainbow', 'sparkle', 'rotate']; From b4ebf254c898bf998170e41d09c20cf6a0ddafd0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 26 Nov 2021 13:41:31 +0900 Subject: [PATCH 02/11] Update ja-JP.yml --- locales/ja-JP.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 633cd0e857..77b7a2cf27 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -824,7 +824,7 @@ _ffVisibility: _signup: almostThere: "ほとんど完了です" - emailAddressInfo: "あなたが使っているメールアドレスを入力してください。" + emailAddressInfo: "あなたが使っているメールアドレスを入力してください。メールアドレスが公開されることはありません。" emailSent: "入力されたメールアドレス({email})宛に確認のメールが送信されました。メールに記載されたリンクにアクセスすると、アカウントの作成が完了します。" _accountDelete: @@ -945,6 +945,8 @@ _mfm: rainbowDescription: "内容をレインボーにします。" sparkle: "キラキラ" sparkleDescription: "キラキラしたパーティクルのエフェクトを追加します。" + rotate: "回転" + rotateDescription: "指定した角度で回転させます。" _reversi: reversi: "リバーシ" From d9775c147f9dc5cec208b583a473df06b72305d7 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 26 Nov 2021 13:41:49 +0900 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20tools=E3=81=8C=E5=8B=95=E3=81=8B?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#8008?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move tools * Fix DB --- packages/backend/src/tools/add-emoji.ts | 5 ++++- packages/backend/src/tools/demote-admin.ts | 4 +--- packages/backend/src/tools/mark-admin.ts | 4 +--- packages/backend/src/tools/refresh-question.ts | 5 ++++- packages/backend/src/tools/show-signin-history.ts | 5 ++++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/backend/src/tools/add-emoji.ts b/packages/backend/src/tools/add-emoji.ts index 9ffe7dfa81..6c750bcab0 100644 --- a/packages/backend/src/tools/add-emoji.ts +++ b/packages/backend/src/tools/add-emoji.ts @@ -1,7 +1,10 @@ -import { Emojis } from '@/models/index'; +import { initDb } from '@/db/postgre'; import { genId } from '@/misc/gen-id'; async function main(name: string, url: string, alias?: string): Promise { + await initDb(); + const { Emojis } = await import('@/models/index'); + const aliases = alias != null ? [ alias ] : []; await Emojis.save({ diff --git a/packages/backend/src/tools/demote-admin.ts b/packages/backend/src/tools/demote-admin.ts index d7c6d1cec2..b326c946ef 100644 --- a/packages/backend/src/tools/demote-admin.ts +++ b/packages/backend/src/tools/demote-admin.ts @@ -1,13 +1,11 @@ import { initDb } from '../db/postgre'; -import { getRepository } from 'typeorm'; -import { User } from '@/models/entities/user'; async function main(username: string) { if (!username) throw `username required`; username = username.replace(/^@/, ''); await initDb(); - const Users = getRepository(User); + const { Users } = await import('@/models/index'); const res = await Users.update({ usernameLower: username.toLowerCase(), diff --git a/packages/backend/src/tools/mark-admin.ts b/packages/backend/src/tools/mark-admin.ts index 62ed0f09ee..0833f22266 100644 --- a/packages/backend/src/tools/mark-admin.ts +++ b/packages/backend/src/tools/mark-admin.ts @@ -1,13 +1,11 @@ import { initDb } from '../db/postgre'; -import { getRepository } from 'typeorm'; -import { User } from '@/models/entities/user'; async function main(username: string) { if (!username) throw `username required`; username = username.replace(/^@/, ''); await initDb(); - const Users = getRepository(User); + const { Users } = await import('@/models/index'); const res = await Users.update({ usernameLower: username.toLowerCase(), diff --git a/packages/backend/src/tools/refresh-question.ts b/packages/backend/src/tools/refresh-question.ts index 98a3c2865f..3bbb781ae7 100644 --- a/packages/backend/src/tools/refresh-question.ts +++ b/packages/backend/src/tools/refresh-question.ts @@ -1,6 +1,9 @@ -import { updateQuestion } from '@/remote/activitypub/models/question'; +import { initDb } from '@/db/postgre'; async function main(uri: string): Promise { + await initDb(); + const { updateQuestion } = await import('@/remote/activitypub/models/question'); + return await updateQuestion(uri); } diff --git a/packages/backend/src/tools/show-signin-history.ts b/packages/backend/src/tools/show-signin-history.ts index ad92316314..1291a1b22f 100644 --- a/packages/backend/src/tools/show-signin-history.ts +++ b/packages/backend/src/tools/show-signin-history.ts @@ -1,4 +1,4 @@ -import { Users, Signins } from '@/models/index'; +import { initDb } from '@/db/postgre'; // node built/tools/show-signin-history username // => {Success} {Date} {IPAddrsss} @@ -10,6 +10,9 @@ import { Users, Signins } from '@/models/index'; // with full request headers async function main(username: string, headers?: string[]) { + await initDb(); + const { Users, Signins } = await import('@/models/index'); + const user = await Users.findOne({ host: null, usernameLower: username.toLowerCase(), From 8e0108a0b83c6f1fb9021ed8aeb051d46d34c382 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 26 Nov 2021 13:43:11 +0900 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20notification.vue=E3=81=AEIntersect?= =?UTF-8?q?ionObserver=E3=81=BE=E3=82=8F=E3=82=8A=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#8010)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix notification.vue * remove a blank line * disconnect intersection observer * disconnect2 * Update packages/client/src/components/notification.vue Co-authored-by: Acid Chicken (硫酸鶏) * disconnect * oops Co-authored-by: Acid Chicken (硫酸鶏) --- .../client/src/components/notification.vue | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 89025b72e6..5cf44f4c56 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -107,28 +107,25 @@ export default defineComponent({ const reactionRef = ref(null); onMounted(() => { - let readObserver: IntersectionObserver | null = null; - let connection = null; - if (!props.notification.isRead) { - readObserver = new IntersectionObserver((entries, observer) => { + const readObserver = new IntersectionObserver((entries, observer) => { if (!entries.some(entry => entry.isIntersecting)) return; os.stream.send('readNotification', { id: props.notification.id }); - entries.map(({ target }) => observer.unobserve(target)); + observer.disconnect(); }); readObserver.observe(elRef.value); - connection = os.stream.useChannel('main'); - connection.on('readAllNotifications', () => readObserver.unobserve(elRef.value)); - } + const connection = os.stream.useChannel('main'); + connection.on('readAllNotifications', () => readObserver.disconnect()); - onUnmounted(() => { - if (readObserver) readObserver.unobserve(elRef.value); - if (connection) connection.dispose(); - }); + onUnmounted(() => { + readObserver.disconnect(); + connection.dispose(); + }); + } }); const followRequestDone = ref(false); From 698e0d08a121a9a00e5c5f71ee44a276d4995f08 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 27 Nov 2021 18:29:23 +0900 Subject: [PATCH 05/11] =?UTF-8?q?fix(client):=20=E3=83=A2=E3=83=90?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=A7=E3=82=BF=E3=83=83=E3=83=97=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AB=E3=83=84=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=83=81=E3=83=83=E3=83=97=E3=81=8C=E8=A1=A8=E7=A4=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/src/os.ts | 10 ++++++++++ packages/client/src/scripts/use-tooltip.ts | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 9eac06a5e3..48a558a363 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -12,6 +12,16 @@ import { resolve } from '@/router'; import { $i } from '@/account'; import { defaultStore } from '@/store'; +export let isScreenTouching = false; + +window.addEventListener('touchstart', () => { + isScreenTouching = true; +}, { passive: true }); + +window.addEventListener('touchend', () => { + isScreenTouching = false; +}, { passive: true }); + export const stream = markRaw(new Misskey.Stream(url, $i)); export const pendingApiRequestsCount = ref(0); diff --git a/packages/client/src/scripts/use-tooltip.ts b/packages/client/src/scripts/use-tooltip.ts index 2c0c36400d..89e6b1be9d 100644 --- a/packages/client/src/scripts/use-tooltip.ts +++ b/packages/client/src/scripts/use-tooltip.ts @@ -1,3 +1,4 @@ +import { isScreenTouching } from '@/os'; import { Ref, ref } from 'vue'; export function useTooltip(onShow: (showing: Ref) => void) { @@ -10,6 +11,10 @@ export function useTooltip(onShow: (showing: Ref) => void) { close(); if (!isHovering) return; + // iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、その対策 + // これが無いと、画面に触れてないのにツールチップが出たりしてしまう + if (!isScreenTouching) return; + const showing = ref(true); onShow(showing); changeShowingState = () => { From 0d21083c9a119d642bfb7a7f8704fbd29fdbcf3c Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Sat, 27 Nov 2021 22:43:08 -0500 Subject: [PATCH 06/11] Fix install docs link in readme (#8017) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 18b3adfba4..799be299d5 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ [✨ Find an instance](https://misskey-hub.net/instances.html) • -[📦 Create your own instance](https://misskey-hub.net/docs/install/install.html) +[📦 Create your own instance](https://misskey-hub.net/docs/install.html) • [🛠️ Contribute](./CONTRIBUTING.md) • From 335e4bd213d23849ecff193e1143a322bf201708 Mon Sep 17 00:00:00 2001 From: xianon Date: Sun, 28 Nov 2021 13:45:17 +0900 Subject: [PATCH 07/11] =?UTF-8?q?/antennas/notes=20API=20=E3=81=A7?= =?UTF-8?q?=E6=97=A5=E4=BB=98=E3=81=AB=E3=82=88=E3=82=8B=E7=B5=9E=E3=82=8A?= =?UTF-8?q?=E8=BE=BC=E3=81=BF=E3=81=8C=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B=20(#8015)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/antennas/notes.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/antennas/notes.ts b/packages/backend/src/server/api/endpoints/antennas/notes.ts index 1759e95b4c..02fec2778b 100644 --- a/packages/backend/src/server/api/endpoints/antennas/notes.ts +++ b/packages/backend/src/server/api/endpoints/antennas/notes.ts @@ -33,6 +33,14 @@ export const meta = { untilId: { validator: $.optional.type(ID), }, + + sinceDate: { + validator: $.optional.num, + }, + + untilDate: { + validator: $.optional.num, + }, }, errors: { @@ -68,7 +76,8 @@ export default define(meta, async (ps, user) => { .select('joining.noteId') .where('joining.antennaId = :antennaId', { antennaId: antenna.id }); - const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId) + const query = makePaginationQuery(Notes.createQueryBuilder('note'), + ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere(`note.id IN (${ antennaQuery.getQuery() })`) .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('note.reply', 'reply') From e8005c8d3a6edf2c8cdce3fe098fb9acff8a57c6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 28 Nov 2021 20:07:37 +0900 Subject: [PATCH 08/11] client: refine ui --- packages/client/src/components/dialog.vue | 8 +- .../src/components/emoji-picker-dialog.vue | 2 +- packages/client/src/components/form/group.vue | 35 +++ packages/client/src/components/form/input.vue | 22 +- packages/client/src/components/form/link.vue | 112 ++++++++ .../client/src/components/form/pagination.vue | 44 +++ packages/client/src/components/form/radio.vue | 22 +- .../client/src/components/form/radios.vue | 49 +++- packages/client/src/components/form/range.vue | 272 ++++++++++++------ .../client/src/components/form/section.vue | 26 +- .../client/src/components/form/select.vue | 11 +- packages/client/src/components/form/slot.vue | 15 +- .../client/src/components/form/suspense.vue | 98 +++++++ .../client/src/components/form/switch.vue | 12 +- .../client/src/components/form/textarea.vue | 16 +- .../client/src/components/global/spacer.vue | 28 +- packages/client/src/components/key-value.vue | 48 ++++ packages/client/src/components/note.vue | 1 + packages/client/src/components/ui/button.vue | 4 +- packages/client/src/components/ui/menu.vue | 8 +- .../client/src/components/ui/popup-menu.vue | 4 +- packages/client/src/components/ui/popup.vue | 198 +++++++------ .../client/src/components/ui/super-menu.vue | 2 - packages/client/src/components/ui/tooltip.vue | 63 ++-- packages/client/src/directives/index.ts | 2 + packages/client/src/directives/panel.ts | 24 ++ packages/client/src/os.ts | 4 + packages/client/src/pages/about-misskey.vue | 189 ++++++------ packages/client/src/pages/about.vue | 164 ++++++----- packages/client/src/pages/federation.vue | 181 ++++++------ packages/client/src/pages/settings/2fa.vue | 114 ++++---- packages/client/src/pages/settings/drive.vue | 87 +++--- .../src/pages/settings/email-address.vue | 68 ----- .../src/pages/settings/email-notification.vue | 91 ------ packages/client/src/pages/settings/email.vue | 145 +++++++--- .../client/src/pages/settings/general.vue | 104 ++++--- .../src/pages/settings/import-export.vue | 2 +- packages/client/src/pages/settings/index.vue | 34 ++- packages/client/src/pages/settings/menu.vue | 22 +- .../src/pages/settings/notifications.vue | 24 +- .../client/src/pages/settings/privacy.vue | 80 +++--- .../client/src/pages/settings/profile.vue | 97 +++---- .../client/src/pages/settings/reaction.vue | 45 +-- .../client/src/pages/settings/security.vue | 84 ++++-- packages/client/src/pages/settings/sounds.vue | 32 +-- packages/client/src/pages/settings/theme.vue | 122 ++++---- .../client/src/pages/settings/word-mute.vue | 58 ++-- packages/client/src/style.scss | 20 +- 48 files changed, 1744 insertions(+), 1149 deletions(-) create mode 100644 packages/client/src/components/form/group.vue create mode 100644 packages/client/src/components/form/link.vue create mode 100644 packages/client/src/components/form/pagination.vue create mode 100644 packages/client/src/components/form/suspense.vue create mode 100644 packages/client/src/components/key-value.vue create mode 100644 packages/client/src/directives/panel.ts delete mode 100644 packages/client/src/pages/settings/email-address.vue delete mode 100644 packages/client/src/pages/settings/email-notification.vue diff --git a/packages/client/src/components/dialog.vue b/packages/client/src/components/dialog.vue index 1b03e65a3d..5d6678531d 100644 --- a/packages/client/src/components/dialog.vue +++ b/packages/client/src/components/dialog.vue @@ -14,7 +14,9 @@
- + + + @@ -114,9 +115,9 @@ export default defineComponent({ const changed = ref(false); const invalid = ref(false); const filled = computed(() => v.value !== '' && v.value != null); - const inputEl = ref(null); - const prefixEl = ref(null); - const suffixEl = ref(null); + const inputEl = ref(); + const prefixEl = ref(); + const suffixEl = ref(); const focus = () => inputEl.value.focus(); const onInput = (ev) => { @@ -208,7 +209,7 @@ export default defineComponent({ .matxzzsk { > .label { font-size: 0.85em; - padding: 0 0 8px 12px; + padding: 0 0 8px 0; user-select: none; &:empty { @@ -217,8 +218,8 @@ export default defineComponent({ } > .caption { - font-size: 0.8em; - padding: 8px 0 0 12px; + font-size: 0.85em; + padding: 8px 0 0 0; color: var(--fgTransparentWeak); &:empty { @@ -242,8 +243,7 @@ export default defineComponent({ font-weight: normal; font-size: 1em; color: var(--fg); - background: var(--panel); - border: solid 0.5px var(--inputBorder); + border: solid 0.5px var(--panel); border-radius: 6px; outline: none; box-shadow: none; @@ -311,5 +311,9 @@ export default defineComponent({ } } } + + > .save { + margin: 8px 0 0 0; + } } diff --git a/packages/client/src/components/form/link.vue b/packages/client/src/components/form/link.vue new file mode 100644 index 0000000000..3eb74425b0 --- /dev/null +++ b/packages/client/src/components/form/link.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/packages/client/src/components/form/pagination.vue b/packages/client/src/components/form/pagination.vue new file mode 100644 index 0000000000..3d3b40a783 --- /dev/null +++ b/packages/client/src/components/form/pagination.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/packages/client/src/components/form/radio.vue b/packages/client/src/components/form/radio.vue index 0f31d8fa0a..f0b8c71376 100644 --- a/packages/client/src/components/form/radio.vue +++ b/packages/client/src/components/form/radio.vue @@ -1,5 +1,6 @@ @@ -118,10 +118,14 @@ export default defineComponent({ transition: inherit; } - > p { - margin: 0; + > .caption { + margin: 8px 0 0 0; color: var(--fgTransparentWeak); - font-size: 90%; + font-size: 0.85em; + + &:empty { + display: none; + } } } diff --git a/packages/client/src/components/form/textarea.vue b/packages/client/src/components/form/textarea.vue index f3a2c394f1..98fd0da94b 100644 --- a/packages/client/src/components/form/textarea.vue +++ b/packages/client/src/components/form/textarea.vue @@ -4,6 +4,7 @@