Skip to content

Commit

Permalink
chore: reset for selection change
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 22, 2023
1 parent 3885991 commit d29d6a5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/editor/intelli/menu/menu-bubble.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ export const MenuBubble = ({ editor }) => {
return <BubbleMenu className={'ToggleGroup'} editor={editor} tippyOptions={{ duration: 100 }}>
{selectLength > 20 && <button
onClick={() => {
editor.chain().focus().toggleBold().run()
const selection = editor.state.selection
editor.commands.setTrackChangeStatus(true)

const selection = editor.state.selection
editor.chain().focus().insertContentAt({
from: selection.from,
to: selection.to
}, 'TODO, calling API').run()
}, '永和九年,岁在癸丑,暮春之初,会于会稽山阴之兰亭,修禊事也。群贤毕至,少长咸集。此地有崇山峻岭,茂林修竹;又有清流激湍,映带左右').run()

editor.commands.setTrackChangeStatus(false)
}}
value="left" aria-label="Left aligned"
className={editor.isActive('bold') ? 'is-active BubbleMenuItem' : 'BubbleMenuItem'}
Expand Down
19 changes: 19 additions & 0 deletions pages/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,22 @@ button {
background-position: 0 0;
}
}

.ProseMirror-focused {
border: 1px solid rgb(128, 128, 128);
outline: none;
}

.ProseMirror p {
margin: 0;
}

.ProseMirror insert {
color: green;
text-decoration: underline;
}

.ProseMirror delete {
color: red;
text-decoration: line-through;
}

0 comments on commit d29d6a5

Please sign in to comment.