mirror of
https://github.com/paricafe/misskey.git
synced 2025-02-26 03:24:25 -06:00
autosize
This commit is contained in:
parent
337cae0522
commit
11103527b0
2 changed files with 13 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
||||||
"@vue/compiler-sfc": "3.4.37",
|
"@vue/compiler-sfc": "3.4.37",
|
||||||
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.11",
|
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.11",
|
||||||
"astring": "1.8.6",
|
"astring": "1.8.6",
|
||||||
|
"autosize": "^6.0.1",
|
||||||
"broadcast-channel": "7.0.0",
|
"broadcast-channel": "7.0.0",
|
||||||
"buraha": "0.0.1",
|
"buraha": "0.0.1",
|
||||||
"canvas-confetti": "1.9.3",
|
"canvas-confetti": "1.9.3",
|
||||||
|
@ -96,6 +97,7 @@
|
||||||
"@storybook/vue3": "8.2.6",
|
"@storybook/vue3": "8.2.6",
|
||||||
"@storybook/vue3-vite": "8.1.11",
|
"@storybook/vue3-vite": "8.1.11",
|
||||||
"@testing-library/vue": "8.1.0",
|
"@testing-library/vue": "8.1.0",
|
||||||
|
"@types/autosize": "^4.0.3",
|
||||||
"@types/escape-regexp": "0.0.3",
|
"@types/escape-regexp": "0.0.3",
|
||||||
"@types/estree": "1.0.5",
|
"@types/estree": "1.0.5",
|
||||||
"@types/matter-js": "0.19.7",
|
"@types/matter-js": "0.19.7",
|
||||||
|
|
|
@ -105,6 +105,7 @@ import * as mfm from 'mfm-js';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||||
import { toASCII } from 'punycode/';
|
import { toASCII } from 'punycode/';
|
||||||
|
import autosize from 'autosize';
|
||||||
import MkNoteSimple from '@/components/MkNoteSimple.vue';
|
import MkNoteSimple from '@/components/MkNoteSimple.vue';
|
||||||
import MkNotePreview from '@/components/MkNotePreview.vue';
|
import MkNotePreview from '@/components/MkNotePreview.vue';
|
||||||
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue';
|
import XPostFormAttaches from '@/components/MkPostFormAttaches.vue';
|
||||||
|
@ -569,20 +570,28 @@ function clear() {
|
||||||
files.value = [];
|
files.value = [];
|
||||||
poll.value = null;
|
poll.value = null;
|
||||||
quoteId.value = null;
|
quoteId.value = null;
|
||||||
|
|
||||||
|
nextTick(() => textareaEl.value && autosize.update(textareaEl.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onKeydown(ev: KeyboardEvent) {
|
function onKeydown(ev: KeyboardEvent) {
|
||||||
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey) && canPost.value) post();
|
if (ev.key === 'Enter' && (ev.ctrlKey || ev.metaKey) && canPost.value) post();
|
||||||
|
|
||||||
if (ev.key === 'Escape') emit('esc');
|
if (ev.key === 'Escape') emit('esc');
|
||||||
|
|
||||||
|
nextTick(() => textareaEl.value && autosize.update(textareaEl.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCompositionUpdate(ev: CompositionEvent) {
|
function onCompositionUpdate(ev: CompositionEvent) {
|
||||||
imeText.value = ev.data;
|
imeText.value = ev.data;
|
||||||
|
|
||||||
|
nextTick(() => textareaEl.value && autosize.update(textareaEl.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCompositionEnd(ev: CompositionEvent) {
|
function onCompositionEnd(ev: CompositionEvent) {
|
||||||
imeText.value = '';
|
imeText.value = '';
|
||||||
|
|
||||||
|
nextTick(() => textareaEl.value && autosize.update(textareaEl.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onPaste(ev: ClipboardEvent) {
|
async function onPaste(ev: ClipboardEvent) {
|
||||||
|
@ -634,6 +643,7 @@ async function onPaste(ev: ClipboardEvent) {
|
||||||
upload(file, `${fileName}.txt`);
|
upload(file, `${fileName}.txt`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
nextTick(() => textareaEl.value && autosize.update(textareaEl.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDragover(ev) {
|
function onDragover(ev) {
|
||||||
|
@ -1042,6 +1052,7 @@ onMounted(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
nextTick(() => watchForDraft());
|
nextTick(() => watchForDraft());
|
||||||
|
nextTick(() => textareaEl.value && autosize(textareaEl.value));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue