-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2629 from udecode/plate-24
Plate 24
- Loading branch information
Showing
213 changed files
with
1,659 additions
and
1,587 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
'@udecode/plate-core': major | ||
--- | ||
|
||
- [**Breaking**] Rename `Plate` to `PlateContent`. | ||
- [**Breaking**] Rename `PlateProvider` to `Plate`. | ||
- [**Breaking**] Rendering `PlateContent` is now required in `Plate`. This allows you to choose where to render the editor next to other components like toolbar. Example: | ||
|
||
```tsx | ||
// Before | ||
<Plate /> | ||
// or | ||
<PlateProvider> | ||
<Plate /> | ||
</PlateProvider> | ||
|
||
// After | ||
<Plate> | ||
<PlateContent /> | ||
</Plate> | ||
``` | ||
|
||
- [**Breaking**] Remove provider props such as `plugins` from `PlateContent`. These props should be passed to `Plate`. | ||
- [**Breaking**] Remove `editableProps` prop from `PlateContent`. Move these as`PlateContent` props. | ||
- [**Breaking**] Remove `children` prop from `PlateContent`. Render instead these components after `PlateContent`. | ||
- [**Breaking**] Remove `firstChildren` prop from `PlateContent`. Render instead these components before `PlateContent`. | ||
- [**Breaking**] Remove `editableRef` prop from `PlateContent`. Use `ref` instead. | ||
- [**Breaking**] Remove `withPlateProvider`. | ||
- [**Breaking**] Rename `usePlateEditorRef` to `useEditorRef`. | ||
- [**Breaking**] Rename `usePlateEditorState` to `useEditorState`. | ||
- [**Breaking**] Rename `usePlateReadOnly` to `useEditorReadOnly`. This hook can be used below `Plate` while `useReadOnly` can only be used in node components. | ||
- [**Breaking**] Rename `usePlateSelection` to `useEditorSelection`. | ||
- [**Breaking**] Rename store attributes `keyDecorate`, `keyEditor` and `keySelection` to `versionDecorate`, `versionEditor` and `versionSelection`. These are now numbers incremented on each change. | ||
- [**Breaking**] Rename store attribute `isRendered` to `isMounted`. | ||
- Add `maxLength` prop to `Plate`. Specifies the maximum number of characters allowed in the editor. This is a new core plugin (`createLengthPlugin`). | ||
- Add `useEditorVersion` hook. Version incremented on each editor change. | ||
- Add `useSelectionVersion` hook. Version incremented on each selection change. | ||
- Fix `editor.reset` should now reset the editor without mutating the ref so it does not remount `PlateContent`. Default is using `resetEditor`. If you need to replace the editor ref, use `useReplaceEditor`. | ||
- [Type] Remove generic from `TEditableProps`, `RenderElementFn`, `RenderAfterEditable` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/slate-react': minor | ||
--- | ||
|
||
- Add `focusEditorEdge` transform. Focus the editor at the start or end of the document. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@udecode/slate-utils': minor | ||
--- | ||
|
||
- Add `isEditorEmpty` query. Whether the editor is empty. An editor is empty if it has only one empty element. |
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
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
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
Oops, something went wrong.