Skip to content

Commit

Permalink
refactor(format painter menu): adjusted format painter menu display o…
Browse files Browse the repository at this point in the history
…rder
  • Loading branch information
wjw020206 committed Aug 18, 2024
1 parent e80bed6 commit a84ecd1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* @description format painter menu test
* @author CodePencil
*/

import { Editor } from 'slate'
import FormatPainter from '../../src/modules/format-painter/menu/FormatPainter'
import createEditor from '../../../../tests/utils/create-editor'

describe('format painter menu', () => {
let editor: any
let startLocation: any

const menus = [
{
mark: 'formatPainter',
menu: new FormatPainter(),
},
]

beforeEach(() => {
editor = createEditor()
startLocation = Editor.start(editor, [])
})

afterEach(() => {
editor = null
startLocation = null
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { IButtonMenu, IDomEditor, t } from '@wangeditor-next/core'
import { SlateEditor } from '@wangeditor-next/editor'
import { FORMAT_PAINTER } from '../../../constants/icon-svg'
import { Element, Text } from 'slate'
import { Text } from 'slate'
import { clearAllMarks } from '../helper'

interface FormatPaintAttributes {
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/init-default-config/config/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {

export function genDefaultToolbarKeys() {
return [
'formatPainter',
'headerSelect',
// 'header1',
// 'header2',
Expand Down Expand Up @@ -83,6 +82,7 @@ export function genDefaultToolbarKeys() {
'undo',
'redo',
'|',
'formatPainter',
'fullScreen',
]
}
Expand Down

0 comments on commit a84ecd1

Please sign in to comment.