Skip to content

Commit

Permalink
chore: split advice plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 1, 2023
1 parent 6008cb4 commit 6f49156
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
8 changes: 8 additions & 0 deletions editor/src/components/editor/intelli/advice-extension.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Extension } from "@tiptap/core";

const EXTENSION_NAME = "advice";

// https://dev.to/sereneinserenade/how-i-implemented-google-docs-like-commenting-in-tiptap-k2k
export const AdviceExtension = Extension.create({
name: EXTENSION_NAME,
});
4 changes: 2 additions & 2 deletions editor/src/components/editor/live-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import { createInlineCompletion } from "@/components/editor/inline/inline-comple
import { useTranslation } from "react-i18next";

import "./editor.css"
import { SideBox } from './side-view/side-box'
import { AdviceExtension } from "@/components/editor/intelli/advice-extension";

const md = new MarkdownIt()

const extensions = [
// we define all commands here
CommandFunctions,
AdviceExtension,
TrackChangeExtension.configure({
enabled: false,
}),
Expand Down Expand Up @@ -79,7 +80,6 @@ const LiveEditor = () => {
{editor && <MenuBar editor={editor}/>}
<EditorContent editor={editor}/>
{editor && <MenuBubble editor={editor}/>}
{editor && <SideBox editor={editor}/> }

{editor && <div className="character-count">
<span>{Math.abs(editor.state.selection.$from.pos - editor.state.selection.$to.pos)} selected</span>
Expand Down
19 changes: 0 additions & 19 deletions editor/src/components/editor/side-view/side-box.tsx

This file was deleted.

0 comments on commit 6f49156

Please sign in to comment.