Skip to content

Commit

Permalink
fix(format painter): modify import name
Browse files Browse the repository at this point in the history
  • Loading branch information
cycleccc committed Aug 18, 2024
1 parent 1ec9026 commit 0cb36dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/basic-modules/src/modules/format-painter/helper.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { IDomEditor } from '@wangeditor-next/core'
import { SlateEditor } from '@wangeditor-next/editor'
import { Editor } from 'slate'

/** 清空所有标记(文本样式) */
export function clearAllMarks(editor: IDomEditor) {
const marks = SlateEditor.marks(editor)
const marks = Editor.marks(editor)

if (marks) {
Object.keys(marks).forEach(mark => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

import { IButtonMenu, IDomEditor, t } from '@wangeditor-next/core'
import { SlateEditor } from '@wangeditor-next/editor'
import { FORMAT_PAINTER } from '../../../constants/icon-svg'
import { Text } from 'slate'
import { Text, Editor } from 'slate'
import { clearAllMarks } from '../helper'

interface FormatPaintAttributes {
Expand Down Expand Up @@ -54,7 +53,7 @@ class FormatPainter implements IButtonMenu {
} else {
// 判断是否选中文本
if (editor.getSelectionText().length) {
FormatPainter.attrs.formatStyle = SlateEditor.marks(editor)
FormatPainter.attrs.formatStyle = Editor.marks(editor)
FormatPainter.attrs.isSelect = true
}
}
Expand Down

0 comments on commit 0cb36dd

Please sign in to comment.