2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2021-11-19 19:36:12 +09:00
|
|
|
<div v-size="{ max: [310, 500] }" class="gafaadew"
|
|
|
|
:class="{ modal, _popup: modal }"
|
2020-01-30 04:37:25 +09:00
|
|
|
@dragover.stop="onDragover"
|
|
|
|
@dragenter="onDragenter"
|
|
|
|
@dragleave="onDragleave"
|
|
|
|
@drop.stop="onDrop"
|
|
|
|
>
|
|
|
|
<header>
|
2021-04-20 23:22:59 +09:00
|
|
|
<button v-if="!fixed" class="cancel _button" @click="cancel"><i class="fas fa-times"></i></button>
|
2020-01-30 04:37:25 +09:00
|
|
|
<div>
|
2022-01-16 01:46:25 +09:00
|
|
|
<span class="text-count" :class="{ over: textLength > maxTextLength }">{{ maxTextLength - textLength }}</span>
|
2021-11-19 19:36:12 +09:00
|
|
|
<span v-if="localOnly" class="local-only"><i class="fas fa-biohazard"></i></span>
|
|
|
|
<button ref="visibilityButton" v-tooltip="$ts.visibility" class="_button visibility" :disabled="channel != null" @click="setVisibility">
|
2021-04-20 23:22:59 +09:00
|
|
|
<span v-if="visibility === 'public'"><i class="fas fa-globe"></i></span>
|
|
|
|
<span v-if="visibility === 'home'"><i class="fas fa-home"></i></span>
|
|
|
|
<span v-if="visibility === 'followers'"><i class="fas fa-unlock"></i></span>
|
|
|
|
<span v-if="visibility === 'specified'"><i class="fas fa-envelope"></i></span>
|
2020-02-05 21:28:51 +09:00
|
|
|
</button>
|
2021-11-19 19:36:12 +09:00
|
|
|
<button v-tooltip="$ts.previewNoteText" class="_button preview" :class="{ active: showPreview }" @click="showPreview = !showPreview"><i class="fas fa-file-code"></i></button>
|
|
|
|
<button class="submit _buttonGradate" :disabled="!canPost" data-cy-open-post-form-submit @click="post">{{ submitText }}<i :class="reply ? 'fas fa-reply' : renote ? 'fas fa-quote-right' : 'fas fa-paper-plane'"></i></button>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</header>
|
2020-02-19 03:11:09 +09:00
|
|
|
<div class="form" :class="{ fixed }">
|
2021-11-19 19:36:12 +09:00
|
|
|
<XNoteSimple v-if="reply" class="preview" :note="reply"/>
|
|
|
|
<XNoteSimple v-if="renote" class="preview" :note="renote"/>
|
|
|
|
<div v-if="quoteId" class="with-quote"><i class="fas fa-quote-left"></i> {{ $ts.quoteAttached }}<button @click="quoteId = null"><i class="fas fa-times"></i></button></div>
|
2020-01-30 04:37:25 +09:00
|
|
|
<div v-if="visibility === 'specified'" class="to-specified">
|
2020-12-26 10:47:36 +09:00
|
|
|
<span style="margin-right: 8px;">{{ $ts.recipient }}</span>
|
2020-01-30 04:37:25 +09:00
|
|
|
<div class="visibleUsers">
|
2020-06-03 13:30:17 +09:00
|
|
|
<span v-for="u in visibleUsers" :key="u.id">
|
2020-10-17 20:12:00 +09:00
|
|
|
<MkAcct :user="u"/>
|
2021-04-20 23:22:59 +09:00
|
|
|
<button class="_button" @click="removeVisibleUser(u)"><i class="fas fa-times"></i></button>
|
2020-01-30 04:37:25 +09:00
|
|
|
</span>
|
2021-11-19 19:36:12 +09:00
|
|
|
<button class="_buttonPrimary" @click="addVisibleUser"><i class="fas fa-plus fa-fw"></i></button>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-19 19:36:12 +09:00
|
|
|
<MkInfo v-if="hasNotSpecifiedMentions" warn class="hasNotSpecifiedMentions">{{ $ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ $ts.add }}</button></MkInfo>
|
2022-01-16 01:46:25 +09:00
|
|
|
<input v-show="useCw" ref="cwInputEl" v-model="cw" class="cw" :placeholder="$ts.annotation" @keydown="onKeydown">
|
|
|
|
<textarea ref="textareaEl" v-model="text" class="text" :class="{ withCw: useCw }" :disabled="posting" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/>
|
|
|
|
<input v-show="withHashtags" ref="hashtagsInputEl" v-model="hashtags" class="hashtags" :placeholder="$ts.hashtags" list="hashtags">
|
2020-12-05 12:50:09 +09:00
|
|
|
<XPostFormAttaches class="attaches" :files="files" @updated="updateFiles" @detach="detachFile" @changeSensitive="updateFileSensitive" @changeName="updateFileName"/>
|
2020-10-17 20:12:00 +09:00
|
|
|
<XPollEditor v-if="poll" :poll="poll" @destroyed="poll = null" @updated="onPollUpdate"/>
|
2021-11-19 19:36:12 +09:00
|
|
|
<XNotePreview v-if="showPreview" class="preview" :text="text"/>
|
2020-01-30 04:37:25 +09:00
|
|
|
<footer>
|
2021-11-19 19:36:12 +09:00
|
|
|
<button v-tooltip="$ts.attachFile" class="_button" @click="chooseFileFrom"><i class="fas fa-photo-video"></i></button>
|
|
|
|
<button v-tooltip="$ts.poll" class="_button" :class="{ active: poll }" @click="togglePoll"><i class="fas fa-poll-h"></i></button>
|
|
|
|
<button v-tooltip="$ts.useCw" class="_button" :class="{ active: useCw }" @click="useCw = !useCw"><i class="fas fa-eye-slash"></i></button>
|
|
|
|
<button v-tooltip="$ts.mention" class="_button" @click="insertMention"><i class="fas fa-at"></i></button>
|
|
|
|
<button v-tooltip="$ts.hashtags" class="_button" :class="{ active: withHashtags }" @click="withHashtags = !withHashtags"><i class="fas fa-hashtag"></i></button>
|
|
|
|
<button v-tooltip="$ts.emoji" class="_button" @click="insertEmoji"><i class="fas fa-laugh-squint"></i></button>
|
|
|
|
<button v-if="postFormActions.length > 0" v-tooltip="$ts.plugin" class="_button" @click="showActions"><i class="fas fa-plug"></i></button>
|
2020-01-30 04:37:25 +09:00
|
|
|
</footer>
|
2021-08-07 12:47:01 +09:00
|
|
|
<datalist id="hashtags">
|
2021-11-19 19:36:12 +09:00
|
|
|
<option v-for="hashtag in recentHashtags" :key="hashtag" :value="hashtag"/>
|
2021-08-07 12:47:01 +09:00
|
|
|
</datalist>
|
2020-01-30 04:37:25 +09:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { inject, watch, nextTick, onMounted } from 'vue';
|
|
|
|
import * as mfm from 'mfm-js';
|
|
|
|
import * as misskey from 'misskey-js';
|
2019-05-27 15:38:14 +09:00
|
|
|
import insertTextAtCursor from 'insert-text-at-cursor';
|
|
|
|
import { length } from 'stringz';
|
2021-04-04 13:00:39 +09:00
|
|
|
import { toASCII } from 'punycode/';
|
2021-10-16 01:28:34 +09:00
|
|
|
import XNoteSimple from './note-simple.vue';
|
2021-10-16 01:34:23 +09:00
|
|
|
import XNotePreview from './note-preview.vue';
|
2022-01-16 01:46:25 +09:00
|
|
|
import XPostFormAttaches from './post-form-attaches.vue';
|
|
|
|
import XPollEditor from './poll-editor.vue';
|
2021-11-12 02:02:25 +09:00
|
|
|
import { host, url } from '@/config';
|
|
|
|
import { erase, unique } from '@/scripts/array';
|
|
|
|
import { extractMentions } from '@/scripts/extract-mentions';
|
|
|
|
import * as Acct from 'misskey-js/built/acct';
|
|
|
|
import { formatTimeString } from '@/scripts/format-time-string';
|
|
|
|
import { Autocomplete } from '@/scripts/autocomplete';
|
|
|
|
import * as os from '@/os';
|
2021-12-29 22:13:09 +09:00
|
|
|
import { stream } from '@/stream';
|
2021-12-10 01:22:22 +09:00
|
|
|
import { selectFiles } from '@/scripts/select-file';
|
2021-11-12 02:02:25 +09:00
|
|
|
import { defaultStore, notePostInterruptors, postFormActions } from '@/store';
|
2021-02-20 20:20:05 +09:00
|
|
|
import { throttle } from 'throttle-debounce';
|
2021-11-12 02:02:25 +09:00
|
|
|
import MkInfo from '@/components/ui/info.vue';
|
2022-01-16 01:46:25 +09:00
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { instance } from '@/instance';
|
|
|
|
import { $i } from '@/account';
|
|
|
|
|
|
|
|
const modal = inject('modal');
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
reply?: misskey.entities.Note;
|
|
|
|
renote?: misskey.entities.Note;
|
|
|
|
channel?: any; // TODO
|
|
|
|
mention?: misskey.entities.User;
|
|
|
|
specified?: misskey.entities.User;
|
|
|
|
initialText?: string;
|
|
|
|
initialVisibility?: typeof misskey.noteVisibilities;
|
|
|
|
initialFiles?: misskey.entities.DriveFile[];
|
|
|
|
initialLocalOnly?: boolean;
|
|
|
|
initialVisibleUsers?: misskey.entities.User[];
|
|
|
|
initialNote?: misskey.entities.Note;
|
|
|
|
share?: boolean;
|
|
|
|
fixed?: boolean;
|
|
|
|
autofocus?: boolean;
|
|
|
|
}>(), {
|
|
|
|
initialVisibleUsers: [],
|
|
|
|
autofocus: true,
|
|
|
|
});
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const emit = defineEmits<{
|
|
|
|
(e: 'posted'): void;
|
|
|
|
(e: 'cancel'): void;
|
|
|
|
(e: 'esc'): void;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
const textareaEl = $ref<HTMLTextAreaElement | null>(null);
|
|
|
|
const cwInputEl = $ref<HTMLInputElement | null>(null);
|
|
|
|
const hashtagsInputEl = $ref<HTMLInputElement | null>(null);
|
|
|
|
const visibilityButton = $ref<HTMLElement | null>(null);
|
|
|
|
|
|
|
|
let posting = $ref(false);
|
|
|
|
let text = $ref(props.initialText ?? '');
|
|
|
|
let files = $ref(props.initialFiles ?? []);
|
|
|
|
let poll = $ref<{
|
|
|
|
choices: string[];
|
|
|
|
multiple: boolean;
|
|
|
|
expiresAt: string;
|
|
|
|
expiredAfter: string;
|
|
|
|
} | null>(null);
|
|
|
|
let useCw = $ref(false);
|
|
|
|
let showPreview = $ref(false);
|
|
|
|
let cw = $ref<string | null>(null);
|
|
|
|
let localOnly = $ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
|
|
|
|
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof misskey.noteVisibilities[number]);
|
|
|
|
let visibleUsers = $ref(props.initialVisibleUsers ?? []);
|
|
|
|
let autocomplete = $ref(null);
|
|
|
|
let draghover = $ref(false);
|
|
|
|
let quoteId = $ref(null);
|
|
|
|
let hasNotSpecifiedMentions = $ref(false);
|
|
|
|
let recentHashtags = $ref(JSON.parse(localStorage.getItem('hashtags') || '[]'));
|
|
|
|
let imeText = $ref('');
|
|
|
|
|
|
|
|
const typing = throttle(3000, () => {
|
|
|
|
if (props.channel) {
|
|
|
|
stream.send('typingOnChannel', { channel: props.channel.id });
|
|
|
|
}
|
|
|
|
});
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const draftKey = $computed((): string => {
|
|
|
|
let key = props.channel ? `channel:${props.channel.id}` : '';
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (props.renote) {
|
|
|
|
key += `renote:${props.renote.id}`;
|
|
|
|
} else if (props.reply) {
|
|
|
|
key += `reply:${props.reply.id}`;
|
|
|
|
} else {
|
|
|
|
key += 'note';
|
|
|
|
}
|
2021-01-15 23:20:47 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
return key;
|
|
|
|
});
|
2020-02-10 23:17:42 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const placeholder = $computed((): string => {
|
|
|
|
if (props.renote) {
|
|
|
|
return i18n.locale._postForm.quotePlaceholder;
|
|
|
|
} else if (props.reply) {
|
|
|
|
return i18n.locale._postForm.replyPlaceholder;
|
|
|
|
} else if (props.channel) {
|
|
|
|
return i18n.locale._postForm.channelPlaceholder;
|
|
|
|
} else {
|
|
|
|
const xs = [
|
|
|
|
i18n.locale._postForm._placeholders.a,
|
|
|
|
i18n.locale._postForm._placeholders.b,
|
|
|
|
i18n.locale._postForm._placeholders.c,
|
|
|
|
i18n.locale._postForm._placeholders.d,
|
|
|
|
i18n.locale._postForm._placeholders.e,
|
|
|
|
i18n.locale._postForm._placeholders.f
|
|
|
|
];
|
|
|
|
return xs[Math.floor(Math.random() * xs.length)];
|
|
|
|
}
|
|
|
|
});
|
2021-08-07 12:47:01 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const submitText = $computed((): string => {
|
|
|
|
return props.renote
|
|
|
|
? i18n.locale.quote
|
|
|
|
: props.reply
|
|
|
|
? i18n.locale.reply
|
|
|
|
: i18n.locale.note;
|
|
|
|
});
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const textLength = $computed((): number => {
|
|
|
|
return length((text + imeText).trim());
|
|
|
|
});
|
2021-04-16 00:13:20 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const maxTextLength = $computed((): number => {
|
|
|
|
return instance ? instance.maxNoteTextLength : 1000;
|
|
|
|
});
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const canPost = $computed((): boolean => {
|
|
|
|
return !posting &&
|
|
|
|
(1 <= textLength || 1 <= files.length || !!poll || !!props.renote) &&
|
|
|
|
(textLength <= maxTextLength) &&
|
|
|
|
(!poll || poll.choices.length >= 2);
|
|
|
|
});
|
2021-10-20 03:10:36 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const withHashtags = $computed(defaultStore.makeGetterSetter('postFormWithHashtags'));
|
|
|
|
const hashtags = $computed(defaultStore.makeGetterSetter('postFormHashtags'));
|
2021-10-20 03:10:36 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
watch($$(text), () => {
|
|
|
|
checkMissingMention();
|
|
|
|
});
|
2021-10-20 03:10:36 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
watch($$(visibleUsers), () => {
|
|
|
|
checkMissingMention();
|
|
|
|
}, {
|
|
|
|
deep: true,
|
|
|
|
});
|
2021-11-18 23:32:43 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (props.mention) {
|
|
|
|
text = props.mention.host ? `@${props.mention.username}@${toASCII(props.mention.host)}` : `@${props.mention.username}`;
|
|
|
|
text += ' ';
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (props.reply && (props.reply.user.username != $i.username || (props.reply.user.host != null && props.reply.user.host != host))) {
|
|
|
|
text = `@${props.reply.user.username}${props.reply.user.host != null ? '@' + toASCII(props.reply.user.host) : ''} `;
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (props.reply && props.reply.text != null) {
|
|
|
|
const ast = mfm.parse(props.reply.text);
|
|
|
|
const otherHost = props.reply.user.host;
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
for (const x of extractMentions(ast)) {
|
|
|
|
const mention = x.host ?
|
|
|
|
`@${x.username}@${toASCII(x.host)}` :
|
|
|
|
(otherHost == null || otherHost == host) ?
|
|
|
|
`@${x.username}` :
|
|
|
|
`@${x.username}@${toASCII(otherHost)}`;
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// 自分は除外
|
|
|
|
if ($i.username == x.username && x.host == null) continue;
|
|
|
|
if ($i.username == x.username && x.host == host) continue;
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// 重複は除外
|
|
|
|
if (text.indexOf(`${mention} `) != -1) continue;
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
text += `${mention} `;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (props.channel) {
|
|
|
|
visibility = 'public';
|
|
|
|
localOnly = true; // TODO: チャンネルが連合するようになった折には消す
|
|
|
|
}
|
|
|
|
|
|
|
|
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
|
|
|
|
if (props.reply && ['home', 'followers', 'specified'].includes(props.reply.visibility)) {
|
|
|
|
visibility = props.reply.visibility;
|
|
|
|
if (props.reply.visibility === 'specified') {
|
|
|
|
os.api('users/show', {
|
|
|
|
userIds: props.reply.visibleUserIds.filter(uid => uid !== $i.id && uid !== props.reply.userId)
|
|
|
|
}).then(users => {
|
|
|
|
visibleUsers.push(...users);
|
|
|
|
});
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (props.reply.userId !== $i.id) {
|
|
|
|
os.api('users/show', { userId: props.reply.userId }).then(user => {
|
|
|
|
visibleUsers.push(user);
|
|
|
|
});
|
2020-08-18 22:44:21 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (props.specified) {
|
|
|
|
visibility = 'specified';
|
|
|
|
visibleUsers.push(props.specified);
|
|
|
|
}
|
|
|
|
|
|
|
|
// keep cw when reply
|
|
|
|
if (defaultStore.state.keepCw && props.reply && props.reply.cw) {
|
|
|
|
useCw = true;
|
|
|
|
cw = props.reply.cw;
|
|
|
|
}
|
|
|
|
|
|
|
|
function watchForDraft() {
|
|
|
|
watch($$(text), () => saveDraft());
|
|
|
|
watch($$(useCw), () => saveDraft());
|
|
|
|
watch($$(cw), () => saveDraft());
|
|
|
|
watch($$(poll), () => saveDraft());
|
|
|
|
watch($$(files), () => saveDraft(), { deep: true });
|
|
|
|
watch($$(visibility), () => saveDraft());
|
|
|
|
watch($$(localOnly), () => saveDraft());
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkMissingMention() {
|
|
|
|
if (visibility === 'specified') {
|
|
|
|
const ast = mfm.parse(text);
|
|
|
|
|
|
|
|
for (const x of extractMentions(ast)) {
|
|
|
|
if (!visibleUsers.some(u => (u.username === x.username) && (u.host == x.host))) {
|
|
|
|
hasNotSpecifiedMentions = true;
|
|
|
|
return;
|
2019-08-25 16:12:01 +09:00
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
hasNotSpecifiedMentions = false;
|
|
|
|
}
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function addMissingMention() {
|
|
|
|
const ast = mfm.parse(text);
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
for (const x of extractMentions(ast)) {
|
|
|
|
if (!visibleUsers.some(u => (u.username === x.username) && (u.host == x.host))) {
|
|
|
|
os.api('users/show', { username: x.username, host: x.host }).then(user => {
|
|
|
|
visibleUsers.push(user);
|
2020-10-17 20:12:00 +09:00
|
|
|
});
|
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function togglePoll() {
|
|
|
|
if (poll) {
|
|
|
|
poll = null;
|
|
|
|
} else {
|
|
|
|
poll = {
|
|
|
|
choices: ['', ''],
|
|
|
|
multiple: false,
|
|
|
|
expiresAt: null,
|
|
|
|
expiredAfter: null,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function addTag(tag: string) {
|
|
|
|
insertTextAtCursor(textareaEl, ` #${tag} `);
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function focus() {
|
|
|
|
textareaEl.focus();
|
|
|
|
}
|
2021-04-16 00:13:20 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function chooseFileFrom(ev) {
|
2022-01-19 23:51:28 +09:00
|
|
|
selectFiles(ev.currentTarget || ev.target, i18n.locale.attachFile).then(files_ => {
|
|
|
|
for (const file of files_) {
|
2022-01-16 01:46:25 +09:00
|
|
|
files.push(file);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function detachFile(id) {
|
|
|
|
files = files.filter(x => x.id != id);
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateFiles(files) {
|
|
|
|
files = files;
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateFileSensitive(file, sensitive) {
|
|
|
|
files[files.findIndex(x => x.id === file.id)].isSensitive = sensitive;
|
|
|
|
}
|
|
|
|
|
|
|
|
function updateFileName(file, name) {
|
|
|
|
files[files.findIndex(x => x.id === file.id)].name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
function upload(file: File, name?: string) {
|
|
|
|
os.upload(file, defaultStore.state.uploadFolder, name).then(res => {
|
|
|
|
files.push(res);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function onPollUpdate(poll) {
|
|
|
|
poll = poll;
|
|
|
|
saveDraft();
|
|
|
|
}
|
|
|
|
|
|
|
|
function setVisibility() {
|
|
|
|
if (props.channel) {
|
|
|
|
// TODO: information dialog
|
|
|
|
return;
|
|
|
|
}
|
2021-04-16 00:13:20 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
os.popup(import('./visibility-picker.vue'), {
|
|
|
|
currentVisibility: visibility,
|
|
|
|
currentLocalOnly: localOnly,
|
|
|
|
src: visibilityButton,
|
|
|
|
}, {
|
2022-01-16 08:49:27 +09:00
|
|
|
changeVisibility: v => {
|
|
|
|
visibility = v;
|
2022-01-16 01:46:25 +09:00
|
|
|
if (defaultStore.state.rememberNoteVisibility) {
|
|
|
|
defaultStore.set('visibility', visibility);
|
2021-04-16 00:13:20 +09:00
|
|
|
}
|
|
|
|
},
|
2022-01-16 08:49:27 +09:00
|
|
|
changeLocalOnly: v => {
|
|
|
|
localOnly = v;
|
2022-01-16 01:46:25 +09:00
|
|
|
if (defaultStore.state.rememberNoteVisibility) {
|
|
|
|
defaultStore.set('localOnly', localOnly);
|
2020-10-17 20:12:00 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
}
|
|
|
|
}, 'closed');
|
|
|
|
}
|
|
|
|
|
|
|
|
function addVisibleUser() {
|
|
|
|
os.selectUser().then(user => {
|
|
|
|
visibleUsers.push(user);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function removeVisibleUser(user) {
|
|
|
|
visibleUsers = erase(user, visibleUsers);
|
|
|
|
}
|
|
|
|
|
|
|
|
function clear() {
|
|
|
|
text = '';
|
|
|
|
files = [];
|
|
|
|
poll = null;
|
|
|
|
quoteId = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
function onKeydown(e: KeyboardEvent) {
|
|
|
|
if ((e.which === 10 || e.which === 13) && (e.ctrlKey || e.metaKey) && canPost) post();
|
|
|
|
if (e.which === 27) emit('esc');
|
|
|
|
typing();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onCompositionUpdate(e: CompositionEvent) {
|
|
|
|
imeText = e.data;
|
|
|
|
typing();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onCompositionEnd(e: CompositionEvent) {
|
|
|
|
imeText = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
async function onPaste(e: ClipboardEvent) {
|
|
|
|
for (const { item, i } of Array.from(e.clipboardData.items).map((item, i) => ({item, i}))) {
|
|
|
|
if (item.kind == 'file') {
|
|
|
|
const file = item.getAsFile();
|
|
|
|
const lio = file.name.lastIndexOf('.');
|
|
|
|
const ext = lio >= 0 ? file.name.slice(lio) : '';
|
|
|
|
const formatted = `${formatTimeString(new Date(file.lastModified), defaultStore.state.pastedFileName).replace(/{{number}}/g, `${i + 1}`)}${ext}`;
|
|
|
|
upload(file, formatted);
|
|
|
|
}
|
|
|
|
}
|
2020-12-05 12:50:09 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
const paste = e.clipboardData.getData('text');
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
if (!props.renote && !quoteId && paste.startsWith(url + '/notes/')) {
|
|
|
|
e.preventDefault();
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
os.confirm({
|
|
|
|
type: 'info',
|
|
|
|
text: i18n.locale.quoteQuestion,
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) {
|
|
|
|
insertTextAtCursor(textareaEl, paste);
|
2020-08-18 22:44:21 +09:00
|
|
|
return;
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
quoteId = paste.substr(url.length).match(/^\/notes\/(.+?)\/?$/)[1];
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDragover(e) {
|
|
|
|
if (!e.dataTransfer.items[0]) return;
|
|
|
|
const isFile = e.dataTransfer.items[0].kind == 'file';
|
|
|
|
const isDriveFile = e.dataTransfer.types[0] == _DATA_TRANSFER_DRIVE_FILE_;
|
|
|
|
if (isFile || isDriveFile) {
|
|
|
|
e.preventDefault();
|
|
|
|
draghover = true;
|
|
|
|
e.dataTransfer.dropEffect = e.dataTransfer.effectAllowed == 'all' ? 'copy' : 'move';
|
|
|
|
}
|
|
|
|
}
|
2021-01-15 23:20:47 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function onDragenter(e) {
|
|
|
|
draghover = true;
|
|
|
|
}
|
2021-01-15 23:20:47 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function onDragleave(e) {
|
|
|
|
draghover = false;
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
function onDrop(e): void {
|
|
|
|
draghover = false;
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// ファイルだったら
|
|
|
|
if (e.dataTransfer.files.length > 0) {
|
|
|
|
e.preventDefault();
|
|
|
|
for (const x of Array.from(e.dataTransfer.files)) upload(x);
|
|
|
|
return;
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
//#region ドライブのファイル
|
|
|
|
const driveFile = e.dataTransfer.getData(_DATA_TRANSFER_DRIVE_FILE_);
|
|
|
|
if (driveFile != null && driveFile != '') {
|
|
|
|
const file = JSON.parse(driveFile);
|
|
|
|
files.push(file);
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
}
|
|
|
|
|
|
|
|
function saveDraft() {
|
|
|
|
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
|
|
|
|
|
|
|
data[draftKey] = {
|
|
|
|
updatedAt: new Date(),
|
|
|
|
data: {
|
|
|
|
text: text,
|
|
|
|
useCw: useCw,
|
|
|
|
cw: cw,
|
|
|
|
visibility: visibility,
|
|
|
|
localOnly: localOnly,
|
|
|
|
files: files,
|
|
|
|
poll: poll
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
localStorage.setItem('drafts', JSON.stringify(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
function deleteDraft() {
|
|
|
|
const data = JSON.parse(localStorage.getItem('drafts') || '{}');
|
|
|
|
|
|
|
|
delete data[draftKey];
|
|
|
|
|
|
|
|
localStorage.setItem('drafts', JSON.stringify(data));
|
|
|
|
}
|
|
|
|
|
|
|
|
async function post() {
|
|
|
|
let data = {
|
|
|
|
text: text == '' ? undefined : text,
|
|
|
|
fileIds: files.length > 0 ? files.map(f => f.id) : undefined,
|
|
|
|
replyId: props.reply ? props.reply.id : undefined,
|
|
|
|
renoteId: props.renote ? props.renote.id : quoteId ? quoteId : undefined,
|
|
|
|
channelId: props.channel ? props.channel.id : undefined,
|
|
|
|
poll: poll,
|
|
|
|
cw: useCw ? cw || '' : undefined,
|
|
|
|
localOnly: localOnly,
|
|
|
|
visibility: visibility,
|
|
|
|
visibleUserIds: visibility == 'specified' ? visibleUsers.map(u => u.id) : undefined,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (withHashtags && hashtags && hashtags.trim() !== '') {
|
|
|
|
const hashtags = hashtags.trim().split(' ').map(x => x.startsWith('#') ? x : '#' + x).join(' ');
|
|
|
|
data.text = data.text ? `${data.text} ${hashtags}` : hashtags;
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// plugin
|
|
|
|
if (notePostInterruptors.length > 0) {
|
|
|
|
for (const interruptor of notePostInterruptors) {
|
|
|
|
data = await interruptor.handler(JSON.parse(JSON.stringify(data)));
|
|
|
|
}
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
posting = true;
|
|
|
|
os.api('notes/create', data).then(() => {
|
|
|
|
clear();
|
|
|
|
nextTick(() => {
|
|
|
|
deleteDraft();
|
|
|
|
emit('posted');
|
|
|
|
if (data.text && data.text != '') {
|
|
|
|
const hashtags = mfm.parse(data.text).filter(x => x.type === 'hashtag').map(x => x.props.hashtag);
|
|
|
|
const history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
|
|
|
|
localStorage.setItem('hashtags', JSON.stringify(unique(hashtags.concat(history))));
|
2019-05-27 15:38:14 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
posting = false;
|
|
|
|
});
|
|
|
|
}).catch(err => {
|
|
|
|
posting = false;
|
|
|
|
os.alert({
|
|
|
|
type: 'error',
|
|
|
|
text: err.message + '\n' + (err as any).id,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function cancel() {
|
|
|
|
emit('cancel');
|
|
|
|
}
|
|
|
|
|
|
|
|
function insertMention() {
|
|
|
|
os.selectUser().then(user => {
|
|
|
|
insertTextAtCursor(textareaEl, '@' + Acct.toString(user) + ' ');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async function insertEmoji(ev) {
|
|
|
|
os.openEmojiPicker(ev.currentTarget || ev.target, {}, textareaEl);
|
|
|
|
}
|
|
|
|
|
|
|
|
function showActions(ev) {
|
|
|
|
os.popupMenu(postFormActions.map(action => ({
|
|
|
|
text: action.title,
|
|
|
|
action: () => {
|
|
|
|
action.handler({
|
|
|
|
text: text
|
|
|
|
}, (key, value) => {
|
|
|
|
if (key === 'text') { text = value; }
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})), ev.currentTarget || ev.target);
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
onMounted(() => {
|
|
|
|
if (props.autofocus) {
|
|
|
|
focus();
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
nextTick(() => {
|
|
|
|
focus();
|
|
|
|
});
|
|
|
|
}
|
2019-05-27 15:38:14 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// TODO: detach when unmount
|
|
|
|
new Autocomplete(textareaEl, $$(text));
|
|
|
|
new Autocomplete(cwInputEl, $$(cw));
|
|
|
|
new Autocomplete(hashtagsInputEl, $$(hashtags));
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
// 書きかけの投稿を復元
|
|
|
|
if (!props.share && !props.mention && !props.specified) {
|
|
|
|
const draft = JSON.parse(localStorage.getItem('drafts') || '{}')[draftKey];
|
|
|
|
if (draft) {
|
|
|
|
text = draft.data.text;
|
|
|
|
useCw = draft.data.useCw;
|
|
|
|
cw = draft.data.cw;
|
|
|
|
visibility = draft.data.visibility;
|
|
|
|
localOnly = draft.data.localOnly;
|
|
|
|
files = (draft.data.files || []).filter(e => e);
|
|
|
|
if (draft.data.poll) {
|
|
|
|
poll = draft.data.poll;
|
2019-05-27 15:38:14 +09:00
|
|
|
}
|
2021-08-07 12:47:01 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
}
|
2021-08-07 12:47:01 +09:00
|
|
|
|
2022-01-16 01:46:25 +09:00
|
|
|
// 削除して編集
|
|
|
|
if (props.initialNote) {
|
|
|
|
const init = props.initialNote;
|
|
|
|
text = init.text ? init.text : '';
|
|
|
|
files = init.files;
|
|
|
|
cw = init.cw;
|
|
|
|
useCw = init.cw != null;
|
|
|
|
if (init.poll) {
|
|
|
|
poll = {
|
|
|
|
choices: init.poll.choices.map(x => x.text),
|
|
|
|
multiple: init.poll.multiple,
|
|
|
|
expiresAt: init.poll.expiresAt,
|
|
|
|
expiredAfter: init.poll.expiredAfter,
|
|
|
|
};
|
2020-07-29 23:37:50 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
visibility = init.visibility;
|
|
|
|
localOnly = init.localOnly;
|
|
|
|
quoteId = init.renote ? init.renote.id : null;
|
2020-07-12 00:38:55 +09:00
|
|
|
}
|
2022-01-16 01:46:25 +09:00
|
|
|
|
|
|
|
nextTick(() => watchForDraft());
|
|
|
|
});
|
2019-05-27 15:38:14 +09:00
|
|
|
});
|
2020-01-30 04:37:25 +09:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.gafaadew {
|
2020-10-17 20:12:00 +09:00
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&.modal {
|
|
|
|
width: 100%;
|
|
|
|
max-width: 520px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
> header {
|
|
|
|
z-index: 1000;
|
|
|
|
height: 66px;
|
|
|
|
|
|
|
|
> .cancel {
|
|
|
|
padding: 0;
|
|
|
|
font-size: 20px;
|
|
|
|
width: 64px;
|
|
|
|
line-height: 66px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> div {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
> .text-count {
|
2020-02-12 02:55:35 +09:00
|
|
|
opacity: 0.7;
|
2020-01-30 04:37:25 +09:00
|
|
|
line-height: 66px;
|
|
|
|
}
|
|
|
|
|
2020-02-05 21:28:51 +09:00
|
|
|
> .visibility {
|
|
|
|
height: 34px;
|
|
|
|
width: 34px;
|
2021-10-16 01:19:49 +09:00
|
|
|
margin: 0 0 0 8px;
|
2020-05-16 21:50:16 +09:00
|
|
|
|
|
|
|
& + .localOnly {
|
|
|
|
margin-left: 0 !important;
|
|
|
|
}
|
|
|
|
}
|
2020-06-04 22:06:38 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
> .local-only {
|
|
|
|
margin: 0 0 0 12px;
|
|
|
|
opacity: 0.7;
|
2020-02-05 21:28:51 +09:00
|
|
|
}
|
|
|
|
|
2021-10-16 01:19:49 +09:00
|
|
|
> .preview {
|
|
|
|
display: inline-block;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
font-size: 16px;
|
|
|
|
width: 34px;
|
|
|
|
height: 34px;
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: var(--X5);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
> .submit {
|
2020-02-05 21:28:51 +09:00
|
|
|
margin: 16px 16px 16px 0;
|
2020-02-08 17:49:54 +09:00
|
|
|
padding: 0 12px;
|
2020-01-30 04:37:25 +09:00
|
|
|
line-height: 34px;
|
2020-02-08 17:49:54 +09:00
|
|
|
font-weight: bold;
|
2020-01-30 04:37:25 +09:00
|
|
|
vertical-align: bottom;
|
|
|
|
border-radius: 4px;
|
2021-10-16 15:00:55 +09:00
|
|
|
font-size: 0.9em;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2020-02-08 17:49:54 +09:00
|
|
|
|
2021-04-20 23:22:59 +09:00
|
|
|
> i {
|
2020-02-08 17:49:54 +09:00
|
|
|
margin-left: 6px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .form {
|
|
|
|
> .preview {
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .with-quote {
|
|
|
|
margin: 0 0 8px 0;
|
|
|
|
color: var(--accent);
|
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 4px 8px;
|
|
|
|
color: var(--accentAlpha04);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--accentAlpha06);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
color: var(--accentDarken30);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .to-specified {
|
|
|
|
padding: 6px 24px;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
overflow: auto;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
> .visibleUsers {
|
|
|
|
display: inline;
|
|
|
|
top: -1px;
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 4px;
|
|
|
|
border-radius: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> span {
|
|
|
|
margin-right: 14px;
|
|
|
|
padding: 8px 0 8px 8px;
|
|
|
|
border-radius: 8px;
|
2020-07-05 03:49:58 +09:00
|
|
|
background: var(--X4);
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
> button {
|
|
|
|
padding: 4px 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-16 00:13:20 +09:00
|
|
|
> .hasNotSpecifiedMentions {
|
|
|
|
margin: 0 20px 16px 20px;
|
|
|
|
}
|
|
|
|
|
2020-02-05 08:59:24 +09:00
|
|
|
> .cw,
|
2021-08-07 12:47:01 +09:00
|
|
|
> .hashtags,
|
2020-02-05 08:59:24 +09:00
|
|
|
> .text {
|
2020-01-30 04:37:25 +09:00
|
|
|
display: block;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 0 24px;
|
|
|
|
margin: 0;
|
|
|
|
width: 100%;
|
|
|
|
font-size: 16px;
|
|
|
|
border: none;
|
|
|
|
border-radius: 0;
|
|
|
|
background: transparent;
|
|
|
|
color: var(--fg);
|
2020-02-09 19:59:28 +09:00
|
|
|
font-family: inherit;
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2021-11-08 03:43:14 +09:00
|
|
|
&:focus {
|
2020-01-30 04:37:25 +09:00
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-05 08:59:24 +09:00
|
|
|
> .cw {
|
|
|
|
z-index: 1;
|
|
|
|
padding-bottom: 8px;
|
2021-04-10 12:40:50 +09:00
|
|
|
border-bottom: solid 0.5px var(--divider);
|
2020-02-05 08:59:24 +09:00
|
|
|
}
|
|
|
|
|
2021-08-07 12:47:01 +09:00
|
|
|
> .hashtags {
|
|
|
|
z-index: 1;
|
|
|
|
padding-top: 8px;
|
|
|
|
padding-bottom: 8px;
|
|
|
|
border-top: solid 0.5px var(--divider);
|
|
|
|
}
|
|
|
|
|
2020-02-05 08:59:24 +09:00
|
|
|
> .text {
|
2020-01-30 04:37:25 +09:00
|
|
|
max-width: 100%;
|
|
|
|
min-width: 100%;
|
|
|
|
min-height: 90px;
|
|
|
|
|
2020-02-05 08:59:24 +09:00
|
|
|
&.withCw {
|
|
|
|
padding-top: 8px;
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
> footer {
|
|
|
|
padding: 0 16px 16px 16px;
|
|
|
|
|
2020-02-05 09:15:28 +09:00
|
|
|
> button {
|
2020-01-30 04:37:25 +09:00
|
|
|
display: inline-block;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-size: 16px;
|
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
|
|
&:hover {
|
2020-07-05 03:49:58 +09:00
|
|
|
background: var(--X5);
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
2020-02-05 09:15:28 +09:00
|
|
|
|
|
|
|
&.active {
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-10-17 20:12:00 +09:00
|
|
|
|
|
|
|
&.max-width_500px {
|
|
|
|
> header {
|
|
|
|
height: 50px;
|
|
|
|
|
|
|
|
> .cancel {
|
|
|
|
width: 50px;
|
|
|
|
line-height: 50px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> div {
|
|
|
|
> .text-count {
|
|
|
|
line-height: 50px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .submit {
|
|
|
|
margin: 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .form {
|
|
|
|
> .to-specified {
|
|
|
|
padding: 6px 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .cw,
|
2021-08-07 12:47:01 +09:00
|
|
|
> .hashtags,
|
2020-10-17 20:12:00 +09:00
|
|
|
> .text {
|
|
|
|
padding: 0 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .text {
|
|
|
|
min-height: 80px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> footer {
|
|
|
|
padding: 0 8px 8px 8px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-10-14 18:51:15 +09:00
|
|
|
|
|
|
|
&.max-width_310px {
|
|
|
|
> .form {
|
|
|
|
> footer {
|
|
|
|
> button {
|
|
|
|
font-size: 14px;
|
|
|
|
width: 44px;
|
|
|
|
height: 44px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
</style>
|