PArtial Note-File Feature

This commit is contained in:
2026-03-06 18:50:21 -06:00
parent bc9060e00d
commit 8dfd0c8274
5 changed files with 254 additions and 7 deletions
+10 -1
View File
@@ -7,7 +7,7 @@ import {
Bold, Italic, Underline,
Grid3X3, Highlighter,
AlignLeft, AlignCenter, AlignRight,
Trash2
Trash2, AppWindow
} from "lucide-solid";
import { cn, convertImageToWebpFile } from "@/lib/utils";
import { activeTaskId, uploadTaskAttachment, activeNoteId, uploadNoteAttachment } from "@/store";
@@ -172,6 +172,15 @@ export const getSuggestionItems = ({ query }: { query: string }): CommandItem[]
input.click();
},
},
{
title: "Job File",
description: "Embed a job file from Prism.",
aliases: ["file", "embed", "job", "pdf"],
icon: AppWindow,
command: ({ editor, range }: { editor: any, range: any }) => {
editor.chain().focus().deleteRange(range).insertFileViewer().run();
},
},
{
title: "Divider",
description: "Insert a horizontal rule.",
+3
View File
@@ -26,6 +26,7 @@ import { Typography } from "@tiptap/extension-typography";
import { Dropcursor } from "@tiptap/extension-dropcursor";
import { Mention } from "@tiptap/extension-mention";
import { userSuggestion, noteSuggestion } from "@/lib/mention-suggestion";
import { FileViewer } from "@/lib/extensions/file-viewer";
interface TaskEditorProps {
content?: string;
@@ -159,6 +160,7 @@ export const TaskEditor: Component<TaskEditorProps> = (props) => {
color: "var(--primary)",
width: 2,
}),
FileViewer,
],
// Use untrack so the editor doesn't re-initialize when props.content changes
content: untrack(() => props.content) || "",
@@ -189,6 +191,7 @@ export const TaskEditor: Component<TaskEditorProps> = (props) => {
"[&_.tiptap-task-content>p]:min-h-[1.5rem] [&_.tiptap-task-content>p]:m-0 [&_.tiptap-task-content>p]:w-full",
"[&_.tiptap-task-content>p:empty]:after:content-['\\200B'] [&_.tiptap-task-content>p:empty]:after:inline-block",
"[&_.tiptap-task-content>p>br]:after:content-['\\200B'] [&_.tiptap-task-content>p>br]:after:inline-block", // if tiptap adds br
"[&>.file-viewer-wrapper:first-child]:mt-0 [&>.file-viewer-wrapper:first-child]:border-t-0 [&>.file-viewer-wrapper:first-child]:border-x-0 [&>.file-viewer-wrapper:first-child]:rounded-none [&>.file-viewer-wrapper:first-child]:bg-transparent [&>.file-viewer-wrapper:first-child]:h-[80vh]",
props.class
),
},