diff --git a/packages/client/src/tiptap/core/extensions/dragable.ts b/packages/client/src/tiptap/core/extensions/dragable.ts index a1dd3e4..30d8bde 100644 --- a/packages/client/src/tiptap/core/extensions/dragable.ts +++ b/packages/client/src/tiptap/core/extensions/dragable.ts @@ -26,12 +26,7 @@ export const Dragable = Extension.create({ let activeNode: ActiveNode | null; let activeSelection: Selection | null; let dragging = false; - const isMenuVisible = false; let mouseleaveTimer = null; - const menuActions = { setVisible: (arg: boolean) => {}, update: () => {} }; - - const getEditorView = () => editorView; - const getActiveNode = () => activeNode; const createDragHandleDOM = () => { const dom = document.createElement('div'); @@ -47,11 +42,6 @@ export const Dragable = Extension.create({ dragHandleDOM?.classList?.remove('hide'); }; - const activeDragHandleDOM = () => { - dragHandleDOM?.classList?.add('active'); - dragHandleDOM?.classList?.remove('hide'); - }; - const hideDragHandleDOM = () => { dragHandleDOM?.classList?.remove('show'); dragHandleDOM?.classList?.remove('active'); @@ -81,8 +71,6 @@ export const Dragable = Extension.create({ dragHandleDOM.style.left = `${left + offsetLeft}px`; dragHandleDOM.style.top = `${top - 2}px`; - menuActions?.update?.(); - showDragHandleDOM(); }; @@ -95,10 +83,7 @@ export const Dragable = Extension.create({ const handleMouseLeave = () => { if (!activeNode) return null; - - if (!isMenuVisible) { - hideDragHandleDOM(); - } + hideDragHandleDOM(); }; const handleMouseDown = () => { @@ -138,8 +123,6 @@ export const Dragable = Extension.create({ slice, move: true, }; - - menuActions?.setVisible?.(false); } }; @@ -237,7 +220,6 @@ export const Dragable = Extension.create({ return false; }, mousemove: (view, event) => { - if (isMenuVisible) return false; if (!view.editable || !dragHandleDOM) return false; const coords = { left: event.clientX, top: event.clientY }; @@ -312,12 +294,6 @@ export const Dragable = Extension.create({ return false; } - // if (result.el.parentElement?.classList.contains('ProseMirror')) { - // if (dragging) return false; - // hideDragHandleDOM(); - // return false; - // } - activeNode = result; renderDragHandleDOM(view, result.el); return false; @@ -330,9 +306,7 @@ export const Dragable = Extension.create({ mouseleave: () => { clearTimeout(mouseleaveTimer); mouseleaveTimer = setTimeout(() => { - if (!isMenuVisible) { - hideDragHandleDOM(); - } + hideDragHandleDOM(); }, 400); return false; }, diff --git a/packages/client/src/tiptap/core/extensions/title.ts b/packages/client/src/tiptap/core/extensions/title.ts index d57f8e8..b4029f8 100644 --- a/packages/client/src/tiptap/core/extensions/title.ts +++ b/packages/client/src/tiptap/core/extensions/title.ts @@ -27,7 +27,7 @@ const TitlePluginKey = new PluginKey(TitleExtensionName); export const Title = Node.create({ name: TitleExtensionName, content: 'inline*', - group: 'block', + group: TitleExtensionName, defining: true, isolating: true, selectable: true,