Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app-page-builder): improve editor core (#2536)
- Loading branch information
Showing
66 changed files
with
519 additions
and
592 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
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
11 changes: 11 additions & 0 deletions
11
packages/app-admin-core/src/components/utils/createComponentPlugin.tsx
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,11 @@ | ||
import React, { ComponentProps } from "react"; | ||
import { ComposableFC, Compose, HigherOrderComponent } from "@webiny/react-composition"; | ||
|
||
export function createComponentPlugin<T extends ComposableFC<ComponentProps<T>>>( | ||
Base: T, | ||
hoc: HigherOrderComponent<ComponentProps<T>> | ||
): React.FC { | ||
const ComponentPlugin = () => <Compose component={Base} with={hoc} />; | ||
ComponentPlugin.displayName = Base.displayName; | ||
return ComponentPlugin; | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/app-admin-core/src/components/utils/createProviderPlugin.tsx
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 @@ | ||
import React from "react"; | ||
import { HigherOrderComponent } from "@webiny/react-composition"; | ||
import { Provider } from "~/components/core/Provider"; | ||
|
||
/** | ||
* Creates a component, which, when mounted, will register an admin app provider. | ||
* For more information, visit https://www.webiny.com/docs/admin-area/basics/framework. | ||
*/ | ||
export function createProviderPlugin(hoc: HigherOrderComponent): React.FC { | ||
return function ProviderPlugin() { | ||
return <Provider hoc={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
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
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.