diff --git a/src/components/editor/inline/inline-completion.tsx b/src/components/editor/inline/inline-completion.tsx index 0955f3a..146d0ed 100644 --- a/src/components/editor/inline/inline-completion.tsx +++ b/src/components/editor/inline/inline-completion.tsx @@ -3,6 +3,7 @@ import { Editor, mergeAttributes } from "@tiptap/core"; import AiBlockView from "@/components/editor/intelli/ai-block-view"; import React, { useEffect, useRef } from "react"; import { AiBlockEditor } from "@/components/editor/intelli/ai-block-editor"; +import { KeyboardIcon } from "@radix-ui/react-icons"; declare module '@tiptap/core' { interface Commands { @@ -21,6 +22,7 @@ export const createInlineCompletion = () => { name: extensionName, group: "block", defining: true, + isolating: true, content: "text*", addOptions() { return { @@ -94,7 +96,7 @@ const InlineCompletionView = (props?: { editor: Editor }) => { return ( -

show text for completion `

+ show text for completion `
); }; diff --git a/styles/global.css b/styles/global.css index cdced3a..60dde35 100644 --- a/styles/global.css +++ b/styles/global.css @@ -785,13 +785,24 @@ input { cursor: not-allowed; } +.node-inline-completion { + display: inline-block; + background: var(--violet-3); + padding: 0 8px; + border-radius: 4px; +} + +.node-inline-completion svg { + display: inline-block; +} + .inline-completion { background-color: #9ca3af; } .inline-completion-tip { margin-left: 1em; - background: #ccc; + background: #fff; font-weight: 500; border-radius: 0.2em; line-height: 0.6em;