forked from misskey-dev/misskey
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance(tms): settings/flagsを統合してfeaturesに変更
* enh: flagsページをsettingsページに統合する * change: /tms/settings -> /tms/features * enh: FormSection -> MkFolder + MkFormFooter
- Loading branch information
Showing
12 changed files
with
258 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and misskey-project | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<template> | ||
<div class="_gaps_m"> | ||
<div class="_gaps_s"> | ||
<MkInfo>{{ i18n.ts._tms.taiymeFeaturesDescription }} <MkA to="/tms/about" class="_link">{{ i18n.ts.learnMore }}</MkA></MkInfo> | ||
</div> | ||
<MkFolder defaultOpen> | ||
<template #icon><i class="ti ti-palette"></i></template> | ||
<template #label>{{ i18n.ts.appearance }}</template> | ||
<template v-if="appearancesForm.modified.value" #footer> | ||
<MkFormFooter :form="appearancesForm"/> | ||
</template> | ||
<div class="_gaps"> | ||
<MkSelect v-model="appearancesForm.state.tickerPosition"> | ||
<template #label> | ||
<span>{{ i18n.ts._tms._basicFeatures._tickerPosition.label }}</span> | ||
<span v-if="appearancesForm.modifiedStates.tickerPosition" class="_modified">{{ i18n.ts.modified }}</span> | ||
</template> | ||
<option value="default">{{ i18n.ts._tms._basicFeatures._tickerPosition.default }}</option> | ||
<option value="leftVerticalBar">{{ i18n.ts._tms._basicFeatures._tickerPosition.leftVerticalBar }}</option> | ||
<option value="rightVerticalBar">{{ i18n.ts._tms._basicFeatures._tickerPosition.rightVerticalBar }}</option> | ||
<option value="leftWatermark">{{ i18n.ts._tms._basicFeatures._tickerPosition.leftWatermark }}</option> | ||
<option value="rightWatermark">{{ i18n.ts._tms._basicFeatures._tickerPosition.rightWatermark }}</option> | ||
</MkSelect> | ||
<MkSelect v-model="appearancesForm.state.superMenuDisplayMode"> | ||
<template #label> | ||
<span>{{ i18n.ts._tms._basicFeatures._superMenuDisplayMode.label }}</span> | ||
<span v-if="appearancesForm.modifiedStates.superMenuDisplayMode" class="_modified">{{ i18n.ts.modified }}</span> | ||
</template> | ||
<template #caption>{{ i18n.ts._tms._basicFeatures._superMenuDisplayMode.caption }}</template> | ||
<option value="default">{{ i18n.ts._tms._basicFeatures._superMenuDisplayMode.default }}</option> | ||
<option value="classic">{{ i18n.ts._tms._basicFeatures._superMenuDisplayMode.classic }}</option> | ||
<option value="forceList">{{ i18n.ts._tms._basicFeatures._superMenuDisplayMode.forceList }}</option> | ||
</MkSelect> | ||
</div> | ||
</MkFolder> | ||
<MkFolder defaultOpen> | ||
<template #icon><i class="ti ti-hand-click"></i></template> | ||
<template #label>{{ i18n.ts.operations }}</template> | ||
<template v-if="operationsForm.modified.value" #footer> | ||
<MkFormFooter :form="operationsForm"/> | ||
</template> | ||
<div class="_gaps"> | ||
<MkSelect v-model="operationsForm.state.pullToRefreshSensitivity"> | ||
<template #label> | ||
<span>{{ i18n.ts._tms._basicFeatures._pullToRefreshSensitivity.label }}</span> | ||
<span v-if="operationsForm.modifiedStates.pullToRefreshSensitivity" class="_modified">{{ i18n.ts.modified }}</span> | ||
</template> | ||
<template #caption>{{ i18n.ts._tms._basicFeatures._pullToRefreshSensitivity.caption }}</template> | ||
<option value="low">{{ i18n.ts._tms._basicFeatures._pullToRefreshSensitivity.low }}</option> | ||
<option value="middle">{{ i18n.ts._tms._basicFeatures._pullToRefreshSensitivity.middle }}</option> | ||
<option value="high">{{ i18n.ts._tms._basicFeatures._pullToRefreshSensitivity.high }}</option> | ||
</MkSelect> | ||
<MkSwitch v-model="operationsForm.state.pullToRefreshAllReload"> | ||
<template #label> | ||
<span>{{ i18n.ts._tms._basicFeatures._pullToRefreshAllReload.label }}</span> | ||
<span v-if="operationsForm.modifiedStates.pullToRefreshAllReload" class="_modified">{{ i18n.ts.modified }}</span> | ||
</template> | ||
<template #caption>{{ i18n.ts._tms._basicFeatures._pullToRefreshAllReload.caption }}</template> | ||
</MkSwitch> | ||
</div> | ||
</MkFolder> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { i18n } from '@/i18n.js'; | ||
import { useForm } from '@/scripts/use-form.js'; | ||
import { tmsStore } from '@/tms/store.js'; | ||
import MkFolder from '@/components/MkFolder.vue'; | ||
import MkFormFooter from '@/components/MkFormFooter.vue'; | ||
import MkInfo from '@/components/MkInfo.vue'; | ||
import MkSelect from '@/components/MkSelect.vue'; | ||
import MkSwitch from '@/components/MkSwitch.vue'; | ||
|
||
const appearancesForm = useForm({ | ||
tickerPosition: tmsStore.state.tickerPosition, | ||
superMenuDisplayMode: tmsStore.state.superMenuDisplayMode, | ||
}, async (state) => { | ||
tmsStore.set('tickerPosition', state.tickerPosition); | ||
tmsStore.set('superMenuDisplayMode', state.superMenuDisplayMode); | ||
}); | ||
|
||
const operationsForm = useForm({ | ||
pullToRefreshSensitivity: tmsStore.state.pullToRefreshSensitivity, | ||
pullToRefreshAllReload: tmsStore.state.pullToRefreshAllReload, | ||
}, async (state) => { | ||
tmsStore.set('pullToRefreshSensitivity', state.pullToRefreshSensitivity); | ||
tmsStore.set('pullToRefreshAllReload', state.pullToRefreshAllReload); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and misskey-project | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<template> | ||
<div class="_gaps_m"> | ||
<div class="_gaps_s"> | ||
<MkInfo>{{ i18n.ts._tms.taiymeFeaturesDescription }} <MkA to="/tms/about" class="_link">{{ i18n.ts.learnMore }}</MkA></MkInfo> | ||
<MkInfo warn>{{ i18n.tsx._tms.taiymeExperimentalFeaturesWarning({ name: instance.name ?? host }) }}</MkInfo> | ||
</div> | ||
<MkFolder defaultOpen> | ||
<template #icon><i class="ti ti-hand-click"></i></template> | ||
<template #label>{{ i18n.ts.operations }}</template> | ||
<template v-if="operationsForm.modified.value" #footer> | ||
<MkFormFooter :form="operationsForm"/> | ||
</template> | ||
<div class="_gaps"> | ||
<MkSwitch v-model="operationsForm.state.preventLongPressContextMenu"> | ||
<template #label> | ||
<span>{{ i18n.ts._tms._experimentalFeatures._preventLongPressContextMenu.label }}</span> | ||
<span v-if="operationsForm.modifiedStates.preventLongPressContextMenu" class="_modified">{{ i18n.ts.modified }}</span> | ||
</template> | ||
<template #caption>{{ i18n.ts._tms._experimentalFeatures._preventLongPressContextMenu.caption }}</template> | ||
</MkSwitch> | ||
</div> | ||
</MkFolder> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { host } from '@@/js/config.js'; | ||
import { i18n } from '@/i18n.js'; | ||
import { instance } from '@/instance.js'; | ||
import { useForm } from '@/scripts/use-form.js'; | ||
import { tmsFlaskStore } from '@/tms/flask-store.js'; | ||
import MkFolder from '@/components/MkFolder.vue'; | ||
import MkFormFooter from '@/components/MkFormFooter.vue'; | ||
import MkInfo from '@/components/MkInfo.vue'; | ||
import MkSwitch from '@/components/MkSwitch.vue'; | ||
|
||
const operationsForm = useForm({ | ||
preventLongPressContextMenu: tmsFlaskStore.state.preventLongPressContextMenu, | ||
}, async (state) => { | ||
tmsFlaskStore.set('preventLongPressContextMenu', state.preventLongPressContextMenu); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!-- | ||
SPDX-FileCopyrightText: syuilo and misskey-project | ||
SPDX-License-Identifier: AGPL-3.0-only | ||
--> | ||
|
||
<template> | ||
<MkStickyContainer> | ||
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> | ||
<template #default> | ||
<MkHorizontalSwipe v-model:tab="tab" :tabs="headerTabs"> | ||
<MkSpacer v-if="tab === 'basic'" :contentMax="700" :marginMin="16" :marginMax="32"> | ||
<FormSuspense :p="ready"> | ||
<XBasicFeatures/> | ||
</FormSuspense> | ||
</MkSpacer> | ||
<MkSpacer v-else-if="tab === 'experimental'" :contentMax="700" :marginMin="16" :marginMax="32"> | ||
<FormSuspense :p="ready"> | ||
<XExperimentalFeatures/> | ||
</FormSuspense> | ||
</MkSpacer> | ||
</MkHorizontalSwipe> | ||
</template> | ||
</MkStickyContainer> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed, defineAsyncComponent, ref } from 'vue'; | ||
import { i18n } from '@/i18n.js'; | ||
import { definePageMetadata } from '@/scripts/page-metadata.js'; | ||
import { tmsFlaskStore } from '@/tms/flask-store.js'; | ||
import { tmsStore } from '@/tms/store.js'; | ||
import FormSuspense from '@/components/form/suspense.vue'; | ||
import MkHorizontalSwipe from '@/components/MkHorizontalSwipe.vue'; | ||
|
||
const props = withDefaults(defineProps<{ | ||
initialTab?: string; | ||
}>(), { | ||
initialTab: 'basic', | ||
}); | ||
|
||
// eslint-disable-next-line vue/no-setup-props-reactivity-loss | ||
const tab = ref(props.initialTab); | ||
|
||
const ready = async () => { | ||
await tmsStore.loaded; | ||
await tmsFlaskStore.loaded; | ||
}; | ||
|
||
const XBasicFeatures = defineAsyncComponent(() => import('@/pages/tms/features.basic.vue')); | ||
const XExperimentalFeatures = defineAsyncComponent(() => import('@/pages/tms/features.experimental.vue')); | ||
|
||
const headerActions = computed(() => []); | ||
|
||
const headerTabs = computed(() => [{ | ||
key: 'basic', | ||
title: i18n.ts._tms.taiymeBasicFeatures, | ||
icon: 'ti ti-settings', | ||
}, { | ||
key: 'experimental', | ||
title: i18n.ts._tms.taiymeExperimentalFeatures, | ||
icon: 'ti ti-flask', | ||
}]); | ||
|
||
definePageMetadata(() => ({ | ||
title: i18n.ts._tms.taiymeFeatures, | ||
icon: 'ti ti-settings', | ||
})); | ||
</script> | ||
|
||
<style lang="scss" module> | ||
.footer { | ||
-webkit-backdrop-filter: var(--MI-blur, blur(15px)); | ||
backdrop-filter: var(--MI-blur, blur(15px)); | ||
} | ||
</style> |
Oops, something went wrong.