Merge branch 'develop' into no-websocket

This commit is contained in:
syuilo 2025-05-07 10:45:25 +09:00
commit a7dc4c0ca9
7 changed files with 194 additions and 76 deletions

Binary file not shown.

View File

@ -11,18 +11,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div
v-else-if="!input && !select"
:class="[$style.icon, {
[$style.type_success]: type === 'success',
[$style.type_error]: type === 'error',
[$style.type_warning]: type === 'warning',
[$style.type_info]: type === 'info',
}]"
:class="[$style.icon]"
>
<i v-if="type === 'success'" :class="$style.iconInner" class="ti ti-check"></i>
<i v-else-if="type === 'error'" :class="$style.iconInner" class="ti ti-circle-x"></i>
<i v-else-if="type === 'warning'" :class="$style.iconInner" class="ti ti-alert-triangle"></i>
<i v-else-if="type === 'info'" :class="$style.iconInner" class="ti ti-info-circle"></i>
<i v-else-if="type === 'question'" :class="$style.iconInner" class="ti ti-help-circle"></i>
<MkSystemIcon v-if="type === 'success'" :class="$style.iconInner" style="width: 45px;" type="success"/>
<MkSystemIcon v-else-if="type === 'error'" :class="$style.iconInner" style="width: 45px;" type="error"/>
<MkSystemIcon v-else-if="type === 'warning'" :class="$style.iconInner" style="width: 45px;" type="warn"/>
<MkSystemIcon v-else-if="type === 'info'" :class="$style.iconInner" style="width: 45px;" type="info"/>
<MkSystemIcon v-else-if="type === 'question'" :class="$style.iconInner" style="width: 45px;" type="question"/>
<MkLoading v-else-if="type === 'waiting'" :class="$style.iconInner" :em="true"/>
</div>
<header v-if="title" :class="$style.title" class="_selectable"><Mfm :text="title"/></header>
@ -202,22 +197,6 @@ function onInputKeydown(evt: KeyboardEvent) {
margin: 0 auto;
}
.type_info {
color: #55c4dd;
}
.type_success {
color: var(--MI_THEME-success);
}
.type_error {
color: var(--MI_THEME-error);
}
.type_warning {
color: var(--MI_THEME-warn);
}
.title {
margin: 0 0 8px 0;
font-weight: bold;

View File

@ -5,43 +5,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<Transition :name="prefer.s.animation ? '_transition_zoom' : ''" appear>
<div :class="[$style.root, { [$style.warn]: type === 'notFound', [$style.error]: type === 'error' }]" class="_gaps_m">
<div :class="[$style.root, { [$style.warn]: type === 'notFound', [$style.error]: type === 'error' }]" class="_gaps">
<img v-if="type === 'empty' && instance.infoImageUrl" :src="instance.infoImageUrl" draggable="false" :class="$style.img"/>
<svg v-else-if="type === 'empty'" :class="$style.icon" viewBox="0 0 128 128" style="stroke-linecap:round;stroke-linejoin:round;">
<g transform="matrix(1,0,0,0.9,0,12.8)">
<path d="M64,88L64,48" style="fill:none;stroke:currentColor;stroke-width:8.41px;"/>
</g>
<g transform="matrix(1,0,0,1,-4,8)">
<circle cx="68" cy="28" r="4" style="fill:currentColor;"/>
</g>
<g transform="matrix(0.875,0,0,0.875,8,8)">
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:9.14px;"/>
</g>
</svg>
<MkSystemIcon v-else-if="type === 'empty'" type="info" :class="$style.icon"/>
<img v-if="type === 'notFound' && instance.notFoundImageUrl" :src="instance.notFoundImageUrl" draggable="false" :class="$style.img"/>
<svg v-else-if="type === 'notFound'" :class="$style.icon" viewBox="0 0 128 128" style="stroke-linecap:round;stroke-linejoin:round;">
<g transform="matrix(1,0,0,1,0,12)">
<path d="M64,64L64,56C72.533,55.777 80,49.333 80,40C80,31.667 73.333,24 64,24C55.667,24 47.556,31.667 48,40" style="fill:none;stroke:currentColor;stroke-width:8px;"/>
</g>
<g transform="matrix(1,0,0,1,-4,64)">
<circle cx="68" cy="28" r="4" style="fill:currentColor;"/>
</g>
<g transform="matrix(0.875,0,0,0.875,8,8)">
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:9.14px;"/>
</g>
</svg>
<MkSystemIcon v-else-if="type === 'notFound'" type="question" :class="$style.icon"/>
<img v-if="type === 'error' && instance.serverErrorImageUrl" :src="instance.serverErrorImageUrl" draggable="false" :class="$style.img"/>
<svg v-else-if="type === 'error'" :class="$style.icon" viewBox="0 0 128 128" style="stroke-linecap:round;stroke-linejoin:round;">
<g transform="matrix(0.707107,0.707107,-0.636396,0.636396,62.0201,-24.5298)">
<path d="M64,94.667L64,41.333" style="fill:none;stroke:currentColor;stroke-width:8.41px;"/>
</g>
<g transform="matrix(0.707107,-0.707107,0.636396,0.636396,-24.5298,65.9799)">
<path d="M64,94.667L64,41.333" style="fill:none;stroke:currentColor;stroke-width:8.41px;"/>
</g>
<g transform="matrix(0.875,0,0,0.875,8,8)">
<circle cx="64" cy="64" r="64" style="fill:none;stroke:currentColor;stroke-width:9.14px;"/>
</g>
</svg>
<MkSystemIcon v-else-if="type === 'error'" type="error" :class="$style.icon"/>
<div style="opacity: 0.7;">{{ props.text ?? (type === 'empty' ? i18n.ts.nothing : type === 'notFound' ? i18n.ts.notFound : type === 'error' ? i18n.ts.somethingHappened : null) }}</div>
<slot></slot>
@ -66,18 +36,6 @@ const props = defineProps<{
position: relative;
text-align: center;
padding: 32px;
&.error {
.icon {
color: var(--MI_THEME-error);
}
}
&.warn {
.icon {
color: var(--MI_THEME-warn);
}
}
}
.img {
@ -88,9 +46,8 @@ const props = defineProps<{
}
.icon {
width: 64px;
height: 64px;
width: 65px;
height: 65px;
margin: 0 auto;
color: var(--MI_THEME-accent);
}
</style>

View File

@ -0,0 +1,109 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<svg v-if="type === 'info'" :class="[$style.icon, $style.info]" viewBox="0 0 160 160">
<path d="M80,108L80,72" style="--l:37;" :class="[$style.line, $style.anim]"/>
<path d="M80,52L80,52" :class="[$style.line, $style.fade]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/>
</svg>
<svg v-else-if="type === 'question'" :class="[$style.icon, $style.question]" viewBox="0 0 160 160">
<path d="M80,92L79.991,84C88.799,83.98 96,76.962 96,68C96,59.038 88.953,52 79.991,52C71.03,52 64,59.038 64,68" style="--l:85;" :class="[$style.line, $style.anim]"/>
<path d="M80,108L80,108" :class="[$style.line, $style.fade]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/>
</svg>
<svg v-else-if="type === 'success'" :class="[$style.icon, $style.success]" viewBox="0 0 160 160">
<path d="M62,80L74,92L98,68" style="--l:50;" :class="[$style.line, $style.anim]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/>
</svg>
<svg v-else-if="type === 'warn'" :class="[$style.icon, $style.warn]" viewBox="0 0 160 160">
<path d="M80,64L80,88" style="--l:27;" :class="[$style.line, $style.anim]"/>
<path d="M80,108L80,108" :class="[$style.line, $style.fade]"/>
<path d="M92,28L144,116C148.709,124.65 144.083,135.82 136,136L24,136C15.917,135.82 11.291,124.65 16,116L68,28C73.498,19.945 86.771,19.945 92,28Z" style="--l:390;" :class="[$style.line, $style.anim]"/>
</svg>
<svg v-else-if="type === 'error'" :class="[$style.icon, $style.error]" viewBox="0 0 160 160">
<path d="M63,63L96,96" style="--l:47;--duration:0.3s;" :class="[$style.line, $style.anim]"/>
<path d="M96,63L63,96" style="--l:47;--duration:0.3s;--delay:0.2s;" :class="[$style.line, $style.anim]"/>
<circle cx="80" cy="80" r="56" style="--l:350;" :class="[$style.line, $style.anim]"/>
</svg>
</template>
<script lang="ts" setup>
import {} from 'vue';
const props = defineProps<{
type: 'info' | 'question' | 'success' | 'warn' | 'error';
}>();
</script>
<style lang="scss" module>
.icon {
stroke-linecap: round;
stroke-linejoin: round;
&.info {
color: var(--MI_THEME-accent);
}
&.question {
color: var(--MI_THEME-fg);
}
&.success {
color: var(--MI_THEME-success);
}
&.warn {
color: var(--MI_THEME-warn);
}
&.error {
color: var(--MI_THEME-error);
}
}
.line {
fill: none;
stroke: currentColor;
stroke-width: 8px;
}
.fill {
fill: currentColor;
}
.anim {
stroke-dasharray: var(--l);
stroke-dashoffset: var(--l);
animation: line-animation var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards;
animation-delay: var(--delay, 0s);
}
.fade {
opacity: 0;
animation: fade-in var(--duration, 0.5s) cubic-bezier(0,0,.25,1) 1 forwards;
animation-delay: var(--delay, 0s);
}
@keyframes line-animation {
0% {
stroke-dashoffset: var(--l);
opacity: 0;
}
100% {
stroke-dashoffset: 0;
opacity: 1;
}
}
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
</style>

View File

@ -25,6 +25,7 @@ import MkPageHeader from './global/MkPageHeader.vue';
import MkStickyContainer from './global/MkStickyContainer.vue';
import MkLazy from './global/MkLazy.vue';
import MkResult from './global/MkResult.vue';
import MkSystemIcon from './global/MkSystemIcon.vue';
import PageWithHeader from './global/PageWithHeader.vue';
import PageWithAnimBg from './global/PageWithAnimBg.vue';
import SearchMarker from './global/SearchMarker.vue';
@ -63,6 +64,7 @@ export const components = {
MkStickyContainer: MkStickyContainer,
MkLazy: MkLazy,
MkResult: MkResult,
MkSystemIcon: MkSystemIcon,
PageWithHeader: PageWithHeader,
PageWithAnimBg: PageWithAnimBg,
SearchMarker: SearchMarker,
@ -95,6 +97,7 @@ declare module '@vue/runtime-core' {
MkStickyContainer: typeof MkStickyContainer;
MkLazy: typeof MkLazy;
MkResult: typeof MkResult;
MkSystemIcon: typeof MkSystemIcon;
PageWithHeader: typeof PageWithHeader;
PageWithAnimBg: typeof PageWithAnimBg;
SearchMarker: typeof SearchMarker;

View File

@ -0,0 +1,66 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<PageWithHeader>
<div class="_spacer" style="--MI_SPACER-w: 600px;">
<div class="_gaps_m">
<MkResult v-if="resultType === 'empty'" type="empty"/>
<MkResult v-if="resultType === 'notFound'" type="notFound"/>
<MkResult v-if="resultType === 'error'" type="error"/>
<MkSelect
v-model="resultType" :items="[
{ label: 'empty', value: 'empty' },
{ label: 'notFound', value: 'notFound' },
{ label: 'error', value: 'error' },
]"
></MkSelect>
<MkSystemIcon v-if="iconType === 'info'" type="info" style="width: 60px;"/>
<MkSystemIcon v-if="iconType === 'question'" type="question" style="width: 60px;"/>
<MkSystemIcon v-if="iconType === 'success'" type="success" style="width: 60px;"/>
<MkSystemIcon v-if="iconType === 'warn'" type="warn" style="width: 60px;"/>
<MkSystemIcon v-if="iconType === 'error'" type="error" style="width: 60px;"/>
<MkSelect
v-model="iconType" :items="[
{ label: 'info', value: 'info' },
{ label: 'question', value: 'question' },
{ label: 'success', value: 'success' },
{ label: 'warn', value: 'warn' },
{ label: 'error', value: 'error' },
]"
></MkSelect>
<div class="_buttons">
<MkButton @click="os.alert({ type: 'error', title: 'Error', text: 'error' })">Error</MkButton>
<MkButton @click="os.alert({ type: 'warning', title: 'Warning', text: 'warning' })">Warning</MkButton>
<MkButton @click="os.alert({ type: 'info', title: 'Info', text: 'info' })">Info</MkButton>
<MkButton @click="os.alert({ type: 'success', title: 'Success', text: 'success' })">Success</MkButton>
<MkButton @click="os.alert({ type: 'question', title: 'Question', text: 'question' })">Question</MkButton>
</div>
</div>
</div>
</PageWithHeader>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import { definePage } from '@/page.js';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkLink from '@/components/MkLink.vue';
import MkSelect from '@/components/MkSelect.vue';
import MkButton from '@/components/MkButton.vue';
import * as os from '@/os.js';
const resultType = ref('empty');
const iconType = ref('info');
definePage(() => ({
title: 'DEBUG ROOM',
icon: 'ti ti-help-circle',
}));
</script>

View File

@ -591,6 +591,10 @@ export const ROUTE_DEF = [{
path: '/reversi/g/:gameId',
component: page(() => import('@/pages/reversi/game.vue')),
loginRequired: false,
}, {
path: '/debug',
component: page(() => import('@/pages/debug.vue')),
loginRequired: false,
}, {
// テスト用リダイレクト設定。ログイン中ユーザのプロフィールにリダイレクトする
path: '/redirect-test',