Giter Club home page Giter Club logo

isolated-block-editor's Introduction

Isolated Block Editor

Repackages Gutenberg's editor playground as a full-featured multi-instance editor that does not require WordPress.

The key features are:

  • Extends the Gutenberg playground editor to match a full editor
  • Allows multiple onscreen instances with seperate data stores and keyboard handlers
  • Undo history

And a full list of features:

  • Dynamic switching of data stores for compatability with third-party blocks
  • Works at sizes smaller than full screen
  • Block allow and disallow list, per instance
  • Preferences (saved to localStorage) and options (saved to memory), per instance
  • Overriding of key Gutenberg store functions
  • Patterns, reusable blocks, groups, and template support
  • Block inserter in a popover
  • Block inspector in a popover
  • Built in toolbar with options for displaying a more menu, block inspector, and block buttons
  • Fullscreen mode (requires additional CSS)
  • Preview mode (requires additional CSS and JS)
  • Visual & code editor
  • PHP (WordPress) code to load the editor outside of wp-admin
  • Menu for custom links
  • Re-routing of WordPress API requests

The Isolated Block Editor is provided in three forms:

  • ES6 module
  • CommonJS module
  • Standalone JavaScript file, for inclusion on any browser page

This library only works with the specific versions of Gutenberg listed below.

Requires: Gutenberg 16.9

Examples:

  • Plain Text Editor - standalone JS and CSS file that can replace any textarea on any page with a full Gutenberg editor
  • Blocks Everywhere - a WordPress plugin to add Gutenberg to comments, WP admin pages, bbPress, and BuddyPress
  • Gutenberg Chrome Extension - a Chrome extension that allows Gutenberg to be used on any page
  • Gutenberg Desktop - a desktop editor that supports the loading and saving of HTML and Markdown files
  • P2 - WordPress as a collaborative workspace (coming soon for self-hosted)
  • Editor Block - a block that allows an editor to be added to a page (coming soon)

Do you use this in your own project? Let us know!

Why would I use this?

Gutenberg already provides a playground which allows it to be used outside of WordPress. This is actually used as the basis for the Isolated Block Editor.

However, it provides a limited set of features, and extending it further into a usable editor can take some effort. For example, it doesn't include any undo history.

The Isolated Block Editor is a full editor that handles a lot of these complexities. It should not be considered a replacement for the Gutenberg playground, but more of an opinionated layer on top.

This should be considered experimental, and subject to changes.

Bundling and WordPress

The Isolated Block Editor aims to provide an editor that is as isolated from WordPress as possible. However, it can still be used on a WordPress site, and the decision comes down to the bundling:

  • Bundled without Gutenberg - if used on a WordPress site then you can use the Gutenberg code already included with WordPress. You will need a working WordPress site, but do not need to include Gutenberg within your editor
  • Bundled with Gutenberg - Gutenberg is included within the editor and there is no dependency on WordPress or PHP

Examples are provided for both situations (see Plain text editor for bundled and Blocks Everywhere for unbundled).

The key difference is in the Webpack config. If you don't want to bundle Gutenberg with your editor then you can use the DependencyExtractionWebpackPlugin plugin:

plugins: [
	new DependencyExtractionWebpackPlugin( { injectPolyfill: true } )
]

Alternatively you can use the @wordpress/scripts build system, which automatically runs DependencyExtractionWebpackPlugin:

wp-scripts start

You can use the provided iso-gutenberg.php file to help when using the IsolatedBlockEditor on a WordPress site. It will load Gutenberg and set up your configuration.

Standalone Module

You can use the provided isolated-block-editor.js, core.css, and isolated-block-editor.css files on any web page, regardless of whether it is on WordPress. It will provide two global functions which can turn a textarea into a block editor. Here's an example:

<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="isolated-block-editor.js"></script>
<link rel="stylesheet" href="core.css" />
<link rel="stylesheet" href="isolated-block-editor.css" />

<body>
	<textarea id="editor"></textarea>

	<script>
		wp.attachEditor( document.getElementById( 'editor' ) );
	</script>
</body>

Note that you must load React before loading the editor.

You can find an example in src/browser/index.html.

CSS

If you are using on a WordPress site then WordPress will load the core Gutenberg CSS as part of the iso-gutenberg.php script.

If you are not using on a WordPress site then you will need to load the core CSS yourself. You can either do this by including the following modules and importing directly:

  • @wordpress/components
  • @wordpress/block-editor
  • @wordpress/block-library
  • @wordpress/format-library
@import '@wordpress/components/build-style/style.css';
@import '@wordpress/block-editor/build-style/style.css';
@import '@wordpress/block-library/build-style/style.css';
@import '@wordpress/block-library/build-style/editor.css';
@import '@wordpress/block-library/build-style/theme.css';
@import '@wordpress/format-library/build-style/style.css';

Alternatively you can directly import the bundled build-browser/core.css CSS:

import '@automattic/isolated-block-editor/build-browser/core.css';

Using

The module is currently only available on Github and can be added with:

npm install @automattic/[email protected] --save (where 1.2.0 is the version you want to use)

Future

The code here deals with two kinds of problems:

  • Adding features to the Gutenberg playground - these are already provided by Gutenberg, but are packaged up here for you
  • Adding workarounds to Gutenberg - these are situations where Gutenberg doesn't provide a feature, or doesn't export a feature, and so a workaround is needed.

It is hoped that most of the workarounds can be migrated back to Gutenberg so that they are no longer needed. Sometimes these workarounds involve duplicating parts of Gutenberg, which is not ideal. It is possible that the Isolated Block Editor may no longer be needed as a seperate entity.

Development

If multiple editors are on-screen then the IsolatedBlockEditor will ensure that the wp global refers to the currently focussed instance. This should make it more compatible with plugins and third-party code that uses the wp global.

Usage

Include the IsolatedBlockEditor module and then create an instance:

import IsolatedBlockEditor from '@automattic/isolated-block-editor';

render(
	<IsolatedBlockEditor
		settings={ settings }
		onSaveContent={ ( html ) => saveContent( html ) }
		onLoad={ ( parse ) => loadInitialContent( parse ) }
		onError={ () => document.location.reload() }
	>
	</IsolatedBlockEditor>,
	document.querySelector( '#editor' )
);

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
  • FooterSlot - Insert content into the footer
  • EditorHeadingSlot - Insert content at the beginning of the editor area. Suitable for titles.
  • ActionArea - Insert content into the actions sidebar
import IsolatedBlockEditor, { EditorLoaded, DocumentSection, ToolbarSlot } from 'isolated-block-editor';

render(
	<IsolatedBlockEditor
		settings={ settings }
		onSaveContent={ ( html ) => saveContent( html ) }
		onLoad={ ( parse ) => loadInitialContent( parse ) }
		onError={ () => document.location.reload() }
	>
		<EditorLoaded onLoaded={ () => {} } onLoading={ () => {} } />
		<DocumentSection>Extra Information</DocumentSection>

		<ToolbarSlot>
			<button>Beep!</button>
		</ToolbarSlot>
	</IsolatedBlockEditor>,
	document.querySelector( '#editor' )
);

The following function is also provided:

  • initializeEditor - Call this to initialize the editor if it needs to be done before being used.

Props

settings

  • iso [object] - IsolatedBlockEditor settings object

  • iso.preferencesKey [string|null] - Preferences key. Default to null to disable

  • iso.defaultPreferences {object} - Default preferences

  • iso.persistenceKey [string|null] - Persistence key. Default to null to disable

  • iso.customStores [array] - Array of store objects, in a form suitable for passing to Gutenberg's createReduxStore

  • iso.blocks [object] - Block restrictions

  • iso.blocks.allowBlocks [string[]] - list of block names to allow, defaults to none

  • iso.blocks.disallowBlocks [string[]] - list of block names to disallow, defaults to none

  • iso.disallowEmbed [string[]] - List of embed names to remove, defaults to none.

  • iso.toolbar [Object] - Toolbar settings

  • iso.toolbar.navigation [boolean] - Enable or disable the toolbar navigation button, defaults to false

  • iso.toolbar.undo [boolean] - Enable or disable the toolbar undo/redo buttons, defaults to true

  • iso.toolbar.documentInspector [string|null] - Set to a string to show as a new tab in the inspector and filled with DocumentSection, otherwise defaults to no new tab

  • iso.sidebar [Object] - Sidebar settings

  • iso.sidebar.inserter [boolean] - Enable or disable the sidebar block inserter, defaults to true

  • iso.sidebar.inspector [boolean] - Enable or disable the sidebar block inspector, defaults to false

  • iso.sidebar.customComponent [function] - A function returning a custom sidebar component, or null to uses the default sidebar

  • iso.moreMenu [Object] - More menu settings

  • iso.moreMenu.editor [boolean] - Enable or disable the editor sub menu (visual/code editing), defaults to false

  • iso.moreMenu.fullscreen [boolean] - Enable or disable the fullscreen option, defaults to false

  • iso.moreMenu.preview [boolean] - Enable or disable the preview option, defaults to false

  • iso.moreMenu.topToolbar [boolean] - Enable or disable the 'top toolbar' option, defaults to false

  • 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

  • editor [object] - Gutenberg settings object

A settings object that contains all settings for the IsolatedBlockEditor, as well as for Gutenberg. Any settings not provided will use defaults.

The block allow and disallow list works as follows:

  • All blocks are allowed, unless the allowBlocks option is set which defines the list of allowed blocks
  • Anything in the disallowBlocks list is removed from the list of allowed blocks.

onSaveContent

  • content - content to be saved, as an HTML string

Save callback that saves the content as an HTML string. Will be called for each change in the editor content.

onSaveBlocks

  • blocks [Array] - blocks to be saved
  • ignoredContent [Array]- array of HTML strings of content that can be ignored

Save callback that is supplied with a list of blocks and a list of ignored content. This gives more control than onSaveContent, and is used if you want to filter the saved blocks. For example, if you are using a template then it will appear in the ignoredContent, and you can then ignore the onSaveBlocks call if it matches the blocks.

onLoad

  • parse [string] - Gutenberg parse function that parses HTML as a string and returns blocks

Load the initial content into the editor. This is a callback that runs after the editor has been created, and is supplied with a parse function that is specific to this editor instance. This should be used so that the appropriate blocks are available.

__experimentalUndoManager

An alternative history undo/redo manager to be used by the editor. The passed in object must contain an undo and a redo methods, as well as a undoStack and a redoStack array properties containing the corresponding history. If not provided, the default history management will be used. This property is experimental and can change or be removed at any time.

__experimentalOnInput

An optional callback that will be passed down to the Gutenberg editor if provided.This property is experimental and can change or be removed at any time.

__experimentalOnChange

An optional callback that will be passed down to the Gutenberg editor if provided.This property is experimental and can change or be removed at any time.

__experimentalValue

An optional value (blocks) for the editor to show. If provided, it will be used as the internal value/blocks to display.This property is experimental and can change or be removed at any time.

__experimentalOnSelection

An optional callback that will be called when the selection changes in the editor. The only parameter passed to the callback will be the new selection value.

onError

Callback if an error occurs.

className

Additional class name attached to the editor.

renderMoreMenu

  • menuSettings [object] - settings for this particular editor
  • onClose [func] - Callback to close the more menu

Render additional components in the more menu.

Note: this needs improving or replacing with something more flexible

children

Add any components to customise the editor. These components will have access to the editor's Redux store.

Media uploader

If you want to make use of a media uploader and media library then you must set this up similar using the editor.MediaUpload filter. For example, if you want to use the Gutenberg media library then this would be:

import { MediaUpload } from '@wordpress/media-utils';

addFilter( 'editor.MediaUpload', 'your-namespace/media-upload', () => MediaUpload );

You will also need to pass in the media uploader as part of the editor settings:

import { mediaUpload } from '@wordpress/editor';

const settings = { your settings };

settings.editor.mediaUpload = mediaUpload;

In versions earlier than 2.21.0 this was automatically done, but this meant that you were unable to modify or disable it.

Custom settings sidebar

By default the editor will use the Gutenberg settings sidebar. This provides the block and document inspector tabs, along with associated content.

If you wish to customise this sidebar then you can use the iso.sidebar.customComponent setting and pass a function that returns a React component.

You will need to manage the display of the sidebar yourself, including whether it should appear or not. It may help to look at the existing sidebar code for reference.

For example:

sidebar: {
	customComponent: () => <div>My custom sidebar</div>
},

Extending

Custom behaviour can be added through child components. These components will have access to the isolated/editor store, as well as to the editor instance versions of core/block-editor.

Gutenberg requirements

Gutenberg uses iframes to display various parts of the editor, and it uses the global window.__editorAssets to store styles and scripts that will be added to this iframe. You may need to also use this.

The default is:

window.__editorAssets = { styles: '', scripts: '' }

The values should be full <link> and <script> tags.

Releasing

To make a release, ensure you are on the trunk branch. Do not update the version number in package.json - the release process will do this for you. Then run:

GITHUB_TOKEN=<TOKEN> yarn dist

Common Problems

If Storybook complains about different ES6 problems then it can sometimes be solved with npx yarn-deduplicate --scopes @babel

isolated-block-editor's People

Contributors

admad avatar adrianhm13 avatar akirk avatar anver avatar costasovo avatar dhruvkb avatar fjorgemota avatar jcheringer avatar johngodley avatar kjohnson avatar lamosty avatar luisherranz avatar mirka avatar msurdi avatar msurdi-a8c avatar naxoc avatar noahtallen avatar renovate[bot] avatar samueljseay avatar scinos avatar westonruter avatar xpalko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

isolated-block-editor's Issues

Collab undo history and lists

There seems to be a problem with undo history and lists. To reproduce:

  • With collab mode enabled (you don't need a peer), create a list
    image
  • On the last line press enter to escape out of the list
    image
  • Type some characters slowly so they each get an undo history event
    image
  • Undo each character and undo back into the list. When you transition from the paragraph to the list the selection point disappears and you have lost your redo history
    image

I'll note that sometimes, depending on a situation I don't understand, I am able to briefly get undo or redo to work. However, it then goes into another situation I don't understand and stops working.

Set up E2E tests

There are a good number of editor interactions (esp. collab-related) where we do want tests, but are not really testable in jsdom, mostly due to limitations with simulating contenteditable.

It would be ideal to have E2E tests for these.

Make `useYjs` tree shakeable

Yjs adds about 23KB gzipped to the bundle, which goes unused for the majority of consumers who won't use real-time collaboration features.

As suggested in #32 (comment):

Possibly the code could be exported as a component or a hook (useCollaboration( IsolatedBlockEditor, transport ) etc), and then Webpack might be able to tree shake it away.

A child component (like EditorLoaded) might work too.

Using addFilter

Hello folks,

I have a problem that I've been trying to sort out for a few days now.

Having tried everything, I did not manage to use addFilter from @wordpress/hooks with the Isolated Block Editor.

I tried replacing the media library using the editor.MediaUpload & editor.MediaPlaceholder filters. I couldn't make it work at all.

I have also tried adding additional settings & attributes to the core blocks that are registered. Mainly the core column block. Again, to no avail. Neither the blocks.registerBlockType nor the editor.BlockEdit filters seem to be appropriately applied.


I have successfully used these filters in the past inside the WordPress core.

I can see that the Isolated Editor itself filters the MediaUpload component successfully, but that happens inside the initialization function here. I'm guessing that if I could hook in there, the filters would probably run smooth, but I couldn't find a way of doing it.

Is there some specific way of doing it in the Isolated editor that I am not aware of?

Any help is greatly appreciated!

Thank you!

Update to React 18

Updating React to 18 causes some warnings to be thrown from the custom registry provider.

This is blocking the updates to @testing-library and Babel

Include a base 'theme' for default editor styles

We should supply a base set of styles that can be used for when the editor is used outside of a WordPress environment, or in a shadow DOM situation.

This would only be necessary for whatever styles are provided by a theme. For example the ul or ol styles often need a lot of changes outside of WordPress.

Support editor layout styles and resizable canvas

I'm not sure of the exact Gutenberg terminology, but we should allow the editor layout style to be customised so that, like with the widget and navigation editors, the editor can be customised.

This would then allow a resizable canvas to be used so that the editor can be previewed in tablet or mobile modes.

It would also help with Iframe component issues where it needs editor styles.

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

  • Update wordpress monorepo (@wordpress/annotations, @wordpress/block-editor, @wordpress/block-library, @wordpress/blocks, @wordpress/components, @wordpress/compose, @wordpress/core-data, @wordpress/data, @wordpress/data-controls, @wordpress/edit-post, @wordpress/editor, @wordpress/format-library, @wordpress/interface, @wordpress/keyboard-shortcuts, @wordpress/list-reusable-blocks, @wordpress/notices, @wordpress/plugins, @wordpress/reusable-blocks, @wordpress/rich-text, @wordpress/server-side-render, @wordpress/viewport)

  • Check this box to trigger a request for Renovate to run again on this repository

Builds only work when React is external

If you try and bundle React along with the editor and Gutenberg you get an error:

Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons

It seems that this can be caused by multiple versions of React. I haven't tracked down where this could be happening.

Making React external solves the problem.

Collab: Glitchy peer caret in List block

Typing at the end of the first item of a multi-item List block shows glitchy peer caret.

Steps to reproduce

  1. Add a List block with two items.
  2. Type at the end of the first item.
CleanShot.2021-09-08.at.20.25.34.mp4

setUndoManager prevents access to existing history

If you are editing some content and have built up an undo history, and then setUndoManager is called, it prevents access to the existing history.

This may occur, for example, on P2 where you can be creating a new post (collab is disabled) and a draft is saved. At this point, collab mode is enabled (the conditions for it are now true) and existing undo history is lost. Given the right set of circumstances this could result in data being lost.

Update storybook to 6.4.2

When I updated Storybook to 6.4.2 it started causing some problems, with a complaint about having no stories to show. I had a quick poke about but just succeeded in making things worse, so for now I've pinned it to 6.3.12 in #95

Collab: Pause incoming remote changes while CJK composition is active

Steps to reproduce

  1. In the first Paragraph block, Peer 1 types in English.
  2. In the second Paragraph block, Peer 2 simultaneously types in Japanese using an IME.
  3. Peer 2 will have trouble entering characters because their input gets overwritten by remote updates before IME composition is finalized.

Possible fix

Listen for compositionstart events and pause the processing of incoming remote changes until the compositionend event is detected.

Inspector: Make Document Tab changeable

It appears that the word "Documented" is hardcoded in the inspector sidebar tabs:

Screen Shot 2022-04-01 at 10 07 43 AM

We have a use case to change that for our implementation in Crowdsignal. In our case we'd like to change it to "Project" In the WordPress.com Gutenberg implementation it changes to Post or Page depending on what the user is doing.

Is there a way to make this changeable via .iso settings?

Warning when hovering over main block inserter popover

Steps to reproduce

In the Storybook build:

  1. Click the main block inserter button.
  2. Hover over the icons in the popover body.
  3. Editor crashes.
Uncaught TypeError: Cannot read properties of undefined (reading 'styles')

Having to parse scss in the built module forces consumers to use a sass parser

Thanks so much for the effort you've put into isolated-block-editor! I was wondering if it would be possible to get a less opinionated build of the module that doesn't require things like a sass parser, and also doesn't force loading all the CSS via the component entry file.

There are 2 reasons I'm asking for this.

  1. Building the scss to css would be more generically useful to any kind of build system, not forcing users to have webpack and a scss parser installed. Removing the need for consumers to have sass in their build toolchain will speed up builds for all consumers of the module at the cost of one slower build before publish.

  2. On the project I'm working on to integrate isolated-block-editor, we're using Next.js and there is a long outstanding "feature/bug" of Next.js that it won't load stylesheets from within node_modules. This isn't the fault of isolated-block-editor, but it would help me work around this issue.

I also would be happy to take a stab at working on this effort, because it directly relates to something I'm working on at work, but I wanted to get your opinions first before contributing anything.

Look at useEntityBlockEditor

Gutenberg now has a useEntityBlockEditor which seems to provide much of the undo/redo functionality. It does require that data uses post entities, so it's worth investigating to see if it can replace the custom undo history code.

Remove refx

Gutenberg core dropped the use of refx for middleware effects, so it makes sense to remove it here.

Improve toolbar defaults

The toolbar needs some solid defaults that work across different width screens.

Here's what things look like on a small editor:

image

The toolbar is correctly wrapping, but the style isn't quite right and it obscures the editor

Improve dev experience

The dev experience is a bit wonky. To work on this package you need to npm link it. Changes to this package are not picked up in whatever code is using it until you restart webpack.

`onLoad` content is added to undo stack

Despite the intent of this code to prevent initial onLoad content from being added to the undo stack, it does get added and is undoable:

// Set initial content, if we have any, but only if there is no existing data in the editor (from elsewhere)
useEffect( () => {
const loadData = async () => {
const initialContent = await getInitialContent( settings, onLoad );
if ( initialContent.length > 0 && ( ! blocks || blocks.length === 0 ) ) {
updateBlocksWithoutUndo( initialContent );
}
};
loadData();
}, [] );

(This behavior was fixed for undo in collab mode #68, but is not yet fixed for the non-collab case.)

Steps to reproduce

For convenience, here's a branch with a Storybook story for onLoad and a failing UI integration test: https://github.com/Automattic/isolated-block-editor/tree/test/onload-undo

  1. Load an iso-editor with some onLoad content.
  2. Once the initial content loads, the Undo button is active.
  3. When you trigger an undo, you can wipe out the initial content.

Expected behavior

The initial onLoad content is not undoable.

Shadow DOM

Further investigate using Shadow DOM in the Isolated Block Editor. This should be optional.

The Chrome extension has a Shadow DOM option, and it works well for isolating the CSS, but seems to cause issues with the editor when pressing enter.

Remove duplicated Gutenberg code

There are several instances of code being duplicated from Gutenberg. This is usually because a certain component is not exported.

We should remove all of these, either by making changes in Gutenberg, or modifying the Isolated Block Editor so it doesn't need them.

Update @wordpress/scripts to ^22.4.0

Updating this results in a yarn test error:

FakeTimers: clearTimeout was invoked to clear a native timer instead of one created by this library.
To automatically clean-up native timers, use `shouldClearNativeTimers`.

Followed by a couple of failed tests:

expect( screen.getByRole( 'document', { name: 'Paragraph block' } ) ).toHaveTextContent( 'hello' );

Move settings to store

All the configuration settings should be moved to the store so they can be accessed with a selector anywhere in the app, and preventing the need to pass setting props around. Potentially they can be updated at run-time too.

Add Renovate for `@wordpress` packages

I think it would be good to add some Renovate config to help update our @wordpress/* dependencies.

Benefits

  • It will prompt us to update the WP deps without too much delay. We have seen at least one iso-editor consumer having to wait on our package updates (Automattic/crowdsignal-ui#94). Similar problems can happen in a dependency-extracted environment.
  • In combination with some good integration tests running on the auto-opened Renovate PRs, it can flag integration failures as soon as possible. This will give us a better head start at addressing the issues.

I'm thinking we should limit the Renovate scope to only @wordpress packages for now and gradually expand the scope if it's worth the upkeep.

Add support for inserter and inspector sidebars

The isolated editor uses popovers for the block inserter and inspector. This is what Gutenberg also used, but it has since moved onto using full-height sidebars.

Some situations will likely still require popovers, but the editor should also support sidebars, or maybe allow the client to determine where the inserter and inspector content appears.

Unscoped WP component styles

We are starting to use @wordpress/components for our UI elements, and noticed that some unscoped styles on the raw component classes are leaking from isolated-editor.

Here are the three places I found in a quick sweep:

.components-modal__frame,

.components-modal__frame {

.components-drop-zone__provider {
height: auto;
}

(We are currently only affected by the Modal ones, but just noting the Drop Zone one as well.)

Would it be possible to scope these styles to iso-editor specific nodes?

Reusable blocks have moved to a multi entity save flow

A change in Gutenberg 9.7 has meant that inline editing of reusable blocks is now possible. Changes are saved outside of the normal saving, and are part of a 'multi entity save flow'.

The P2 Editor needs to be aware of this and probably also perform what is needed for this multi entity save flow.

WordPress/gutenberg#27887

See Automattic/p2editor#507

Collab: Peer edits inside a Column or Group block appear glitchy

Peer edits inside a Column or Group block can appear glitchy when peer edits to another block are also being received at the same time. The data integrity is fine, but the peer caret and block selection flickers.

I'm guessing this is a performance issue.

Steps to reproduce

  1. Insert a Paragraph block in a Columns block. Outside of the Columns block, insert a normal Paragraph block.
  2. Open three different clients.
  3. In Client A, type in the normal Paragraph block. At the same time, in Client B type in the Columns โ–ธ Paragraph block.
  4. Observe these peer changes from Client C.
CleanShot.2021-09-15.at.02.07.11.mp4

Collab: Active RichText formats can reset unexpectedly

Active RichText formats (like bold, italics, inline code) can be deactivated when a peer edit comes in, or if there is a peer caret in the same block.

Steps to reproduce

  1. In one client, hit the Bold button and start typing in bold.
  2. On the other client, type something in a different block.
  3. Go back to the other client, and it's not in Bold mode anymore.
CleanShot.2021-09-15.at.01.04.47.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.