-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Expose the Editor's reusable components #3389
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Editor Components | ||
|
||
This folder holds reusable editor components exported by the `editor` module. | ||
These components combined as children of the `EditorProvider` component can be use to build alternative Editor Layouts. | ||
|
||
## Which components should live in this folder? | ||
|
||
- A component in this folder is any component you can reuse to build your own editor's layout. | ||
- It shouldn't include any "layout styling". | ||
- the only requirement to use this component is to to be included as a children of EditorProvider in the elements' hierarchy. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Post Related Components | ||
export { default as AutosaveMonitor } from './autosave-monitor'; | ||
export { default as DocumentOutline } from './document-outline'; | ||
export { default as MetaBoxes } from './meta-boxes'; | ||
export { default as PageAttributes } from './page-attributes'; | ||
export { default as PageAttributesCheck } from './page-attributes/check'; | ||
export { default as PostAuthor } from './post-author'; | ||
export { default as PostAuthorCheck } from './post-author/check'; | ||
export { default as PostComments } from './post-comments'; | ||
export { default as PostExcerpt } from './post-excerpt'; | ||
export { default as PostFeaturedImage } from './post-featured-image'; | ||
export { default as PostFormat } from './post-format'; | ||
export { default as PostFormatCheck } from './post-format/check'; | ||
export { default as PostLastRevision } from './post-last-revision'; | ||
export { default as PostLastRevisionCheck } from './post-last-revision/check'; | ||
export { default as PostPendingStatus } from './post-pending-status'; | ||
export { default as PostPendingStatusCheck } from './post-pending-status/check'; | ||
export { default as PostPingbacks } from './post-pingbacks'; | ||
export { default as PostPreviewButton } from './post-preview-button'; | ||
export { default as PostPublishButton } from './post-publish-button'; | ||
export { default as PostPublishButtonLabel } from './post-publish-button/label'; | ||
export { default as PostSavedState } from './post-saved-state'; | ||
export { default as PostSchedule } from './post-schedule'; | ||
export { default as PostScheduleLabel } from './post-schedule/label'; | ||
export { default as PostSticky } from './post-sticky'; | ||
export { default as PostStickyCheck } from './post-sticky/check'; | ||
export { default as PostTaxonomies } from './post-taxonomies'; | ||
export { default as PostTrash } from './post-trash'; | ||
export { default as PostVisibility } from './post-visibility'; | ||
export { default as PostVisibilityLabel } from './post-visibility/label'; | ||
export { default as UnsavedChangesWarning } from './unsaved-changes-warning'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like some components that depend on the post state could have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, did this change for one or two components but gave up, we could do it separately one by one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel your pain, it can be combined with |
||
export { default as WordCount } from './word-count'; | ||
|
||
// Content Related Components | ||
export { default as Inserter } from './inserter'; | ||
|
||
// State Related Components | ||
export { default as EditorProvider } from './provider'; |
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.
I noticed that we don't prefix
document-outline
class name witheditor-
like in all other places. We can fix it in another PR if it isn't designed this way on purpose.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.
Good catch, it should be prefixed. This is documented in coding guidelines, but I'm now noticing they were written prior to other folders containing components:
https://github.com/WordPress/gutenberg/blob/master/docs/coding-guidelines.md#css
The intended convention is:
[ root module name ]-[ current directory name ]
editor-foo
[ root module name ]-[ current directory name ]__[ descendant description ]
editor-foo__child
[ root module name ]-[ current directory name ]__[ descendant description ].is-[ modifier description ]
editor-foo__child.is-green