- {/* Title input */}
-
setTitle(e.target.value)}
- className="w-full px-0 py-3 mb-4 text-3xl font-semibold bg-transparent border-b border-ctp-surface2 focus:outline-none focus:border-ctp-mauve transition-colors placeholder:text-ctp-overlay0 text-ctp-text"
- />
-
- (
- <>
-
-
- >
- ),
- }),
-
- tablePlugin(),
- listsPlugin(),
- quotePlugin(),
- thematicBreakPlugin(),
- linkPlugin(),
- codeBlockPlugin({ defaultCodeBlockLanguage: "js" }),
- sandpackPlugin({ sandpackConfig: simpleSandpackConfig }),
- codeMirrorPlugin({
- codeBlockLanguages: {
- js: "JavaScript",
- css: "CSS",
- python: "Python",
- typescript: "TypeScript",
- html: "HTML",
- },
- }),
- imagePlugin(),
- markdownShortcutPlugin(),
- diffSourcePlugin({
- viewMode: "rich-text",
- diffMarkdown: "boo",
- }),
- ]}
- />
-
-
- );
-};
diff --git a/frontend/src/components/sidebar/DraggableNote.tsx b/frontend/src/components/sidebar/DraggableNote.tsx
index 6516443..34f17d0 100644
--- a/frontend/src/components/sidebar/DraggableNote.tsx
+++ b/frontend/src/components/sidebar/DraggableNote.tsx
@@ -1,28 +1,44 @@
import React from "react";
import { useDraggable } from "@dnd-kit/core";
-import { Note } from "../../api/notes";
import { NoteRead } from "../../api/folders";
import { useNoteStore } from "../../stores/notesStore";
+import { useContextMenu } from "../../contexts/ContextMenuContext";
export const DraggableNote = ({ note }: { note: NoteRead }) => {
const { selectedNote, setSelectedNote } = useNoteStore();
+ const { openContextMenu } = useContextMenu();
- const { attributes, listeners, setNodeRef, transform } = useDraggable({
- id: note.id,
- data: { type: "note", note },
- });
- const style = transform
- ? {
- transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,
- }
- : undefined;
+ const { attributes, listeners, setNodeRef, transform, isDragging } =
+ useDraggable({
+ id: note.id,
+ data: { type: "note", note },
+ });
+
+ const style = {
+ transform: transform
+ ? `translate3d(${transform.x}px, ${transform.y}px, 0)`
+ : undefined,
+ opacity: isDragging ? 0 : 1,
+ };
return (
-