From 57bb6e611fb41f9ebe0552acba541c9978916d76 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 14:34:44 +0900 Subject: [PATCH 1/9] refactor(client): use setup syntax --- .../client/src/components/notification.vue | 159 +++++++----------- 1 file changed, 64 insertions(+), 95 deletions(-) diff --git a/packages/client/src/components/notification.vue b/packages/client/src/components/notification.vue index 26fbeecb6..32f9fd07d 100644 --- a/packages/client/src/components/notification.vue +++ b/packages/client/src/components/notification.vue @@ -72,8 +72,8 @@ - From 270e1212aca2931f8c01d43c187106b988fa2c49 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 15:59:49 +0900 Subject: [PATCH 2/9] chore(client): refactor and style tweaks --- packages/client/src/components/form/input.vue | 257 ++++++---------- .../client/src/components/form/select.vue | 288 ++++++++---------- .../client/src/components/poll-editor.vue | 18 +- packages/client/src/pages/settings/theme.vue | 45 ++- 4 files changed, 250 insertions(+), 358 deletions(-) diff --git a/packages/client/src/components/form/input.vue b/packages/client/src/components/form/input.vue index 5065e2889..ec1ad20de 100644 --- a/packages/client/src/components/form/input.vue +++ b/packages/client/src/components/form/input.vue @@ -33,176 +33,118 @@ - @@ -229,14 +171,13 @@ export default defineComponent({ } > .input { - $height: 42px; position: relative; > input { appearance: none; -webkit-appearance: none; display: block; - height: $height; + height: v-bind("height + 'px'"); width: 100%; margin: 0; padding: 0 12px; @@ -266,7 +207,7 @@ export default defineComponent({ top: 0; padding: 0 12px; font-size: 1em; - height: $height; + height: v-bind("height + 'px'"); pointer-events: none; &:empty { diff --git a/packages/client/src/components/form/select.vue b/packages/client/src/components/form/select.vue index 7f5f8784b..05e95a091 100644 --- a/packages/client/src/components/form/select.vue +++ b/packages/client/src/components/form/select.vue @@ -26,178 +26,139 @@ - From ea3d391df94789bb7d6bf9e00f96eb4ca1009f8f Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 16:02:39 +0900 Subject: [PATCH 3/9] chore(client): tweak style --- packages/client/src/pages/settings/theme.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/settings/theme.vue b/packages/client/src/pages/settings/theme.vue index ddffe0822..d4c23e07b 100644 --- a/packages/client/src/pages/settings/theme.vue +++ b/packages/client/src/pages/settings/theme.vue @@ -388,7 +388,7 @@ definePageMetadata({ .root { > .selects { display: flex; - gap: var(--margin); + gap: 1.5em var(--margin); flex-wrap: wrap; > .select { From 30bdfde4cc666550c00ca1ea36abbfe9702c12ae Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 16:06:23 +0900 Subject: [PATCH 4/9] 12.112.0-beta.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dc15198ca..9b1fd6b1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.112.0-beta.6", + "version": "12.112.0-beta.7", "codename": "indigo", "repository": { "type": "git", From a50b1d69a1aa7a6a387dd673f96f040680d529dc Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 17:59:23 +0900 Subject: [PATCH 5/9] chore(client): fix #8858 --- packages/client/src/nirax.ts | 5 +++++ packages/client/src/ui/deck.vue | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/packages/client/src/nirax.ts b/packages/client/src/nirax.ts index cae4edaf1..6db633566 100644 --- a/packages/client/src/nirax.ts +++ b/packages/client/src/nirax.ts @@ -66,6 +66,7 @@ export class Router extends EventEmitter<{ private currentKey = Date.now().toString(); public currentRoute: ShallowRef = shallowRef(null); + public navHook: ((path: string) => boolean) | null = null; constructor(routes: Router['routes'], currentPath: Router['currentPath']) { super(); @@ -192,6 +193,10 @@ export class Router extends EventEmitter<{ } public push(path: string) { + if (this.navHook) { + const cancel = this.navHook(path); + if (cancel) return; + } const beforePath = this.currentPath; this.navigate(path, null); this.emit('push', { diff --git a/packages/client/src/ui/deck.vue b/packages/client/src/ui/deck.vue index 743326479..b3b9ddd55 100644 --- a/packages/client/src/ui/deck.vue +++ b/packages/client/src/ui/deck.vue @@ -65,6 +65,13 @@ import { $i } from '@/account'; import { i18n } from '@/i18n'; import { mainRouter } from '@/router'; +if (deckStore.state.navWindow) { + mainRouter.navHook = (path) => { + os.pageWindow(path); + return true; + }; +} + const isMobile = ref(window.innerWidth <= 500); window.addEventListener('resize', () => { isMobile.value = window.innerWidth <= 500; From d7e7152bd3dfa40a0bc9011944f6caa5447a0a27 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 18:09:42 +0900 Subject: [PATCH 6/9] chore(client): tweak style --- packages/client/src/components/form/radio.vue | 19 ++++++++++--------- .../src/components/global/page-header.vue | 2 +- packages/client/src/components/ui/window.vue | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/client/src/components/form/radio.vue b/packages/client/src/components/form/radio.vue index 2becbec6f..db13fee4f 100644 --- a/packages/client/src/components/form/radio.vue +++ b/packages/client/src/components/form/radio.vue @@ -7,7 +7,8 @@ :aria-disabled="disabled" @click="toggle" > - @@ -23,27 +24,27 @@ import { defineComponent } from 'vue'; export default defineComponent({ props: { modelValue: { - required: false + required: false, }, value: { - required: false + required: false, }, disabled: { type: Boolean, - default: false - } + default: false, + }, }, computed: { checked(): boolean { return this.modelValue === this.value; - } + }, }, methods: { toggle() { if (this.disabled) return; this.$emit('update:modelValue', this.value); - } - } + }, + }, }); @@ -53,7 +54,7 @@ export default defineComponent({ display: inline-block; text-align: left; cursor: pointer; - padding: 10px 12px; + padding: 9px 12px; background-color: var(--panel); background-clip: padding-box !important; border: solid 1px var(--panel); diff --git a/packages/client/src/components/global/page-header.vue b/packages/client/src/components/global/page-header.vue index a750fdb30..a080c39dd 100644 --- a/packages/client/src/components/global/page-header.vue +++ b/packages/client/src/components/global/page-header.vue @@ -181,7 +181,7 @@ onUnmounted(() => { border-bottom: solid 0.5px var(--divider); &.thin { - --height: 50px; + --height: 45px; > .buttons { > .button { diff --git a/packages/client/src/components/ui/window.vue b/packages/client/src/components/ui/window.vue index 25f937ef1..8305cd1b2 100644 --- a/packages/client/src/components/ui/window.vue +++ b/packages/client/src/components/ui/window.vue @@ -408,7 +408,7 @@ export default defineComponent({ background: var(--windowHeader); -webkit-backdrop-filter: var(--blur, blur(15px)); backdrop-filter: var(--blur, blur(15px)); - border-bottom: solid 1px var(--divider); + //border-bottom: solid 1px var(--divider); font-size: 95%; > .left, > .right { From ac162f9996f5fd062d1d5e9696a66045b935761d Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 18:41:37 +0900 Subject: [PATCH 7/9] chore(client): tweak style --- packages/client/src/components/form/range.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/form/range.vue b/packages/client/src/components/form/range.vue index 221ad029a..ac4a781e3 100644 --- a/packages/client/src/components/form/range.vue +++ b/packages/client/src/components/form/range.vue @@ -195,7 +195,7 @@ export default defineComponent({ $thumbWidth: 20px; > .body { - padding: 12px; + padding: 10px 12px; background: var(--panel); border: solid 1px var(--panel); border-radius: 6px; From 9a4198293a781932fdcec193c07f659ff6ead076 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 22:32:01 +0900 Subject: [PATCH 8/9] chore(client): tweak style --- packages/client/src/components/form/radio.vue | 1 + .../client/src/components/form/radios.vue | 32 +++++++++---------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/packages/client/src/components/form/radio.vue b/packages/client/src/components/form/radio.vue index db13fee4f..b4d39507e 100644 --- a/packages/client/src/components/form/radio.vue +++ b/packages/client/src/components/form/radio.vue @@ -55,6 +55,7 @@ export default defineComponent({ text-align: left; cursor: pointer; padding: 9px 12px; + min-width: 60px; background-color: var(--panel); background-clip: padding-box !important; border: solid 1px var(--panel); diff --git a/packages/client/src/components/form/radios.vue b/packages/client/src/components/form/radios.vue index a52acae9e..bde4a8fb0 100644 --- a/packages/client/src/components/form/radios.vue +++ b/packages/client/src/components/form/radios.vue @@ -4,11 +4,11 @@ import MkRadio from './radio.vue'; export default defineComponent({ components: { - MkRadio + MkRadio, }, props: { modelValue: { - required: false + required: false, }, }, data() { @@ -19,7 +19,7 @@ export default defineComponent({ watch: { value() { this.$emit('update:modelValue', this.value); - } + }, }, render() { let options = this.$slots.default(); @@ -30,25 +30,25 @@ export default defineComponent({ if (options.length === 1 && options[0].props == null) options = options[0].children; return h('div', { - class: 'novjtcto' + class: 'novjtcto', }, [ ...(label ? [h('div', { - class: 'label' + class: 'label', }, [label])] : []), h('div', { - class: 'body' + class: 'body', }, options.map(option => h(MkRadio, { - key: option.key, - value: option.props.value, - modelValue: this.value, - 'onUpdate:modelValue': value => this.value = value, - }, option.children)), + key: option.key, + value: option.props.value, + modelValue: this.value, + 'onUpdate:modelValue': value => this.value = value, + }, option.children)), ), ...(caption ? [h('div', { - class: 'caption' + class: 'caption', }, [caption])] : []), ]); - } + }, }); @@ -65,9 +65,9 @@ export default defineComponent({ } > .body { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); - grid-gap: 12px; + display: flex; + gap: 12px; + flex-wrap: wrap; } > .caption { From 9f7c9b122fcdf29da85ad7e8caa273a1a0efcc15 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 28 Jun 2022 22:56:18 +0900 Subject: [PATCH 9/9] =?UTF-8?q?fix(client):=20=E9=9D=9E=E3=83=A2=E3=83=87?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=BF=E3=83=BC=E3=81=8C=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=83=B3=E3=82=B9=E6=83=85=E5=A0=B1=E3=83=9A?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=84=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/pages/instance-info.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/client/src/pages/instance-info.vue b/packages/client/src/pages/instance-info.vue index 9eddbad79..6d52f2a87 100644 --- a/packages/client/src/pages/instance-info.vue +++ b/packages/client/src/pages/instance-info.vue @@ -134,16 +134,11 @@ let suspended = $ref(false); let isBlocked = $ref(false); async function fetch() { - if (iAmModerator) { - // suspended and blocked information is only displayed to moderators. - // otherwise the API will error anyway - - instance = await os.api('federation/show-instance', { - host: props.host, - }); - suspended = instance.isSuspended; - isBlocked = instance.isBlocked; - } + instance = await os.api('federation/show-instance', { + host: props.host, + }); + suspended = instance.isSuspended; + isBlocked = instance.isBlocked; } async function toggleBlock(ev) {