Merge branch 'develop' into enh-14810
This commit is contained in:
commit
66858cbb24
|
@ -4,6 +4,8 @@
|
||||||
-
|
-
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
|
- Enhance: 投稿フォームの「迷惑になる可能性があります」のダイアログを表示する条件においてCWを考慮するように
|
||||||
|
- Enhance: アンテナ、リスト等の名前をカラム名のデフォルト値にするように `#13992`
|
||||||
- Fix: デッキでリンクをダブルクリックすると、ウィンドウが2枚開いてしまう問題を修正
|
- Fix: デッキでリンクをダブルクリックすると、ウィンドウが2枚開いてしまう問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://json.schemastore.org/swcrc",
|
"$schema": "https://swc.rs/schema.json",
|
||||||
"jsc": {
|
"jsc": {
|
||||||
"parser": {
|
"parser": {
|
||||||
"syntax": "typescript",
|
"syntax": "typescript",
|
||||||
|
|
|
@ -79,14 +79,6 @@
|
||||||
codeBoolean: '#c59eff',
|
codeBoolean: '#c59eff',
|
||||||
deckBg: '#000',
|
deckBg: '#000',
|
||||||
htmlThemeColor: '@bg',
|
htmlThemeColor: '@bg',
|
||||||
X3: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X4: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X5: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X6: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X7: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X11: 'rgba(0, 0, 0, 0.3)',
|
|
||||||
X12: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X13: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
codeHighlighter: {
|
codeHighlighter: {
|
||||||
|
|
|
@ -79,14 +79,6 @@
|
||||||
codeBoolean: '#62b70c',
|
codeBoolean: '#62b70c',
|
||||||
deckBg: ':darken<3<@bg',
|
deckBg: ':darken<3<@bg',
|
||||||
htmlThemeColor: '@bg',
|
htmlThemeColor: '@bg',
|
||||||
X3: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X4: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X5: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X6: 'rgba(0, 0, 0, 0.25)',
|
|
||||||
X7: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X11: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X12: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X13: 'rgba(0, 0, 0, 0.15)',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
codeHighlighter: {
|
codeHighlighter: {
|
||||||
|
|
|
@ -54,13 +54,5 @@
|
||||||
wallpaperOverlay: 'rgba(0, 0, 0, 0.5)',
|
wallpaperOverlay: 'rgba(0, 0, 0, 0.5)',
|
||||||
panelHeaderDivider: 'rgba(0, 0, 0, 0)',
|
panelHeaderDivider: 'rgba(0, 0, 0, 0)',
|
||||||
scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)',
|
scrollbarHandleHover: 'rgba(255, 255, 255, 0.4)',
|
||||||
X3: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X4: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X5: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X6: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X7: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X11: 'rgba(0, 0, 0, 0.3)',
|
|
||||||
X12: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X13: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,17 +3,9 @@
|
||||||
base: 'dark',
|
base: 'dark',
|
||||||
name: 'Mi U0 Dark',
|
name: 'Mi U0 Dark',
|
||||||
props: {
|
props: {
|
||||||
X3: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X4: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X5: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X6: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X7: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
bg: '#172426',
|
bg: '#172426',
|
||||||
fg: '#dadada',
|
fg: '#dadada',
|
||||||
X10: ':alpha<0.4<@accent',
|
X10: ':alpha<0.4<@accent',
|
||||||
X11: 'rgba(0, 0, 0, 0.3)',
|
|
||||||
X12: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X13: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X14: ':alpha<0.5<@navBg',
|
X14: ':alpha<0.5<@navBg',
|
||||||
X15: ':alpha<0<@panel',
|
X15: ':alpha<0<@panel',
|
||||||
X16: ':alpha<0.7<@panel',
|
X16: ':alpha<0.7<@panel',
|
||||||
|
|
|
@ -3,17 +3,9 @@
|
||||||
base: 'light',
|
base: 'light',
|
||||||
name: 'Mi U0 Light',
|
name: 'Mi U0 Light',
|
||||||
props: {
|
props: {
|
||||||
X3: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X4: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X5: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
X6: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X7: 'rgba(255, 255, 255, 0.05)',
|
|
||||||
bg: '#e7e7eb',
|
bg: '#e7e7eb',
|
||||||
fg: '#5f5f5f',
|
fg: '#5f5f5f',
|
||||||
X10: ':alpha<0.4<@accent',
|
X10: ':alpha<0.4<@accent',
|
||||||
X11: 'rgba(0, 0, 0, 0.3)',
|
|
||||||
X12: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
X13: 'rgba(255, 255, 255, 0.15)',
|
|
||||||
X14: ':alpha<0.5<@navBg',
|
X14: ':alpha<0.5<@navBg',
|
||||||
X15: ':alpha<0<@panel',
|
X15: ':alpha<0<@panel',
|
||||||
X16: ':alpha<0.7<@panel',
|
X16: ':alpha<0.7<@panel',
|
||||||
|
|
|
@ -57,13 +57,5 @@
|
||||||
fgTransparentWeak: ':alpha<0.75<@fg',
|
fgTransparentWeak: ':alpha<0.75<@fg',
|
||||||
panelHeaderDivider: '@divider',
|
panelHeaderDivider: '@divider',
|
||||||
scrollbarHandleHover: 'rgba(0, 0, 0, 0.4)',
|
scrollbarHandleHover: 'rgba(0, 0, 0, 0.4)',
|
||||||
X3: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X4: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X5: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X6: 'rgba(0, 0, 0, 0.25)',
|
|
||||||
X7: 'rgba(0, 0, 0, 0.05)',
|
|
||||||
X11: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X12: 'rgba(0, 0, 0, 0.1)',
|
|
||||||
X13: 'rgba(0, 0, 0, 0.15)',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { markRaw, ref, shallowRef, computed, onUpdated, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
|
import { markRaw, ref, shallowRef, computed, onUpdated, onMounted, onBeforeUnmount, nextTick, watch } from 'vue';
|
||||||
import sanitizeHtml from 'sanitize-html';
|
import sanitizeHtml from 'sanitize-html';
|
||||||
import { emojilist, getEmojiName } from '@@/js/emojilist.js';
|
import { emojilist, getEmojiName } from '@@/js/emojilist.js';
|
||||||
import contains from '@/scripts/contains.js';
|
|
||||||
import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@@/js/emoji-base.js';
|
import { char2twemojiFilePath, char2fluentEmojiFilePath } from '@@/js/emoji-base.js';
|
||||||
|
import { MFM_TAGS, MFM_PARAMS } from '@@/js/const.js';
|
||||||
|
import contains from '@/scripts/contains.js';
|
||||||
import { acct } from '@/filters/user.js';
|
import { acct } from '@/filters/user.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
|
@ -56,7 +57,6 @@ import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
import { customEmojis } from '@/custom-emojis.js';
|
import { customEmojis } from '@/custom-emojis.js';
|
||||||
import { MFM_TAGS, MFM_PARAMS } from '@@/js/const.js';
|
|
||||||
import { searchEmoji } from '@/scripts/search-emoji.js';
|
import { searchEmoji } from '@/scripts/search-emoji.js';
|
||||||
import type { EmojiDef } from '@/scripts/search-emoji.js';
|
import type { EmojiDef } from '@/scripts/search-emoji.js';
|
||||||
|
|
||||||
|
@ -408,7 +408,7 @@ onBeforeUnmount(() => {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--MI_THEME-X3);
|
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
&[data-selected='true'] {
|
&[data-selected='true'] {
|
||||||
|
|
|
@ -85,7 +85,7 @@ function cancel() {
|
||||||
.emojiImgWrapper {
|
.emojiImgWrapper {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: 40cqh;
|
height: 40cqh;
|
||||||
background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-X5) 8px, var(--MI_THEME-X5) 14px);
|
background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05)) 8px, light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05)) 14px);
|
||||||
border-radius: var(--MI-radius);
|
border-radius: var(--MI-radius);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
@ -101,7 +101,7 @@ function cancel() {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
padding: 3px 10px;
|
padding: 3px 10px;
|
||||||
background-color: var(--MI_THEME-X5);
|
background-color: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
border: solid 1px var(--MI_THEME-divider);
|
border: solid 1px var(--MI_THEME-divider);
|
||||||
border-radius: var(--MI-radius);
|
border-radius: var(--MI-radius);
|
||||||
}
|
}
|
||||||
|
|
|
@ -582,7 +582,7 @@ defineExpose({
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background: linear-gradient(-45deg, transparent 0% 48%, var(--MI_THEME-X6) 48% 52%, transparent 52% 100%);
|
background: linear-gradient(-45deg, transparent 0% 48%, light-dark(rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.15)) 48% 52%, transparent 52% 100%);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
> .emoji {
|
> .emoji {
|
||||||
|
@ -617,7 +617,7 @@ defineExpose({
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background: linear-gradient(-45deg, transparent 0% 48%, var(--MI_THEME-X6) 48% 52%, transparent 52% 100%);
|
background: linear-gradient(-45deg, transparent 0% 48%, light-dark(rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.15)) 48% 52%, transparent 52% 100%);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
> .emoji {
|
> .emoji {
|
||||||
|
@ -738,7 +738,7 @@ defineExpose({
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
background: linear-gradient(-45deg, transparent 0% 48%, var(--MI_THEME-X6) 48% 52%, transparent 52% 100%);
|
background: linear-gradient(-45deg, transparent 0% 48%, light-dark(rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.15)) 48% 52%, transparent 52% 100%);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
|
||||||
> .emoji {
|
> .emoji {
|
||||||
|
|
|
@ -721,6 +721,14 @@ function deleteDraft() {
|
||||||
miLocalStorage.setItem('drafts', JSON.stringify(draftData));
|
miLocalStorage.setItem('drafts', JSON.stringify(draftData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isAnnoying(text: string): boolean {
|
||||||
|
return text.includes('$[x2') ||
|
||||||
|
text.includes('$[x3') ||
|
||||||
|
text.includes('$[x4') ||
|
||||||
|
text.includes('$[scale') ||
|
||||||
|
text.includes('$[position');
|
||||||
|
}
|
||||||
|
|
||||||
async function post(ev?: MouseEvent) {
|
async function post(ev?: MouseEvent) {
|
||||||
if (useCw.value && (cw.value == null || cw.value.trim() === '')) {
|
if (useCw.value && (cw.value == null || cw.value.trim() === '')) {
|
||||||
os.alert({
|
os.alert({
|
||||||
|
@ -745,14 +753,10 @@ async function post(ev?: MouseEvent) {
|
||||||
|
|
||||||
if (props.mock) return;
|
if (props.mock) return;
|
||||||
|
|
||||||
const annoying =
|
if (visibility.value === 'public' && (
|
||||||
text.value.includes('$[x2') ||
|
(useCw.value && cw.value != null && cw.value.trim() !== '' && isAnnoying(cw.value)) || // CWが迷惑になる場合
|
||||||
text.value.includes('$[x3') ||
|
((!useCw.value || cw.value == null || cw.value.trim() === '') && text.value != null && text.value.trim() !== '' && isAnnoying(text.value)) // CWが無い かつ 本文が迷惑になる場合
|
||||||
text.value.includes('$[x4') ||
|
)) {
|
||||||
text.value.includes('$[scale') ||
|
|
||||||
text.value.includes('$[position');
|
|
||||||
|
|
||||||
if (annoying && visibility.value === 'public') {
|
|
||||||
const { canceled, result } = await os.actions({
|
const { canceled, result } = await os.actions({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: i18n.ts.thisPostMayBeAnnoying,
|
text: i18n.ts.thisPostMayBeAnnoying,
|
||||||
|
@ -1166,7 +1170,7 @@ defineExpose({
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--MI_THEME-X5);
|
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
&:disabled {
|
&:disabled {
|
||||||
|
@ -1238,7 +1242,7 @@ html[data-color-scheme=light] .preview {
|
||||||
margin-right: 14px;
|
margin-right: 14px;
|
||||||
padding: 8px 0 8px 8px;
|
padding: 8px 0 8px 8px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: var(--MI_THEME-X4);
|
background: light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
||||||
}
|
}
|
||||||
|
|
||||||
.hasNotSpecifiedMentions {
|
.hasNotSpecifiedMentions {
|
||||||
|
@ -1349,7 +1353,7 @@ html[data-color-scheme=light] .preview {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--MI_THEME-X5);
|
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.footerButtonActive {
|
&.footerButtonActive {
|
||||||
|
|
|
@ -63,6 +63,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, computed, shallowRef } from 'vue';
|
import { onMounted, ref, computed, shallowRef } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
import { host as currentHost, hostname } from '@@/js/config.js';
|
||||||
import MkInput from '@/components/MkInput.vue';
|
import MkInput from '@/components/MkInput.vue';
|
||||||
import FormSplit from '@/components/form/split.vue';
|
import FormSplit from '@/components/form/split.vue';
|
||||||
import MkModalWindow from '@/components/MkModalWindow.vue';
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
||||||
|
@ -71,7 +72,6 @@ import { defaultStore } from '@/store.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i } from '@/account.js';
|
import { $i } from '@/account.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { host as currentHost, hostname } from '@@/js/config.js';
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'ok', selected: Misskey.entities.UserDetailed): void;
|
(ev: 'ok', selected: Misskey.entities.UserDetailed): void;
|
||||||
|
@ -198,7 +198,7 @@ onMounted(() => {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--MI_THEME-X7);
|
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
|
|
|
@ -310,6 +310,21 @@ export function inputText(props: {
|
||||||
} | {
|
} | {
|
||||||
canceled: false; result: string;
|
canceled: false; result: string;
|
||||||
}>;
|
}>;
|
||||||
|
// min lengthが指定されてたら result は null になり得ないことを保証する overload function
|
||||||
|
export function inputText(props: {
|
||||||
|
type?: 'text' | 'email' | 'password' | 'url';
|
||||||
|
title?: string;
|
||||||
|
text?: string;
|
||||||
|
placeholder?: string | null;
|
||||||
|
autocomplete?: string;
|
||||||
|
default?: string;
|
||||||
|
minLength: number;
|
||||||
|
maxLength?: number;
|
||||||
|
}): Promise<{
|
||||||
|
canceled: true; result: undefined;
|
||||||
|
} | {
|
||||||
|
canceled: false; result: string;
|
||||||
|
}>;
|
||||||
export function inputText(props: {
|
export function inputText(props: {
|
||||||
type?: 'text' | 'email' | 'password' | 'url';
|
type?: 'text' | 'email' | 'password' | 'url';
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|
|
@ -122,7 +122,7 @@ definePageMetadata(() => ({
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--MI_THEME-X5);
|
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.05));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,11 @@ function remove() {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--MI_THEME-panel);
|
background: var(--MI_THEME-panel);
|
||||||
border: solid 2px var(--MI_THEME-X12);
|
border: solid 2px light-dark(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.1));
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
border: solid 2px var(--MI_THEME-X13);
|
border: solid 2px light-dark(rgba(0, 0, 0, 0.15), rgba(255, 255, 255, 0.15));
|
||||||
}
|
}
|
||||||
|
|
||||||
&.warn {
|
&.warn {
|
||||||
|
|
|
@ -196,7 +196,7 @@ const addColumn = async (ev) => {
|
||||||
addColumnToStore({
|
addColumnToStore({
|
||||||
type: column,
|
type: column,
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
name: i18n.ts._deck._columns[column],
|
name: null,
|
||||||
width: 330,
|
width: 330,
|
||||||
soundSetting: { type: null, volume: 1 },
|
soundSetting: { type: null, volume: 1 },
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name || antennaName || i18n.ts._deck._columns.antenna }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId" @note="onNote"/>
|
<MkTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId" @note="onNote"/>
|
||||||
|
@ -36,6 +36,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
|
const antennaName = ref<string | null>(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.antennaId == null) {
|
if (props.column.antennaId == null) {
|
||||||
|
@ -43,6 +44,13 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch([() => props.column.name, () => props.column.antennaId], () => {
|
||||||
|
if (!props.column.name && props.column.antennaId) {
|
||||||
|
misskeyApi('antennas/show', { antennaId: props.column.antennaId })
|
||||||
|
.then(value => antennaName.value = value.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(soundSetting, v => {
|
watch(soundSetting, v => {
|
||||||
updateColumn(props.column.id, { soundSetting: v });
|
updateColumn(props.column.id, { soundSetting: v });
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name || channel?.name || i18n.ts._deck._columns.channel }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.channelId">
|
<template v-if="column.channelId">
|
||||||
|
@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, watch } from 'vue';
|
import { onMounted, ref, shallowRef, watch } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import XColumn from './column.vue';
|
import XColumn from './column.vue';
|
||||||
import { updateColumn } from './deck-store.js';
|
import { updateColumn } from './deck-store.js';
|
||||||
|
@ -44,9 +44,18 @@ const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||||
const channel = shallowRef<Misskey.entities.Channel>();
|
const channel = shallowRef<Misskey.entities.Channel>();
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
if (props.column.channelId == null) {
|
if (props.column.channelId == null) {
|
||||||
setChannel();
|
setChannel();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watch([() => props.column.name, () => props.column.channelId], () => {
|
||||||
|
if (!props.column.name && props.column.channelId) {
|
||||||
|
misskeyApi('channels/show', { channelId: props.column.channelId })
|
||||||
|
.then(value => channel.value = value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(soundSetting, v => {
|
watch(soundSetting, v => {
|
||||||
updateColumn(props.column.id, { soundSetting: v });
|
updateColumn(props.column.id, { soundSetting: v });
|
||||||
|
|
|
@ -129,7 +129,8 @@ function getMenu() {
|
||||||
icon: 'ti ti-settings',
|
icon: 'ti ti-settings',
|
||||||
text: i18n.ts._deck.configureColumn,
|
text: i18n.ts._deck.configureColumn,
|
||||||
action: async () => {
|
action: async () => {
|
||||||
const { canceled, result } = await os.form(props.column.name, {
|
const name = props.column.name ?? i18n.ts._deck._columns[props.column.type];
|
||||||
|
const { canceled, result } = await os.form(name, {
|
||||||
name: {
|
name: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
label: i18n.ts.name,
|
label: i18n.ts.name,
|
||||||
|
@ -144,7 +145,7 @@ function getMenu() {
|
||||||
flexible: {
|
flexible: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
label: i18n.ts._deck.flexible,
|
label: i18n.ts._deck.flexible,
|
||||||
default: props.column.flexible,
|
default: props.column.flexible ?? null,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (canceled) return;
|
if (canceled) return;
|
||||||
|
|
|
@ -51,7 +51,7 @@ export type Column = {
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
withSensitive?: boolean;
|
withSensitive?: boolean;
|
||||||
onlyFiles?: boolean;
|
onlyFiles?: boolean;
|
||||||
soundSetting: SoundStore;
|
soundSetting?: SoundStore;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deckStore = markRaw(new Storage('deck', {
|
export const deckStore = markRaw(new Storage('deck', {
|
||||||
|
@ -94,7 +94,7 @@ export const loadDeck = async () => {
|
||||||
key: deckStore.state.profile,
|
key: deckStore.state.profile,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'NO_SUCH_KEY') {
|
if (typeof err === 'object' && err != null && 'code' in err && err.code === 'NO_SUCH_KEY') {
|
||||||
// 後方互換性のため
|
// 後方互換性のため
|
||||||
if (deckStore.state.profile === 'default') {
|
if (deckStore.state.profile === 'default') {
|
||||||
saveDeck();
|
saveDeck();
|
||||||
|
@ -180,6 +180,7 @@ export function swapLeftColumn(id: Column['id']) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
saveDeck();
|
saveDeck();
|
||||||
}
|
}
|
||||||
|
@ -196,6 +197,7 @@ export function swapRightColumn(id: Column['id']) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
saveDeck();
|
saveDeck();
|
||||||
}
|
}
|
||||||
|
@ -216,6 +218,7 @@ export function swapUpColumn(id: Column['id']) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
saveDeck();
|
saveDeck();
|
||||||
}
|
}
|
||||||
|
@ -236,6 +239,7 @@ export function swapDownColumn(id: Column['id']) {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
saveDeck();
|
saveDeck();
|
||||||
}
|
}
|
||||||
|
@ -286,7 +290,8 @@ export function removeColumnWidget(id: Column['id'], widget: ColumnWidget) {
|
||||||
const columns = deepClone(deckStore.state.columns);
|
const columns = deepClone(deckStore.state.columns);
|
||||||
const columnIndex = deckStore.state.columns.findIndex(c => c.id === id);
|
const columnIndex = deckStore.state.columns.findIndex(c => c.id === id);
|
||||||
const column = deepClone(deckStore.state.columns[columnIndex]);
|
const column = deepClone(deckStore.state.columns[columnIndex]);
|
||||||
if (column == null || column.widgets == null) return;
|
if (column == null) return;
|
||||||
|
if (column.widgets == null) column.widgets = [];
|
||||||
column.widgets = column.widgets.filter(w => w.id !== widget.id);
|
column.widgets = column.widgets.filter(w => w.id !== widget.id);
|
||||||
columns[columnIndex] = column;
|
columns[columnIndex] = column;
|
||||||
deckStore.set('columns', columns);
|
deckStore.set('columns', columns);
|
||||||
|
@ -308,7 +313,8 @@ export function updateColumnWidget(id: Column['id'], widgetId: string, widgetDat
|
||||||
const columns = deepClone(deckStore.state.columns);
|
const columns = deepClone(deckStore.state.columns);
|
||||||
const columnIndex = deckStore.state.columns.findIndex(c => c.id === id);
|
const columnIndex = deckStore.state.columns.findIndex(c => c.id === id);
|
||||||
const column = deepClone(deckStore.state.columns[columnIndex]);
|
const column = deepClone(deckStore.state.columns[columnIndex]);
|
||||||
if (column == null || column.widgets == null) return;
|
if (column == null) return;
|
||||||
|
if (column.widgets == null) column.widgets = [];
|
||||||
column.widgets = column.widgets.map(w => w.id === widgetId ? {
|
column.widgets = column.widgets.map(w => w.id === widgetId ? {
|
||||||
...w,
|
...w,
|
||||||
data: widgetData,
|
data: widgetData,
|
||||||
|
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<XColumn :column="column" :isStacked="isStacked" :refresher="() => reloadTimeline()">
|
<XColumn :column="column" :isStacked="isStacked" :refresher="() => reloadTimeline()">
|
||||||
<template #header><i class="ti ti-mail" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
<template #header><i class="ti ti-mail" style="margin-right: 8px;"></i>{{ column.name || i18n.ts._deck._columns.direct }}</template>
|
||||||
|
|
||||||
<MkNotes ref="tlComponent" :pagination="pagination"/>
|
<MkNotes ref="tlComponent" :pagination="pagination"/>
|
||||||
</XColumn>
|
</XColumn>
|
||||||
|
@ -16,6 +16,7 @@ import { ref } from 'vue';
|
||||||
import XColumn from './column.vue';
|
import XColumn from './column.vue';
|
||||||
import type { Column } from './deck-store.js';
|
import type { Column } from './deck-store.js';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
column: Column;
|
column: Column;
|
||||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ (column.name || listName) ?? i18n.ts._deck._columns.list }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes" @note="onNote"/>
|
<MkTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes" @note="onNote"/>
|
||||||
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { watch, shallowRef, ref } from 'vue';
|
import { watch, shallowRef, ref, onMounted } from 'vue';
|
||||||
import type { entities as MisskeyEntities } from 'misskey-js';
|
import type { entities as MisskeyEntities } from 'misskey-js';
|
||||||
import XColumn from './column.vue';
|
import XColumn from './column.vue';
|
||||||
import { updateColumn } from './deck-store.js';
|
import { updateColumn } from './deck-store.js';
|
||||||
|
@ -37,10 +37,20 @@ const props = defineProps<{
|
||||||
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||||
const withRenotes = ref(props.column.withRenotes ?? true);
|
const withRenotes = ref(props.column.withRenotes ?? true);
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
|
const listName = ref<string | null>(null);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
if (props.column.listId == null) {
|
if (props.column.listId == null) {
|
||||||
setList();
|
setList();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
watch([() => props.column.name, () => props.column.listId], () => {
|
||||||
|
if (!props.column.name && props.column.listId) {
|
||||||
|
misskeyApi('users/lists/show', { listId: props.column.listId })
|
||||||
|
.then(value => listName.value = value.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(withRenotes, v => {
|
watch(withRenotes, v => {
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
|
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<XColumn :column="column" :isStacked="isStacked" :refresher="() => reloadTimeline()">
|
<XColumn :column="column" :isStacked="isStacked" :refresher="() => reloadTimeline()">
|
||||||
<template #header><i class="ti ti-at" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
<template #header><i class="ti ti-at" style="margin-right: 8px;"></i>{{ column.name || i18n.ts._deck._columns.mentions }}</template>
|
||||||
|
|
||||||
<MkNotes ref="tlComponent" :pagination="pagination"/>
|
<MkNotes ref="tlComponent" :pagination="pagination"/>
|
||||||
</XColumn>
|
</XColumn>
|
||||||
|
@ -16,6 +16,7 @@ import { ref } from 'vue';
|
||||||
import XColumn from './column.vue';
|
import XColumn from './column.vue';
|
||||||
import type { Column } from './deck-store.js';
|
import type { Column } from './deck-store.js';
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
|
import { i18n } from '../../i18n.js';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
column: Column;
|
column: Column;
|
||||||
|
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<XColumn :column="column" :isStacked="isStacked" :menu="menu" :refresher="async () => { await notificationsComponent?.reload() }">
|
<XColumn :column="column" :isStacked="isStacked" :menu="menu" :refresher="async () => { await notificationsComponent?.reload() }">
|
||||||
<template #header><i class="ti ti-bell" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
<template #header><i class="ti ti-bell" style="margin-right: 8px;"></i>{{ column.name || i18n.ts._deck._columns.notifications }}</template>
|
||||||
|
|
||||||
<XNotifications ref="notificationsComponent" :excludeTypes="props.column.excludeTypes"/>
|
<XNotifications ref="notificationsComponent" :excludeTypes="props.column.excludeTypes"/>
|
||||||
</XColumn>
|
</XColumn>
|
||||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name || roleName || i18n.ts._deck._columns.roleTimeline }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<MkTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId" @note="onNote"/>
|
<MkTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId" @note="onNote"/>
|
||||||
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref, shallowRef, watch } from 'vue';
|
import { computed, onMounted, ref, shallowRef, watch } from 'vue';
|
||||||
import XColumn from './column.vue';
|
import XColumn from './column.vue';
|
||||||
import { updateColumn } from './deck-store.js';
|
import { updateColumn } from './deck-store.js';
|
||||||
import type { Column } from './deck-store.js';
|
import type { Column } from './deck-store.js';
|
||||||
|
@ -34,6 +34,7 @@ const props = defineProps<{
|
||||||
|
|
||||||
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
|
const roleName = ref<string | null>(null);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (props.column.roleId == null) {
|
if (props.column.roleId == null) {
|
||||||
|
@ -41,6 +42,13 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch([() => props.column.name, () => props.column.roleId], () => {
|
||||||
|
if (!props.column.name && props.column.roleId) {
|
||||||
|
misskeyApi('roles/show', { roleId: props.column.roleId })
|
||||||
|
.then(value => roleName.value = value.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
watch(soundSetting, v => {
|
watch(soundSetting, v => {
|
||||||
updateColumn(props.column.id, { soundSetting: v });
|
updateColumn(props.column.id, { soundSetting: v });
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
|
||||||
<template #header>
|
<template #header>
|
||||||
<i v-if="column.tl != null" :class="basicTimelineIconClass(column.tl)"/>
|
<i v-if="column.tl != null" :class="basicTimelineIconClass(column.tl)"/>
|
||||||
<span style="margin-left: 8px;">{{ column.name }}</span>
|
<span style="margin-left: 8px;">{{ column.name || (column.tl ? i18n.ts._timelines[column.tl] : null) || i18n.ts._deck._columns.tl }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div v-if="!isAvailableBasicTimeline(column.tl)" :class="$style.disabled">
|
<div v-if="!isAvailableBasicTimeline(column.tl)" :class="$style.disabled">
|
||||||
|
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<XColumn :menu="menu" :naked="true" :column="column" :isStacked="isStacked">
|
<XColumn :menu="menu" :naked="true" :column="column" :isStacked="isStacked">
|
||||||
<template #header><i class="ti ti-apps" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
<template #header><i class="ti ti-apps" style="margin-right: 8px;"></i>{{ column.name || i18n.ts._deck._columns[props.column.type] }}</template>
|
||||||
|
|
||||||
<div :class="$style.root">
|
<div :class="$style.root">
|
||||||
<div v-if="!(column.widgets && column.widgets.length > 0) && !edit" :class="$style.intro">{{ i18n.ts._deck.widgetsIntroduction }}</div>
|
<div v-if="!(column.widgets && column.widgets.length > 0) && !edit" :class="$style.intro">{{ i18n.ts._deck.widgetsIntroduction }}</div>
|
||||||
|
|
|
@ -208,7 +208,7 @@ defineExpose<WidgetComponentExpose>({
|
||||||
.meter {
|
.meter {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--MI_THEME-X11);
|
background: light-dark(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue