mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
* better variable names and comments * drag drop migrated * custom horizontal rule created * init transaction hijack * fixed code block with better contrast, keyboard tripple enter press disabled and syntax highlighting * fixed link selector closing on open behaviour * added better keymaps and syntax highlights * made drag and drop working for code blocks * fixed drag drop for code blocks * moved drag drop only to rich text editor * fixed drag and drop only for description * enabled drag handles for peek overview and main issues * got images to old state
32 lines
894 B
TypeScript
32 lines
894 B
TypeScript
import Placeholder from "@tiptap/extension-placeholder";
|
|
|
|
import SlashCommand from "./slash-command";
|
|
import { UploadImage } from "../";
|
|
import DragAndDrop from "./drag-drop";
|
|
|
|
export const RichTextEditorExtensions = (
|
|
uploadFile: UploadImage,
|
|
setIsSubmitting?: (
|
|
isSubmitting: "submitting" | "submitted" | "saved",
|
|
) => void,
|
|
dragDropEnabled?: boolean,
|
|
) => [
|
|
SlashCommand(uploadFile, setIsSubmitting),
|
|
dragDropEnabled === true && DragAndDrop,
|
|
Placeholder.configure({
|
|
placeholder: ({ node }) => {
|
|
if (node.type.name === "heading") {
|
|
return `Heading ${node.attrs.level}`;
|
|
}
|
|
if (node.type.name === "image" || node.type.name === "table") {
|
|
return "";
|
|
}
|
|
if (node.type.name === "codeBlock") {
|
|
return "Type in your code here...";
|
|
}
|
|
return "Press '/' for commands...";
|
|
},
|
|
includeChildren: true,
|
|
}),
|
|
];
|