Skip to content

[WIP] feat: add editor v2 #1116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
6c37a6a
feat: experimental Editor functionality
Oct 4, 2024
87a885d
feat: add yaml support for editor v2
Oct 12, 2024
79f2903
feat: add zoom support for editor v2
Oct 15, 2024
6e64e34
feat: add groups, block buttons and panel open button
Nov 2, 2024
e52b8fd
feat: add PostMessage API and Synchronized store
Feb 3, 2025
23e8178
feat: add PostMessage API and Synchronized store
DaffPunks Feb 3, 2025
84967f8
fix: rework state, fix listeners
DaffPunks Feb 13, 2025
4321843
fix: refactor common, store and hooks
DaffPunks Feb 21, 2025
68d982d
refactor: distinct editor v2, add components config
qradle-yndx Mar 4, 2025
575a8f0
fix: common imports
qradle-yndx Mar 9, 2025
ed50e88
fix: overlay css
qradle-yndx Mar 9, 2025
c45ceac
feat: tree selected block style
qradle-yndx Mar 9, 2025
c90949e
feat: editor global config navigation
qradle-yndx Mar 10, 2025
6b65bec
feat: editor tree tab
qradle-yndx Mar 10, 2025
caf8a1c
fix: editor blocks previews
qradle-yndx Mar 10, 2025
88fe2f0
feat: editor tree controls
qradle-yndx Mar 11, 2025
b2f934c
feat: editor source yaml json controls
qradle-yndx Mar 11, 2025
2a1bb89
fix: editor right tabs lvl
qradle-yndx Mar 11, 2025
f0f42b1
feat: editor blocks search input
qradle-yndx Mar 12, 2025
6ada999
fix: editor containers imports
qradle-yndx Mar 12, 2025
b85781b
fix: pc item path id array for editor
qradle-yndx Mar 12, 2025
b340559
fix: prettier
qradle-yndx Mar 14, 2025
4e3ad03
fix: update react imports for linter
qradle-yndx Mar 14, 2025
51da754
fix: lint errors
qradle-yndx Mar 15, 2025
01e277c
feat: add device switcher
qradle-yndx Mar 28, 2025
7fd38a7
fix: ai refactor viewswitches
qradle-yndx Mar 31, 2025
d3e84cf
feat: add c9r top component
qradle-yndx Mar 31, 2025
62c731d
feat: editor tree selection
qradle-yndx Mar 31, 2025
e00f483
feat: editor tree dnd
qradle-yndx Mar 31, 2025
503f547
fix: update editor block config styles
qradle-yndx Apr 1, 2025
baa0d2c
fix: update selected block borders
qradle-yndx Apr 2, 2025
b37e75e
fix: remove unused hook
qradle-yndx Apr 2, 2025
fa92ec7
fix: remove block selection from click event
qradle-yndx Apr 2, 2025
6509d72
feat: add scroll to selected block
qradle-yndx Apr 3, 2025
e1365b8
feat: add scroll to selected block in the Tree component
qradle-yndx Apr 3, 2025
4fb393e
fix: selected block after blocks reorder
qradle-yndx Apr 3, 2025
8bc65a2
fix: refactor pc editor events
qradle-yndx Apr 3, 2025
c6d5eb0
feat: unselect block on deletion
qradle-yndx Apr 3, 2025
5caed6b
fix: eslint
qradle-yndx Apr 4, 2025
6ee58c7
6.3.2-alpha.0
gravity-ui-bot Apr 4, 2025
d13fcc1
fix: return editor-v2 back to src
qradle-yndx Apr 7, 2025
803ec67
6.3.2-alpha.1
gravity-ui-bot Apr 7, 2025
9c2d512
fix: eslint
qradle-yndx Apr 7, 2025
2be24d8
fix: editor for radiobutton
qradle-yndx Apr 7, 2025
3724f3f
6.3.2-alpha.2
gravity-ui-bot Apr 7, 2025
ab2fc57
feat: update styles for Overlay
DaffPunks Apr 8, 2025
a26b621
fix: build
qradle-yndx Apr 7, 2025
a9c5e58
fix: styles for dark theme
qradle-yndx Apr 7, 2025
e9c63af
fix: update editor-v2 exports
qradle-yndx Apr 7, 2025
e30e265
fix: editor blocks styles
qradle-yndx Apr 8, 2025
88c7e97
fix: title style editor source code
qradle-yndx Apr 8, 2025
131779d
fix: editor root styles
qradle-yndx Apr 8, 2025
e262f09
6.3.2-alpha.3
gravity-ui-bot Apr 8, 2025
054b66c
fix: brand colors
qradle-yndx Apr 9, 2025
6648ccd
fix: editor zoom device centering
qradle-yndx Apr 9, 2025
3dcac2c
fix: restore editor refresh fields
qradle-yndx Apr 9, 2025
bd41fa8
fix: paddings
qradle-yndx Apr 9, 2025
6a321d5
fix: root css
qradle-yndx Apr 9, 2025
55c558b
fix: editor add initialContent
qradle-yndx Apr 15, 2025
7492003
6.3.2-alpha.4
gravity-ui-bot Apr 16, 2025
551f0a2
fix: eslint disable
qradle-yndx Apr 16, 2025
06aeb4d
6.3.2-alpha.5
gravity-ui-bot Apr 16, 2025
558bbf8
fix: json/yaml tab for selected block
qradle-yndx Apr 28, 2025
0b71a88
fix: add anyof case for editorv2
qradle-yndx Apr 28, 2025
5d17579
fix: navigation item props
qradle-yndx Apr 28, 2025
1d308bc
feat: add previewMode for editor
qradle-yndx Apr 29, 2025
d278068
fix: linter
qradle-yndx Apr 29, 2025
4dcf19f
fix: linter2
qradle-yndx Apr 29, 2025
41f8b10
fix: filter editor blocks
qradle-yndx May 5, 2025
f6463b0
6.3.2-alpha.6
gravity-ui-bot May 7, 2025
dea8b2b
fix: ui review fixes
qradle-yndx May 14, 2025
06ab209
6.3.2-alpha.7
gravity-ui-bot May 14, 2025
10cee9f
feat: update playground, add form builder
DaffPunks Jun 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ node_modules
playwright-report*
/blob-report/
.cache*

# Playground
/playground/node_modules
/playground/.next
/playground/.env
6 changes: 5 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ CONTRIBUTING.md
/widget
/schema


/playwright/playwright/.cache/

# npm files
package.json
package.json

# Playground
/playground/.next
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ If you want to release a new version in previous major after commit it to the ma
7. Check your changes in CHANGELOG.md and approve robot's PR.
8. Squash and merge PR. You can see release process on [the Actions tab](https://github.com/gravity-ui/page-constructor/actions).

## Page constructor editor
## Page Constructor Editor v1

Editor provides user interface for page content management with realtime preview.

Expand All @@ -546,6 +546,36 @@ export const MyAppEditor = ({initialContent, onChange, transformContent}: MyAppE
);
```

## Page Constructor Editor v2

Editor provides user interface for page content management with realtime preview.

Based on Iframe postMessage communication.

How to use:

```tsx
import {Editor} from '@gravity-ui/page-constructor/editor-v2';

export const MyAppEditor = ({initialContent, onUpdate, disableUrlField}: MyAppEditorProps) => (
<Editor
initialUrl={'https://url-to-page-with-page-constructor.com'}
content={initialContent}
disableUrlField={disableUrlField}
onUpdate={onUpdate}
/>
);
```

### How to develop

```shell
npm run deps:install
npm run dev:playground
```

Directory `/playground` contains NextJS service with integrated PC and Editor for development purposes.

## Tests

Comprehensive documentation is available at the provided [link](./test-utils/docs/README.md).
Loading