- Ask & search about anything, or be creative! -
- ); + return "Ask & search about anything, or be creative!"; } return ""; }; diff --git a/apps/desktop/src/daily/note-editor.tsx b/apps/desktop/src/daily/note-editor.tsx index 93267d2464..e1017d7cf3 100644 --- a/apps/desktop/src/daily/note-editor.tsx +++ b/apps/desktop/src/daily/note-editor.tsx @@ -1,9 +1,8 @@ import { useMemo } from "react"; -import { type JSONContent } from "@hypr/tiptap/editor"; -import NoteEditor from "@hypr/tiptap/editor"; import { parseJsonContent } from "@hypr/tiptap/shared"; +import { type JSONContent, NoteEditor } from "~/editor/session"; import * as main from "~/store/tinybase/store/main"; export function DailyNoteEditor({ date }: { date: string }) { diff --git a/apps/desktop/src/editor/chat/index.tsx b/apps/desktop/src/editor/chat/index.tsx new file mode 100644 index 0000000000..2ddd0b623a --- /dev/null +++ b/apps/desktop/src/editor/chat/index.tsx @@ -0,0 +1,283 @@ +import "prosemirror-view/style/prosemirror.css"; + +import { + ProseMirror, + ProseMirrorDoc, + reactKeys, + useEditorEffect, +} from "@handlewithcare/react-prosemirror"; +import { + chainCommands, + createParagraphNear, + deleteSelection, + exitCode, + joinBackward, + joinForward, + liftEmptyBlock, + selectAll, + selectNodeBackward, + selectNodeForward, + splitBlock, +} from "prosemirror-commands"; +import { history, redo, undo } from "prosemirror-history"; +import { keymap } from "prosemirror-keymap"; +import { Node as PMNode } from "prosemirror-model"; +import { EditorState, Plugin, PluginKey } from "prosemirror-state"; +import type { EditorView } from "prosemirror-view"; +import { forwardRef, useImperativeHandle, useMemo, useRef } from "react"; + +import "@hypr/tiptap/styles.css"; +import { cn } from "@hypr/utils"; + +import { AttachmentChipView, MentionNodeView } from "../node-views"; +import { type PlaceholderFunction, placeholderPlugin } from "../plugins"; +import { + type MentionConfig, + MentionSuggestion, + findMention, + mentionSkipPlugin, +} from "../widgets"; +import { chatSchema } from "./schema"; + +export { chatSchema }; +export type { MentionConfig }; + +export interface JSONContent { + type?: string; + attrs?: Record