Skip to content

Commit

Permalink
chore: update content
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 22, 2023
1 parent 6ce02c6 commit fa49725
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions components/editor/intelli/menu/menu-bubble.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@ export const MenuBubble = ({ editor }) => {
// 根据长度优化
return <BubbleMenu className={'ToggleGroup'} editor={editor} tippyOptions={{ duration: 100 }}>
{selectLength > 20 && <button
onClick={() => editor.chain().focus().toggleBold().run()}
onClick={() => {
editor.chain().focus().toggleBold().run()
const selection = editor.state.selection

editor.chain().focus().insertContentAt({
from: selection.from,
to: selection.to
}, 'TODO, calling API').run()
}}
value="left" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
>
<MagicWandIcon /> 优化表达
<MagicWandIcon/> 优化表达
</button>
}
</BubbleMenu>
Expand Down
6 changes: 5 additions & 1 deletion components/editor/live-editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react'
import { MenuBar } from './menu-bar'

import MarkdownIt from 'markdown-it'
import { MenuBubble } from './intelli/menu/menu-bubble'
import { DeletionMark, InsertionMark, MenuBubble } from './intelli/menu/menu-bubble'
import { createSlashExtension } from './intelli/slash-extension'
import { CommandFunctions } from './action/command-functions'
import { createAiBlock } from './intelli/ai-block-extension'
Expand All @@ -16,6 +16,10 @@ const md = new MarkdownIt()

const extensions = [
CommandFunctions,
// addExtensions () {
// return [InsertionMark, DeletionMark]
// },
InsertionMark, DeletionMark,
StarterKit.configure({
bulletList: {
keepMarks: true,
Expand Down

0 comments on commit fa49725

Please sign in to comment.