Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,10 @@ _Returns_

- `React.ReactNode`: The rendered component.

### EditorsPresence

Undocumented declaration.

### EntitiesSavedStates

Renders the component for managing saved states of entities.
Expand Down
10 changes: 10 additions & 0 deletions packages/editor/src/components/document-bar/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.editor-header__editor-presence {
display: flex;
align-items: center;
height: $button-size-compact;
min-width: 0;
background: $gray-100;
Comment thread
maxschmeling marked this conversation as resolved.
border-radius: $grid-unit-05;
flex-shrink: 0;
}

.editor-document-bar {
display: flex;
align-items: center;
Expand Down
14 changes: 14 additions & 0 deletions packages/editor/src/components/editors-presence/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* WordPress dependencies
*/
import { createSlotFill } from '@wordpress/components';

const { Fill, Slot } = createSlotFill( 'EditorsPresence' );

export const EditorsPresenceFill = Fill;

export function EditorsPresence( { children } ) {
return <Fill>{ children }</Fill>;
}

EditorsPresence.Slot = Slot;
13 changes: 13 additions & 0 deletions packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
NAVIGATION_POST_TYPE,
} from '../../store/constants';
import { unlock } from '../../lock-unlock';
import { EditorsPresence } from '../editors-presence';

const isBlockCommentExperimentEnabled =
window?.__experimentalEnableBlockComment;
Expand Down Expand Up @@ -148,6 +149,18 @@ function Header( {
variants={ toolbarVariations }
transition={ { type: 'tween' } }
>
<EditorsPresence.Slot>
{ ( fills ) =>
fills.map( ( fill, i ) => (
<div
className="editor-header__editor-presence"
key={ i }
>
{ fill }
</div>
) )
}
</EditorsPresence.Slot>
<DocumentBar title={ title } />
</motion.div>
) }
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/components/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
}

.editor-header__center {
gap: $grid-unit-10;
grid-column: 3 / 4;
display: flex;
justify-content: center;
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export * from './dataviews/api';
* Backward compatibility
*/
export { transformStyles } from '@wordpress/block-editor';
export { EditorsPresence } from './components/editors-presence';
Loading