forked from github/plane
added migration support by updating to html
This commit is contained in:
parent
a6ae849a81
commit
63c7bc2d68
@ -82,7 +82,7 @@ export const CommandPalette: React.FC = () => {
|
||||
!(e.target instanceof HTMLTextAreaElement) &&
|
||||
!(e.target instanceof HTMLInputElement) &&
|
||||
// !(e.target as Element).classList?.contains("remirror-editor") &&
|
||||
!(e.target as Element).closest(".tiptap-editor-container")
|
||||
!(e.target as Element)?.closest(".tiptap-editor-container")
|
||||
) {
|
||||
if ((ctrlKey || metaKey) && keyPressed === "k") {
|
||||
e.preventDefault();
|
||||
|
@ -111,7 +111,7 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = ({
|
||||
<span>{errors.name ? errors.name.message : null}</span>
|
||||
<div className="relative">
|
||||
<Controller
|
||||
name="description"
|
||||
name="description_html"
|
||||
control={control}
|
||||
render={({ field: { value, onChange } }) => {
|
||||
if (!value && !watch("description_html")) return <></>;
|
||||
@ -125,8 +125,9 @@ export const IssueDescriptionForm: FC<IssueDetailsProps> = ({
|
||||
}
|
||||
setIsSubmitting={setIsSubmitting}
|
||||
onChange={(description: Object, description_html: string) => {
|
||||
onChange(description);
|
||||
setValue("description_html", description_html);
|
||||
onChange(description_html);
|
||||
// setValue("description_html", description_html);
|
||||
setValue("description", description);
|
||||
handleSubmit(handleDescriptionFormSubmit)().finally(() => setIsSubmitting(false));
|
||||
}}
|
||||
/>
|
||||
|
@ -104,7 +104,7 @@ export const TiptapExtensions = [
|
||||
return `Heading ${node.attrs.level}`;
|
||||
}
|
||||
|
||||
return "Press '/' for commands, or 'Ctrl + Space' for AI autocomplete...";
|
||||
return "Press '/' for commands...";
|
||||
},
|
||||
includeChildren: true,
|
||||
}),
|
||||
@ -127,7 +127,7 @@ export const TiptapExtensions = [
|
||||
nested: true,
|
||||
}),
|
||||
Markdown.configure({
|
||||
html: false,
|
||||
html: true,
|
||||
transformCopiedText: true,
|
||||
}),
|
||||
];
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { useEditor, EditorContent } from '@tiptap/react';
|
||||
import { useEditor, EditorContent, generateText } from '@tiptap/react';
|
||||
import StarterKit from '@tiptap/starter-kit';
|
||||
import { useDebouncedCallback } from 'use-debounce';
|
||||
import { EditorBubbleMenu } from './EditorBubbleMenu';
|
||||
import { TiptapExtensions } from './extensions';
|
||||
@ -10,7 +11,7 @@ type TiptapProps = {
|
||||
borderOnFocus?: boolean;
|
||||
customClassName?: string;
|
||||
onChange?: (json: any, html: string) => void;
|
||||
setIsSubmitting?: (isSubmitting: boolean) => void;
|
||||
setIsSubmitting: (isSubmitting: boolean) => void;
|
||||
}
|
||||
|
||||
const Tiptap = ({ onChange, setIsSubmitting, value, noBorder, borderOnFocus, customClassName }: TiptapProps) => {
|
||||
@ -45,7 +46,9 @@ const Tiptap = ({ onChange, setIsSubmitting, value, noBorder, borderOnFocus, cus
|
||||
className={`tiptap-editor-container relative min-h-[150px] ${editorClassNames}`}
|
||||
>
|
||||
{editor && <EditorBubbleMenu editor={editor} />}
|
||||
<EditorContent editor={editor} />
|
||||
<div className="pt-8">
|
||||
<EditorContent editor={editor} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user