[SuperEditor] Fix missing default task component builder (Resolves #2048) #2051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[SuperEditor] Fix missing default task component builder. Resolves #2048
SuperEditor
crashes with the default configuration if the content contains a task:The reason is that we don't add the task component builder by default.
This PR adds a
TaskComponentBuilder
when the app uses the default component builders.Additionally, we have an
UnknownComponentBuilder
to render unknown components, but it only creates the component, not the view model. As a result, any unknown node causes the editor to crash. I think that it's better to display a placeholder instead of crashing the editor if we find an unknown node. I modified theUnknownComponentBuilder
to return a new view model instead of returningnull
. Since theUnknownComponentBuilder
is always the last, this change shouldn't cause any issues, but I can remove this change if it's not desired.