diff --git a/packages/client/src/tiptap/core/extensions/document-reference.ts b/packages/client/src/tiptap/core/extensions/document-reference.ts index 6f666c6..fe8b3bd 100644 --- a/packages/client/src/tiptap/core/extensions/document-reference.ts +++ b/packages/client/src/tiptap/core/extensions/document-reference.ts @@ -3,7 +3,7 @@ import { ReactNodeViewRenderer } from '@tiptap/react'; import { DocumentReferenceWrapper } from 'tiptap/core/wrappers/document-reference'; import { getDatasetAttribute } from 'tiptap/prose-utils'; -type IDocumentReferenceAttrs = { +export type IDocumentReferenceAttrs = { defaultShowPicker?: boolean; createUser: string; }; diff --git a/packages/client/src/tiptap/core/extensions/katex.ts b/packages/client/src/tiptap/core/extensions/katex.ts index d6e6ffd..6600a3c 100644 --- a/packages/client/src/tiptap/core/extensions/katex.ts +++ b/packages/client/src/tiptap/core/extensions/katex.ts @@ -2,7 +2,7 @@ import { mergeAttributes, Node, nodeInputRule } from '@tiptap/core'; import { ReactNodeViewRenderer } from '@tiptap/react'; import { KatexWrapper } from 'tiptap/core/wrappers/katex'; -type IKatexAttrs = { +export type IKatexAttrs = { text?: string; defaultShowPicker?: boolean; createUser: string; diff --git a/packages/client/src/tiptap/core/menus/document-reference/bubble.tsx b/packages/client/src/tiptap/core/menus/document-reference/bubble.tsx index f8200e5..3bc721b 100644 --- a/packages/client/src/tiptap/core/menus/document-reference/bubble.tsx +++ b/packages/client/src/tiptap/core/menus/document-reference/bubble.tsx @@ -10,19 +10,14 @@ import { useToggle } from 'hooks/use-toggle'; import { useRouter } from 'next/router'; import { useCallback, useEffect } from 'react'; import { BubbleMenu } from 'tiptap/core/bubble-menu'; -import { DocumentReference } from 'tiptap/core/extensions/document-reference'; +import { DocumentReference, IDocumentReferenceAttrs } from 'tiptap/core/extensions/document-reference'; import { useAttributes } from 'tiptap/core/hooks/use-attributes'; import { copyNode, deleteNode } from 'tiptap/prose-utils'; const { Text } = Typography; -type DocumentReferenceAttrs = { - defaultShowPicker: boolean; - createUser: string; -}; - export const DocumentReferenceBubbleMenu = ({ editor }) => { - const attrs = useAttributes(editor, DocumentReference.name, { + const attrs = useAttributes(editor, DocumentReference.name, { defaultShowPicker: false, createUser: '', }); diff --git a/packages/client/src/tiptap/core/menus/katex/bubble.tsx b/packages/client/src/tiptap/core/menus/katex/bubble.tsx index 5882479..5572b70 100644 --- a/packages/client/src/tiptap/core/menus/katex/bubble.tsx +++ b/packages/client/src/tiptap/core/menus/katex/bubble.tsx @@ -7,20 +7,14 @@ import { useToggle } from 'hooks/use-toggle'; import { useCallback, useEffect, useRef } from 'react'; import { Editor } from 'tiptap/core'; import { BubbleMenu } from 'tiptap/core/bubble-menu'; -import { Katex } from 'tiptap/core/extensions/katex'; +import { IKatexAttrs, Katex } from 'tiptap/core/extensions/katex'; import { useAttributes } from 'tiptap/core/hooks/use-attributes'; import { copyNode, deleteNode } from 'tiptap/prose-utils'; const { Text } = Typography; -type KatexAttrs = { - text: string; - defaultShowPicker: boolean; - createUser: string; -}; - export const KatexBubbleMenu: React.FC<{ editor: Editor }> = ({ editor }) => { - const attrs = useAttributes(editor, Katex.name, { + const attrs = useAttributes(editor, Katex.name, { text: '', defaultShowPicker: false, createUser: '',