Skip to content
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

feat: add onInit prop with editor instance #194

Closed
wants to merge 1 commit into from

Conversation

tjwelde
Copy link
Contributor

@tjwelde tjwelde commented Oct 5, 2023

fixes #163
fixes #144

This PR adds an onInit hook, which exposes the underlying tiptap editor instance to the parent component, needed for customizations.

As alternative I was thinking, that it would be nice to expose a useEditor hook, similar to how tiptap does it, just with the novel enhancements already included. This could be added additionally to the onInit hook in this PR (so no matter the decision, we could just merge this.)
#136 seems to go into a similar direction, but does much more. If you are interested in a lean hook alternative, I could make a PR for that, too.

@vercel
Copy link

vercel bot commented Oct 5, 2023

@tjwelde is attempting to deploy a commit to the Elegance Team on Vercel.

A member of the Team first needs to authorize it.

@josealvarez97
Copy link

@tjwelde Did you find a way to access the editor instance in parent components?

C.C. @steven-tey: Awesome work Steven, this is so good! 🙂

I think this feature would be particularly useful to continue leveraging the full capacity of TipTap on top of Novel.

There seem to be other people asking for the same feature:

Alternatively, is there a way to access the editor instance that I am missing?

@andrewdoro
Copy link
Collaborator

https://novel.sh/docs/components/editor-content onCreate callback for getting the editor instance

@andrewdoro andrewdoro closed this Feb 13, 2024
@tjwelde tjwelde deleted the tw-return-editor branch February 13, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Internal Editor State for External Use Request - expose underlying tiptap editor component
3 participants