Merge branch 'editor/toogle_highlight' into 'dev'
[editor] add text highlight action See merge request discoursio/discoursio-webapp!75
This commit is contained in:
commit
5160e00bda
|
@ -142,7 +142,12 @@ export const Editor = (props: EditorProps) => {
|
||||||
Focus,
|
Focus,
|
||||||
Gapcursor,
|
Gapcursor,
|
||||||
HardBreak,
|
HardBreak,
|
||||||
Highlight,
|
Highlight.configure({
|
||||||
|
multicolor: true,
|
||||||
|
HTMLAttributes: {
|
||||||
|
class: 'highlight'
|
||||||
|
}
|
||||||
|
}),
|
||||||
CustomImage.configure({
|
CustomImage.configure({
|
||||||
HTMLAttributes: {
|
HTMLAttributes: {
|
||||||
class: 'uploadedImage'
|
class: 'uploadedImage'
|
||||||
|
|
|
@ -72,3 +72,8 @@
|
||||||
.horizontalRule {
|
.horizontalRule {
|
||||||
border-top: 2px solid #000;
|
border-top: 2px solid #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mark.highlight {
|
||||||
|
box-decoration-break: clone;
|
||||||
|
padding: 0.125em 0;
|
||||||
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.colorWheel {
|
.toggleHighlight {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
|
|
@ -36,6 +36,7 @@ export const TextBubbleMenu = (props: BubbleMenuProps) => {
|
||||||
const isOrderedList = isActive('isOrderedList')
|
const isOrderedList = isActive('isOrderedList')
|
||||||
const isBulletList = isActive('isBulletList')
|
const isBulletList = isActive('isBulletList')
|
||||||
const isLink = isActive('link')
|
const isLink = isActive('link')
|
||||||
|
const isHighlight = isActive('highlight')
|
||||||
|
|
||||||
const toggleLinkForm = () => {
|
const toggleLinkForm = () => {
|
||||||
setLinkEditorOpen(true)
|
setLinkEditorOpen(true)
|
||||||
|
@ -191,6 +192,15 @@ export const TextBubbleMenu = (props: BubbleMenuProps) => {
|
||||||
>
|
>
|
||||||
<Icon name="editor-italic" />
|
<Icon name="editor-italic" />
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class={clsx(styles.bubbleMenuButton, {
|
||||||
|
[styles.bubbleMenuButtonActive]: isHighlight()
|
||||||
|
})}
|
||||||
|
onClick={() => props.editor.chain().focus().toggleHighlight({ color: '#F6E3A1' }).run()}
|
||||||
|
>
|
||||||
|
<div class={styles.toggleHighlight} />
|
||||||
|
</button>
|
||||||
<div class={styles.delimiter} />
|
<div class={styles.delimiter} />
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user