-
-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix * Create afraid-months-grow.md
- Loading branch information
Showing
16 changed files
with
327 additions
and
276 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,13 @@ | ||
--- | ||
"@udecode/plate-core": patch | ||
"@udecode/plate-ui-alignment": patch | ||
"@udecode/plate-ui-code-block": patch | ||
"@udecode/plate-ui-font": patch | ||
"@udecode/plate-ui-line-height": patch | ||
"@udecode/plate-ui-link": patch | ||
"@udecode/plate-ui-list": patch | ||
"@udecode/plate-ui-table": patch | ||
"@udecode/plate-ui-toolbar": patch | ||
--- | ||
|
||
Fix components using `usePlateEditorState` by introducing `withEditor` / `EditorProvider` hoc |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
export const withHOC = <T,>( | ||
HOC: FunctionComponent<any>, | ||
Component: FunctionComponent<T> | ||
): FunctionComponent<T> => (props: T) => ( | ||
<HOC> | ||
<Component {...props} /> | ||
</HOC> | ||
); |
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,18 @@ | ||
import React, { FC } from 'react'; | ||
import { withHOC } from '../common/hoc/withHOC'; | ||
import { usePlateId } from '../stores/plate/selectors/getPlateId'; | ||
|
||
export const EditorProvider = ({ | ||
id, | ||
children, | ||
}: { | ||
id?: string; | ||
children: any; | ||
}) => { | ||
id = usePlateId(id); | ||
|
||
return <React.Fragment key={id}>{children}</React.Fragment>; | ||
}; | ||
|
||
export const withEditor = <T,>(Component: FC<T>) => | ||
withHOC<T>(EditorProvider, Component); |
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
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.
3c3dea4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: