feat: paste task from button

This commit is contained in:
Julien Calixte
2026-01-26 19:54:57 +01:00
parent 84bf48d866
commit bc64500bae
2 changed files with 2028 additions and 4824 deletions

5696
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -26,8 +26,11 @@ const extractTitleFromPaste = (
return { title: null, content: text } return { title: null, content: text }
} }
const handlePaste = (event: ClipboardEvent) => { const handlePaste = async (event?: ClipboardEvent) => {
const clipboardText = event.clipboardData?.getData('text') const clipboardText = event
? event.clipboardData?.getData('text')
: await navigator.clipboard.readText()
if (!clipboardText) { if (!clipboardText) {
return return
} }
@@ -82,6 +85,7 @@ onUnmounted(() => {
<section class="message is-info paste-hint"> <section class="message is-info paste-hint">
<div class="message-body"> <div class="message-body">
Paste a list of items to directly create a new task Paste a list of items to directly create a new task
<button @click="handlePaste" class="button is-info">Paste</button>
</div> </div>
</section> </section>
</div> </div>