Skip to content

Commit

Permalink
Merge pull request #43 from Automattic/refactor/collab
Browse files Browse the repository at this point in the history
Collab: Move to tree-shakeable component
  • Loading branch information
mirka authored Sep 7, 2021
2 parents 3c16664 + c9eb7a8 commit ba7d09b
Show file tree
Hide file tree
Showing 97 changed files with 2,509 additions and 378 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Breaking changes

- Change collaborative editing features to be enabled via a top-level named export [<CollaborativeEditing>](https://github.com/Automattic/isolated-block-editor/tree/trunk/src/components/collaborative-editing) to avoid unnecessary bundle bloat.

### Added

- Show outline around blocks that are currently being modified by peers when collaborative editing.
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,16 @@ render(
);
```

The `IsolatedBlockEditor` also exports the following support component:
The `IsolatedBlockEditor` also exports the following support components:

- `EditorLoaded` - Include this to be notified when the editor is loading and has loaded
- `DocumentSection` - Wrap up a component to appear in the document tab of the inspector
- `ToolbarSlot` - Insert content into the toolbar
- [`CollaborativeEditing`](https://github.com/Automattic/isolated-block-editor/tree/trunk/src/components/collaborative-editing) - Enable real-time collaborative editing

```js

import IsolatedBlockEditor, { EditorLoaded, DocumentSection, ToolbarSlot } from 'isolated-block-editor';
import IsolatedBlockEditor, { EditorLoaded, DocumentSection, ToolbarSlot, CollaborativeEditing } from 'isolated-block-editor';

render(
<IsolatedBlockEditor
Expand All @@ -183,6 +184,7 @@ render(
>
<EditorLoaded onLoaded={ () => {} } onLoading={ () => {} } />
<DocumentSection>Extra Information</DocumentSection>
<CollaborativeEditing settings={ collabSettings } />

<ToolbarSlot>
<button>Beep!</button>
Expand Down Expand Up @@ -224,11 +226,6 @@ The following function is also provided:
- _iso.linkMenu_ `[array]` - Link menu settings. Array of `title` and `url`, defaults to none
- _iso.currentPattern_ `[string]` - The pattern to start with, defaults to none
- _iso.allowApi_ `[boolean]` - Allow API requests, defaults to `false`
- _collab.enabled_ `[boolean]` - Enable real-time collaborative editing, defaults to `false`
- _collab.channelId_ `[string]` - Optional channel id to pass to `transport.connect()`.
- _collab.username_ `string` - Name displayed to peers. Required if collab is enabled.
- _collab.caretColor_ `[string]` - Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
- _collab.transport_ `CollaborationTransport` - Transport module to handle messaging between peers. See the [`useYjs` readme](https://github.com/Automattic/isolated-block-editor/tree/trunk/src/components/block-editor-contents/use-yjs) for how this should be implemented.

- _editor_ `[object]` - Gutenberg settings object

Expand Down
2 changes: 0 additions & 2 deletions build-browser/isolated-block-editor.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build-browser/isolated-block-editor.js

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions build-module/components/block-editor-contents/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ba7d09b

Please sign in to comment.