mirror of https://github.com/fantasticit/think.git
fix: fix comment extensions
This commit is contained in:
parent
7d1afdd394
commit
9042da011f
|
@ -27,7 +27,7 @@
|
|||
|
||||
.Resizer {
|
||||
z-index: 1;
|
||||
opacity: 0.2;
|
||||
opacity: .2;
|
||||
box-sizing: border-box;
|
||||
background-clip: padding;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,3 @@
|
|||
import BuiltInPlaceholder from '@tiptap/extension-placeholder';
|
||||
|
||||
export const Placeholder = BuiltInPlaceholder.configure({
|
||||
placeholder: ({ node, editor }) => {
|
||||
if (!editor.isEditable) return;
|
||||
|
||||
if (node.type.name === 'title') {
|
||||
return '请输入标题';
|
||||
}
|
||||
return '输入 / 唤起更多';
|
||||
},
|
||||
showOnlyCurrent: false,
|
||||
showOnlyWhenEditable: true,
|
||||
});
|
||||
export const Placeholder = BuiltInPlaceholder;
|
||||
|
|
|
@ -112,7 +112,6 @@ export const CommentMenuBar: React.FC<{ editor: any }> = ({ editor }) => {
|
|||
<Divider />
|
||||
|
||||
<Heading editor={editor} />
|
||||
<FontSize editor={editor} />
|
||||
<Bold editor={editor} />
|
||||
<Italic editor={editor} />
|
||||
<Underline editor={editor} />
|
||||
|
|
|
@ -89,7 +89,18 @@ export const BaseKit = [
|
|||
Mind,
|
||||
OrderedList,
|
||||
Paragraph,
|
||||
Placeholder,
|
||||
Placeholder.configure({
|
||||
placeholder: ({ node, editor }) => {
|
||||
if (!editor.isEditable) return;
|
||||
|
||||
if (node.type.name === 'title') {
|
||||
return '请输入标题';
|
||||
}
|
||||
return '输入 / 唤起更多';
|
||||
},
|
||||
showOnlyCurrent: false,
|
||||
showOnlyWhenEditable: true,
|
||||
}),
|
||||
QuickInsert,
|
||||
SearchNReplace,
|
||||
SelectionExtension,
|
||||
|
@ -122,6 +133,7 @@ export const CommentKit = [
|
|||
Color,
|
||||
ColorHighlighter,
|
||||
Dropcursor,
|
||||
Emoji,
|
||||
Focus,
|
||||
FontSize,
|
||||
Gapcursor,
|
||||
|
@ -137,7 +149,10 @@ export const CommentKit = [
|
|||
Mention,
|
||||
OrderedList,
|
||||
Paragraph,
|
||||
Placeholder,
|
||||
Placeholder.configure({
|
||||
placeholder: '请输入内容',
|
||||
showOnlyWhenEditable: true,
|
||||
}),
|
||||
Strike,
|
||||
Subscript,
|
||||
Superscript,
|
||||
|
|
Loading…
Reference in New Issue