Skip to content

Commit 18032e3

Browse files
authored
docs: add editor readme (#408)
1 parent dfdd580 commit 18032e3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,25 @@ If you want to release a new version in previous major after commit it to the ma
366366
6. Wait until robot creates a PR with a new version of the package and information about your changes in CHANGELOG.md. You can see the process on [the Actions tab](https://github.com/gravity-ui/page-constructor/actions).
367367
7. Check your changes in CHANGELOG.md and approve robot's PR.
368368
8. Squash and merge PR. You can see release process on [the Actions tab](https://github.com/gravity-ui/page-constructor/actions).
369+
370+
## Page constructor editor
371+
372+
Editor provides user interface for page content management with realtime preview.
373+
374+
How to use:
375+
376+
```tsx
377+
import {PageConstructor} from '@gravity-ui/page-constructor';
378+
import {Editor} from '@gravity-ui/page-constructor/editor';
379+
380+
interface MyAppEditorProps {
381+
initialContent: PageContent;
382+
onChange: (content: PageContent) => void;
383+
}
384+
385+
export const MyAppEditor = ({initialContent, onChange}: MyAppEditorProps) => (
386+
<Editor onChange={onChange} content={initialContent}>
387+
{(props) => <PageConstructor {...props} />}
388+
</Editor>
389+
);
390+
```

0 commit comments

Comments
 (0)