mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 02:49:01 +01:00
385969e9f5
* fix(frontend): 直前のパターンを記録するように * fix(frontend): フォーカス/タブ移動に関する挙動を調整 (#226) Cherry-pick commit e8c030673326871edf3623cf2b8675d68f9e1b13 Co-authored-by: taiyme <53635909+taiyme@users.noreply.github.com> * focusのデザイン修正 * move scripts * Modalにfocus trapを追加 * 記録するホットキーはレートリミット式にする * escキーのハンドリングをMkModalに統一 * fix * enterで子メニューを開けるように * lint * fix focus trap * improve switch accessibility * 一部のmodalのフォーカストラップが外れない問題を修正 * fix * fix * Revert "記録するホットキーはレートリミット式にする" This reverts commit 40a7509286a87911ad4cc06d9482e8a2e5d0e7e8. * Revert "fix(frontend): 直前のパターンを記録するように" This reverts commit 5372b2594023952cff34aa62253ed4efef15b5dd. * Revert "Revert "fix(frontend): 直前のパターンを記録するように"" This reverts commit a9bb52e799e110927ad92cd8f26af980819334e1. * Revert "Revert "記録するホットキーはレートリミット式にする"" This reverts commit bdac34273e0bc5f13604c7e2f9fa6b1321a0df3d. * 試験的にCypressでのFocustrapを無効化 * fix * fix focus-trap * Update Changelog * ✌️ * fix focustrap invocation logic * スクロールがsticky headerを考慮するように * 🎨 * スタイルの微調整 * 🎨 * remove deprecated key aliases * focusElementが足りなかったので修正 * preview系にfocus時スタイルが足りなかったので修正 * `returnFocusElement` -> `returnFocusTo` * lint * Update packages/frontend/src/components/MkModalWindow.vue * Apply suggestions from code review Co-authored-by: taiy <53635909+taiyme@users.noreply.github.com> * keydownイベントをまとめる * use correct pesudo-element selector * fix * rename --------- Co-authored-by: taiyme <53635909+taiyme@users.noreply.github.com> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
161 lines
3.2 KiB
Vue
161 lines
3.2 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<div class="rrevdjwu" :class="{ grid }">
|
|
<div v-for="group in def" class="group">
|
|
<div v-if="group.title" class="title">{{ group.title }}</div>
|
|
|
|
<div class="items">
|
|
<template v-for="(item, i) in group.items">
|
|
<a v-if="item.type === 'a'" :href="item.href" :target="item.target" class="_button item" :class="{ danger: item.danger, active: item.active }">
|
|
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
|
|
<span class="text">{{ item.text }}</span>
|
|
</a>
|
|
<button v-else-if="item.type === 'button'" class="_button item" :class="{ danger: item.danger, active: item.active }" :disabled="item.active" @click="ev => item.action(ev)">
|
|
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
|
|
<span class="text">{{ item.text }}</span>
|
|
</button>
|
|
<MkA v-else :to="item.to" class="_button item" :class="{ danger: item.danger, active: item.active }">
|
|
<span v-if="item.icon" class="icon"><i :class="item.icon" class="ti-fw"></i></span>
|
|
<span class="text">{{ item.text }}</span>
|
|
</MkA>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { } from 'vue';
|
|
|
|
defineProps<{
|
|
def: any[];
|
|
grid?: boolean;
|
|
}>();
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.rrevdjwu {
|
|
> .group {
|
|
& + .group {
|
|
margin-top: 16px;
|
|
padding-top: 16px;
|
|
border-top: solid 0.5px var(--divider);
|
|
}
|
|
|
|
> .title {
|
|
opacity: 0.7;
|
|
margin: 0 0 8px 0;
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
> .items {
|
|
> .item {
|
|
display: flex;
|
|
align-items: center;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
padding: 9px 16px 9px 8px;
|
|
border-radius: 9px;
|
|
font-size: 0.9em;
|
|
|
|
&:hover {
|
|
text-decoration: none;
|
|
background: var(--panelHighlight);
|
|
}
|
|
|
|
&:focus-visible {
|
|
outline-offset: -2px;
|
|
}
|
|
|
|
&.active {
|
|
color: var(--accent);
|
|
background: var(--accentedBg);
|
|
}
|
|
|
|
&.danger {
|
|
color: var(--error);
|
|
}
|
|
|
|
> .icon {
|
|
width: 32px;
|
|
margin-right: 2px;
|
|
flex-shrink: 0;
|
|
text-align: center;
|
|
opacity: 0.8;
|
|
}
|
|
|
|
> .text {
|
|
white-space: normal;
|
|
padding-right: 12px;
|
|
flex-shrink: 1;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
&.grid {
|
|
> .group {
|
|
& + .group {
|
|
padding-top: 0;
|
|
border-top: none;
|
|
}
|
|
|
|
margin-left: 0;
|
|
margin-right: 0;
|
|
|
|
> .title {
|
|
font-size: 1em;
|
|
opacity: 0.7;
|
|
margin: 0 0 8px 16px;
|
|
}
|
|
|
|
> .items {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
|
grid-gap: 16px;
|
|
padding: 0 16px;
|
|
|
|
> .item {
|
|
flex-direction: column;
|
|
text-align: center;
|
|
padding: 0;
|
|
|
|
&:hover {
|
|
text-decoration: none;
|
|
background: none;
|
|
color: var(--accent);
|
|
|
|
> .icon {
|
|
background: var(--accentedBg);
|
|
}
|
|
}
|
|
|
|
> .icon {
|
|
display: grid;
|
|
place-content: center;
|
|
margin-right: 0;
|
|
margin-bottom: 6px;
|
|
font-size: 1.5em;
|
|
width: 60px;
|
|
height: 60px;
|
|
aspect-ratio: 1;
|
|
background: var(--panel);
|
|
border-radius: 100%;
|
|
}
|
|
|
|
> .text {
|
|
padding-right: 0;
|
|
width: 100%;
|
|
font-size: 0.8em;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|