feat: add support for commenting and reacting on external content

This commit is contained in:
codytseng
2025-11-15 16:26:19 +08:00
parent 5ba5c26fcd
commit 0bb62dd3fb
76 changed files with 1635 additions and 639 deletions

View File

@@ -34,7 +34,7 @@ const PostTextarea = forwardRef<
text: string
setText: Dispatch<SetStateAction<string>>
defaultContent?: string
parentEvent?: Event
parentStuff?: Event | string
onSubmit?: () => void
className?: string
onUploadStart?: (file: File, cancel: () => void) => void
@@ -47,7 +47,7 @@ const PostTextarea = forwardRef<
text = '',
setText,
defaultContent,
parentEvent,
parentStuff,
onSubmit,
className,
onUploadStart,
@@ -103,10 +103,10 @@ const PostTextarea = forwardRef<
return parseEditorJsonToText(content.toJSON())
}
},
content: postEditorCache.getPostContentCache({ defaultContent, parentEvent }),
content: postEditorCache.getPostContentCache({ defaultContent, parentStuff }),
onUpdate(props) {
setText(parseEditorJsonToText(props.editor.getJSON()))
postEditorCache.setPostContentCache({ defaultContent, parentEvent }, props.editor.getJSON())
postEditorCache.setPostContentCache({ defaultContent, parentStuff }, props.editor.getJSON())
},
onCreate(props) {
setText(parseEditorJsonToText(props.editor.getJSON()))