-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's what I'm shooting for: #2
Comments
✅ nsecs are recognized and rejected with UI feedback b907d49 |
Edit: scratch that, I think it might be best for these to be opaque, and for users to just use normal links. |
Just did some progress. Now things are much simpler and could be set up with a single extension called const editor = new Editor({
extensions: [
StarterKit,
NostrExtension.configure({
naddr: false,
nevent: { addNodeView: () => ReactNodeViewRenderer(NEventComponent) }
})
]
}) Let me know what you think. I am trying to make everything out-of-box, but the user still have to include the Markdown extension, apparently there's no way to dynamically load an extension, so we will need 2 editor instances if we are parsing multiple notes. const editorWithMarkdown = new Editor({ extensions: [StarterKit, Markdown, NostrExtension] })
event.kind === 30023
? editorWithMarkdown.commands.parseNote(event)
: editor.commands.parseNote(event) Still looking for some solution. I managed to simplify the parseNote approach by triggering the paste rules on the extensions, so all the parsing code are unified now. I included a Content component that renders a content schema of an existing note, now any nevent pasted into the editor should be properly rendered, including markdown, that still needs more testing. (still possible to render the editor for an existing note with editable: false, just an overhead tho) |
@staab Just did good progress on the FileUploadExtension, now we can:
Would love to hear your thoughts on how we should handle file uploads properly (NIP-96), as some services might also require NIP-98 for auth, not so sure on how to structure this, I also see coracle do some sort of image compression on the client, should we also handle that? |
Looking good, I'll try to play with it more next week. On the topic of file uploads, maybe a callback as a configuration option would be best so there aren't tons of weird dependencies. But maybe you could release batteries-included versions of the editor, since you're already building a pretty nice react one. |
Here's what I'm shooting for:
How much of this should be in the library is totally debatable, especially since so much of the behavior will be application-specific. I do think an extension for building suggestions would be nice to have to guide developers with implementation, even if it's very minimal.
Originally posted by @staab in #1 (comment)
The text was updated successfully, but these errors were encountered: