Skip to content

Commit

Permalink
styles: update styles for single line ocmpletion
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Nov 25, 2023
1 parent 5356e07 commit 2f0edec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/editor/inline/inline-completion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<ReturnType> {
Expand All @@ -21,6 +22,7 @@ export const createInlineCompletion = () => {
name: extensionName,
group: "block",
defining: true,
isolating: true,
content: "text*",
addOptions() {
return {
Expand Down Expand Up @@ -94,7 +96,7 @@ const InlineCompletionView = (props?: { editor: Editor }) => {

return (
<NodeViewWrapper ref={$container}>
<p>show text for completion <span className={'inline-completion-tip'}>`</span></p>
<span>show text for completion <span className={'inline-completion-tip'}><KeyboardIcon />`</span></span>
</NodeViewWrapper>
);
};
Expand Down
13 changes: 12 additions & 1 deletion styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f0edec

Please sign in to comment.