mirror of https://github.com/fantasticit/think.git
fix: fix callout
parent
c1ddc14a32
commit
3a284ad903
|
@ -1,7 +1,7 @@
|
|||
import { Extension } from '@tiptap/core';
|
||||
import { Plugin, PluginKey, NodeSelection, TextSelection, Selection, AllSelection } from 'prosemirror-state';
|
||||
import { Decoration, DecorationSet } from 'prosemirror-view';
|
||||
import { getCurrentNode, isInCodeBlock, isInBanner } from '../utils/node';
|
||||
import { getCurrentNode, isInCodeBlock, isInCallout } from '../utils/node';
|
||||
import { EXTENSION_PRIORITY_HIGHEST } from '../constants';
|
||||
|
||||
export const selectionPluginKey = new PluginKey('selection');
|
||||
|
@ -68,7 +68,7 @@ export const SelectionExtension = Extension.create({
|
|||
}
|
||||
|
||||
// 信息框
|
||||
if (isInBanner(view.state)) {
|
||||
if (isInCallout(view.state)) {
|
||||
// @ts-ignore
|
||||
const { path = [] } = $head;
|
||||
startPos = path[2];
|
||||
|
|
|
@ -93,7 +93,7 @@ export const CalloutBubbleMenu: React.FC<{ editor: Editor }> = ({ editor }) => {
|
|||
type="tertiary"
|
||||
theme="borderless"
|
||||
icon={<IconDelete />}
|
||||
onClick={() => deleteNode('banner', editor)}
|
||||
onClick={() => deleteNode('callout', editor)}
|
||||
/>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
|
|
|
@ -51,6 +51,6 @@ export function isInTitle(state: EditorState): boolean {
|
|||
return isInCustomNode(state, 'title');
|
||||
}
|
||||
|
||||
export function isInBanner(state: EditorState): boolean {
|
||||
return isInCustomNode(state, 'banner');
|
||||
export function isInCallout(state: EditorState): boolean {
|
||||
return isInCustomNode(state, 'callout');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue