Webpage Editor with Slate and other widgets.
Fork of React Page. Original repository: https://github.com/react-page/react-page. The commit that was accessed was https://github.com/react-page/react-page/tree/2463f837858716626ff6892328e760b7fbd14c4d.
react-page
has dependencies that are outdated; some only work with React 17 and lower. The original repository was referenced when creating this one.
- All references to
react-dnd
have been commented out, but are still searchable within the repository.react-dnd
v15 was the one used byreact-page
and was incompatible with React 18 mostly due to problems with refs. The references toreact-dnd
are keep in because we have plans to support drag and drop again, perhaps with@hello-pangea/dnd
. - In the redux store, there was a
__nodeCache
that wasn't working so references to that have also been commented out. - Autoform from
uniforms
wasn't working, so it was replaced byrjsf
. Reference file:src\editor\core\components\Cell\PluginControls\index.tsx
. The old Autoform code is still here for reference. - Right now, everything is bundled into one package, including dependencies like
react-admin
. Several of those will become peer dependencies soon.
- Visit
src/plugins
for examples on how to implement a plugin. Plugins are types of "blocks" in the editor (i.e. slate rich text, youtube embed, etc.). Also thePluginDrawer
atsrc\editor\ui\PluginDrawer\index.tsx
is where the sidebar is when you add a new plugin.BottomToolbar
(src\editor\ui\BottomToolbar\index.tsx
) is where the controls are for the active plugin.
Here are the exposed components and types.
// Value is the editor state.
export type { EditorProps, Value };
// Ra* components are for react-admin. Adapted from https://www.npmjs.com/package/@react-page/react-admin.
export { Editor, RaReactPageInput, RaSelectReferenceInputField };