forked from vikunja/frontend
feat(editor): save when pressing ctrl enter
This commit is contained in:
parent
19a78f1f75
commit
63c40b29b0
22
package.json
22
package.json
@ -55,23 +55,39 @@
|
||||
"@kyvg/vue3-notification": "3.0.2",
|
||||
"@sentry/tracing": "7.74.0",
|
||||
"@sentry/vue": "7.74.0",
|
||||
"@tiptap/core": "^2.1.12",
|
||||
"@tiptap/core": "2.1.12",
|
||||
"@tiptap/extension-blockquote": "2.1.12",
|
||||
"@tiptap/extension-bold": "2.1.12",
|
||||
"@tiptap/extension-bullet-list": "2.1.12",
|
||||
"@tiptap/extension-character-count": "2.0.3",
|
||||
"@tiptap/extension-code": "2.1.12",
|
||||
"@tiptap/extension-code-block": "2.1.12",
|
||||
"@tiptap/extension-code-block-lowlight": "2.0.3",
|
||||
"@tiptap/extension-document": "2.0.3",
|
||||
"@tiptap/extension-dropcursor": "2.1.12",
|
||||
"@tiptap/extension-gapcursor": "2.1.12",
|
||||
"@tiptap/extension-hard-break": "2.1.12",
|
||||
"@tiptap/extension-heading": "2.1.12",
|
||||
"@tiptap/extension-highlight": "2.0.3",
|
||||
"@tiptap/extension-history": "2.1.12",
|
||||
"@tiptap/extension-horizontal-rule": "2.1.12",
|
||||
"@tiptap/extension-image": "2.0.3",
|
||||
"@tiptap/extension-italic": "2.1.12",
|
||||
"@tiptap/extension-link": "2.0.3",
|
||||
"@tiptap/extension-list-item": "2.1.12",
|
||||
"@tiptap/extension-ordered-list": "2.1.12",
|
||||
"@tiptap/extension-paragraph": "2.1.12",
|
||||
"@tiptap/extension-placeholder": "2.1.12",
|
||||
"@tiptap/extension-strike": "2.1.12",
|
||||
"@tiptap/extension-table": "2.0.3",
|
||||
"@tiptap/extension-table-cell": "2.0.3",
|
||||
"@tiptap/extension-table-header": "2.0.3",
|
||||
"@tiptap/extension-table-row": "2.0.3",
|
||||
"@tiptap/extension-task-item": "2.0.3",
|
||||
"@tiptap/extension-task-list": "2.0.3",
|
||||
"@tiptap/extension-text": "2.1.12",
|
||||
"@tiptap/extension-typography": "2.0.3",
|
||||
"@tiptap/extension-underline": "2.1.12",
|
||||
"@tiptap/starter-kit": "2.0.3",
|
||||
"@tiptap/suggestion": "2.1.12",
|
||||
"@tiptap/vue-3": "2.0.3",
|
||||
"@types/is-touch-device": "1.0.0",
|
||||
@ -102,7 +118,7 @@
|
||||
"register-service-worker": "1.7.2",
|
||||
"snake-case": "3.0.4",
|
||||
"sortablejs": "1.15.0",
|
||||
"tippy.js": "^6.3.7",
|
||||
"tippy.js": "6.3.7",
|
||||
"ufo": "1.3.1",
|
||||
"vue": "3.3.6",
|
||||
"vue-advanced-cropper": "2.8.8",
|
||||
|
84
pnpm-lock.yaml
generated
84
pnpm-lock.yaml
generated
@ -41,29 +41,77 @@ dependencies:
|
||||
specifier: 7.74.0
|
||||
version: 7.74.0(vue@3.3.6)
|
||||
'@tiptap/core':
|
||||
specifier: ^2.1.12
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-blockquote':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-bold':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-bullet-list':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-character-count':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-code':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-code-block':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-code-block-lowlight':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/extension-code-block@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-document':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-dropcursor':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-gapcursor':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-hard-break':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-heading':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-highlight':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-history':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-horizontal-rule':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-image':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-italic':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-link':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-list-item':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-ordered-list':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-paragraph':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-placeholder':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-strike':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-table':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
@ -82,15 +130,15 @@ dependencies:
|
||||
'@tiptap/extension-task-list':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-text':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-typography':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-underline':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/starter-kit':
|
||||
specifier: 2.0.3
|
||||
version: 2.0.3(@tiptap/pm@2.1.12)
|
||||
'@tiptap/suggestion':
|
||||
specifier: 2.1.12
|
||||
version: 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
@ -182,7 +230,7 @@ dependencies:
|
||||
specifier: 1.15.0
|
||||
version: 1.15.0
|
||||
tippy.js:
|
||||
specifier: ^6.3.7
|
||||
specifier: 6.3.7
|
||||
version: 6.3.7
|
||||
ufo:
|
||||
specifier: 1.3.1
|
||||
@ -4545,32 +4593,6 @@ packages:
|
||||
prosemirror-view: 1.32.1
|
||||
dev: false
|
||||
|
||||
/@tiptap/starter-kit@2.0.3(@tiptap/pm@2.1.12):
|
||||
resolution: {integrity: sha512-t4WG4w93zTpL2VxhVyJJvl3kdLF001ZrhpOuEiZqEMBMUMbM56Uiigv1CnUQpTFrjDAh3IM8hkqzAh20TYw2iQ==}
|
||||
dependencies:
|
||||
'@tiptap/core': 2.1.12(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-blockquote': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-bold': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-bullet-list': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-code': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-code-block': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-document': 2.0.3(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-dropcursor': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-gapcursor': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-hard-break': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-heading': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-history': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-horizontal-rule': 2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12)
|
||||
'@tiptap/extension-italic': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-list-item': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-ordered-list': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-paragraph': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-strike': 2.1.12(@tiptap/core@2.1.12)
|
||||
'@tiptap/extension-text': 2.1.12(@tiptap/core@2.1.12)
|
||||
transitivePeerDependencies:
|
||||
- '@tiptap/pm'
|
||||
dev: false
|
||||
|
||||
/@tiptap/suggestion@2.1.12(@tiptap/core@2.1.12)(@tiptap/pm@2.1.12):
|
||||
resolution: {integrity: sha512-rhlLWwVkOodBGRMK0mAmE34l2a+BqM2Y7q1ViuQRBhs/6sZ8d83O4hARHKVwqT5stY4i1l7d7PoemV3uAGI6+g==}
|
||||
peerDependencies:
|
||||
|
@ -126,7 +126,24 @@ import Underline from '@tiptap/extension-underline'
|
||||
import TaskItem from '@tiptap/extension-task-item'
|
||||
import TaskList from '@tiptap/extension-task-list'
|
||||
|
||||
import StarterKit from '@tiptap/starter-kit'
|
||||
import { Blockquote } from '@tiptap/extension-blockquote'
|
||||
import { Bold } from '@tiptap/extension-bold'
|
||||
import { BulletList } from '@tiptap/extension-bullet-list'
|
||||
import { Code } from '@tiptap/extension-code'
|
||||
import { CodeBlock } from '@tiptap/extension-code-block'
|
||||
import { Document } from '@tiptap/extension-document'
|
||||
import { Dropcursor } from '@tiptap/extension-dropcursor'
|
||||
import { Gapcursor } from '@tiptap/extension-gapcursor'
|
||||
import { HardBreak } from '@tiptap/extension-hard-break'
|
||||
import { Heading } from '@tiptap/extension-heading'
|
||||
import { History } from '@tiptap/extension-history'
|
||||
import { HorizontalRule } from '@tiptap/extension-horizontal-rule'
|
||||
import { Italic } from '@tiptap/extension-italic'
|
||||
import { ListItem } from '@tiptap/extension-list-item'
|
||||
import { OrderedList } from '@tiptap/extension-ordered-list'
|
||||
import { Paragraph } from '@tiptap/extension-paragraph'
|
||||
import { Strike } from '@tiptap/extension-strike'
|
||||
import { Text } from '@tiptap/extension-text'
|
||||
import {BubbleMenu, EditorContent, useEditor} from '@tiptap/vue-3'
|
||||
|
||||
import Commands from './commands'
|
||||
@ -224,7 +241,6 @@ const loadedAttachments = ref<{ [key: CacheKey]: string }>({})
|
||||
function loadImages() {
|
||||
const attachmentImage = document.querySelectorAll<HTMLImageElement>('.tiptap__editor img')
|
||||
const attachmentService = new AttachmentService()
|
||||
console.log('load images', attachmentImage)
|
||||
if (attachmentImage) {
|
||||
Array.from(attachmentImage).forEach(async (img) => {
|
||||
if (!img.src.startsWith(window.API_URL)) {
|
||||
@ -268,7 +284,34 @@ const editor = useEditor({
|
||||
content: inputHTML.value,
|
||||
editable: isEditEnabled,
|
||||
extensions: [
|
||||
StarterKit,
|
||||
// Starterkit:
|
||||
Blockquote,
|
||||
Bold,
|
||||
BulletList,
|
||||
Code,
|
||||
CodeBlock,
|
||||
Document,
|
||||
Dropcursor,
|
||||
Gapcursor,
|
||||
HardBreak.extend({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Mod-Enter': () => {
|
||||
bubbleSave()
|
||||
},
|
||||
}
|
||||
},
|
||||
}),
|
||||
Heading,
|
||||
History,
|
||||
HorizontalRule,
|
||||
Italic,
|
||||
ListItem,
|
||||
OrderedList,
|
||||
Paragraph,
|
||||
Strike,
|
||||
Text,
|
||||
|
||||
Placeholder.configure({
|
||||
placeholder: () => {
|
||||
if (!isEditEnabled) {
|
||||
@ -433,7 +476,7 @@ function setFocusToEditor(event) {
|
||||
if (!hotkeyString) return
|
||||
if (hotkeyString !== editShortcut || editor.value?.isFocused) return
|
||||
event.preventDefault()
|
||||
|
||||
|
||||
editor.value?.commands.focus()
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user