mirror of
https://codeberg.org/Sevichecc/Seigwai.git
synced 2025-04-30 07:49:30 +08:00
feat: add some commands to slashmenu
This commit is contained in:
parent
228b2812b6
commit
25ea0e5469
4 changed files with 37 additions and 14 deletions
|
@ -16,6 +16,7 @@
|
|||
"@prosemirror-adapter/vue": "^0.2.3",
|
||||
"@tiptap/core": "2.0.0-beta.220",
|
||||
"@tiptap/extension-bubble-menu": "2.0.0-beta.220",
|
||||
"@tiptap/extension-bullet-list": "^2.0.1",
|
||||
"@tiptap/extension-character-count": "2.0.0-beta.220",
|
||||
"@tiptap/extension-code-block-lowlight": "^2.0.1",
|
||||
"@tiptap/extension-highlight": "^2.0.0",
|
||||
|
|
|
@ -16,6 +16,9 @@ dependencies:
|
|||
'@tiptap/extension-bubble-menu':
|
||||
specifier: 2.0.0-beta.220
|
||||
version: 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)(@tiptap/pm@2.0.0-beta.220)
|
||||
'@tiptap/extension-bullet-list':
|
||||
specifier: ^2.0.1
|
||||
version: 2.0.1(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-character-count':
|
||||
specifier: 2.0.0-beta.220
|
||||
version: 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)(@tiptap/pm@2.0.0-beta.220)
|
||||
|
@ -691,10 +694,10 @@ packages:
|
|||
tippy.js: 6.3.7
|
||||
dev: false
|
||||
|
||||
/@tiptap/extension-bullet-list@2.0.0-beta.220(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-QQ/0ZlYy6Hgb+UAc79V+fxvI+AaQf20cbKtBXaR8TIZ0x4FotSma89bKh+CIXMhFiBGXTcYBaYhl7OwACsKtxw==}
|
||||
/@tiptap/extension-bullet-list@2.0.1(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-IniXv9VgHkyWF2wJKxoILhNnJPwWNlIRW2LNSlXzkl70k0BsPGcAfiEIJtPqpVwh03QPc5v1y5UeuOOO6VQbqA==}
|
||||
peerDependencies:
|
||||
'@tiptap/core': ^2.0.0-beta.209
|
||||
'@tiptap/core': ^2.0.0
|
||||
dependencies:
|
||||
'@tiptap/core': 2.0.0-beta.220(@tiptap/pm@2.0.0-beta.220)
|
||||
dev: false
|
||||
|
@ -841,18 +844,18 @@ packages:
|
|||
linkifyjs: 4.1.1
|
||||
dev: false
|
||||
|
||||
/@tiptap/extension-list-item@2.0.0-beta.220(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-+O0ivwxPP2l/m9PAowb2ytDT/cM5kwu0s1W5MUsHPIqf+M6ahnl4ESjhWZfDHUzvjqPq6MTbqoQLHbB1KS/N7w==}
|
||||
/@tiptap/extension-list-item@2.0.1(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-WxLRcwhMGp12+hV1nLTRVxPJ3ZsjLzA3tyaYySBf6IQpmoikH8DbzvprwV30lHfYbZvcQWQJx3ECIcQdGbtPPg==}
|
||||
peerDependencies:
|
||||
'@tiptap/core': ^2.0.0-beta.209
|
||||
'@tiptap/core': ^2.0.0
|
||||
dependencies:
|
||||
'@tiptap/core': 2.0.0-beta.220(@tiptap/pm@2.0.0-beta.220)
|
||||
dev: false
|
||||
|
||||
/@tiptap/extension-ordered-list@2.0.0-beta.220(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-j3DmxJfwmNxFfMnvO7glmGlhYeZSIUnRrKnZu2KkpD6OcGJSh9y/yfnYwcuK80XbzEG/jKKIw0M2yRveOvyVwA==}
|
||||
/@tiptap/extension-ordered-list@2.0.1(@tiptap/core@2.0.0-beta.220):
|
||||
resolution: {integrity: sha512-7Q3hqAy2TYZ1p3J0GtEDcUJrbC/NxzWNF1H4zKW3VQGQhffUDNgHBk4uCLLVyf1A3vm50JmEAwQFrrwoozFmqQ==}
|
||||
peerDependencies:
|
||||
'@tiptap/core': ^2.0.0-beta.209
|
||||
'@tiptap/core': ^2.0.0
|
||||
dependencies:
|
||||
'@tiptap/core': 2.0.0-beta.220(@tiptap/pm@2.0.0-beta.220)
|
||||
dev: false
|
||||
|
@ -921,7 +924,7 @@ packages:
|
|||
'@tiptap/core': 2.0.0-beta.220(@tiptap/pm@2.0.0-beta.220)
|
||||
'@tiptap/extension-blockquote': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-bold': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-bullet-list': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-bullet-list': 2.0.1(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-code': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-code-block': 2.0.0(@tiptap/core@2.0.0-beta.220)(@tiptap/pm@2.0.0-beta.220)
|
||||
'@tiptap/extension-document': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
|
@ -932,8 +935,8 @@ packages:
|
|||
'@tiptap/extension-history': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)(@tiptap/pm@2.0.0-beta.220)
|
||||
'@tiptap/extension-horizontal-rule': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)(@tiptap/pm@2.0.0-beta.220)
|
||||
'@tiptap/extension-italic': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-list-item': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-ordered-list': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-list-item': 2.0.1(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-ordered-list': 2.0.1(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-paragraph': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-strike': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
'@tiptap/extension-text': 2.0.0-beta.220(@tiptap/core@2.0.0-beta.220)
|
||||
|
|
|
@ -6,6 +6,7 @@ import Link from '@tiptap/extension-link'
|
|||
import Highlight from '@tiptap/extension-highlight'
|
||||
import { lowlight } from 'lowlight/lib/core'
|
||||
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
|
||||
|
||||
import html from 'highlight.js/lib/languages/xml'
|
||||
import css from 'highlight.js/lib/languages/css'
|
||||
import js from 'highlight.js/lib/languages/javascript'
|
||||
|
@ -77,7 +78,7 @@ const editor = useEditor({
|
|||
autofocus: true,
|
||||
editorProps: {
|
||||
attributes: {
|
||||
class: 'prose prose-slate mx-auto heti',
|
||||
class: 'prose prose-slate mx-auto',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -47,10 +47,28 @@ export default {
|
|||
editor.chain().focus().deleteRange(range).setCodeBlock().run()
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Blockquote',
|
||||
command: ({ editor, range }) => {
|
||||
editor.chain().focus().deleteRange(range).toggleBlockquote().run()
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Divider',
|
||||
command: ({ editor, range }) => {
|
||||
editor.chain().focus().deleteRange(range).setHorizontalRule().run()
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Bullet List',
|
||||
command: ({ editor, range }) => {
|
||||
editor.chain().focus().deleteRange(range).setMark('italic').run()
|
||||
editor.chain().focus().deleteRange(range).toggleBulletList().run()
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Ordered List',
|
||||
command: ({ editor, range }) => {
|
||||
editor.chain().focus().deleteRange(range).toggleOrderedList().run()
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue