-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): replace
PortableTextEditor
with EditorProvider
`EditorProvider` is the new way of setting up the Portable Text Editor. It's going to be the way we document how to use standalone PTE and it's the way Create already uses PTE. It exposes all the new APIs that have been under development, and for now it's also 100% backwards compatible by the fact that: 1. No types or interfaces have been removed. 2. The old `usePortableTextEditor()` and `usePortableTextEditorSelection()` hooks are still exposed. 3. Static methods like `PortableTextEditor.addAnnotation(...)` still work (even though the `PortableTextEditor` React class isn't used to instantiate the editor anymore.) 3. You can hand-roll custom "plugins" to achieve backwards compatible behaviours like listening for a `value` prop change or forwarding a ref to the `PortableTextEditor` instance. This means that this change is a pure refactor that introduces no changes in functionality and no downstream breaking changes for customers configuring PTE.
- Loading branch information
1 parent
a6d5320
commit d7c4945
Showing
1 changed file
with
168 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters