Conversation
602ea12 to
e121387
Compare
e121387 to
b8ad7bd
Compare
|
Rebased after #7890 merge. |
fa41550 to
7e0c850
Compare
| * @return {boolean} True if the parameter is a valid icon and false otherwise. | ||
| */ | ||
|
|
||
| export function isValidIcon( icon ) { |
There was a problem hiding this comment.
Ideally this needs to be shared with the blocks package,
There was a problem hiding this comment.
Can we use the one from blocks both isValidIcon and normalizeIconObject? Inline block is one of the special formatter options, so this would make sense. Any blockers?
There was a problem hiding this comment.
I'm not sure I'm understanding this. Should I import them from the blocks package?
There was a problem hiding this comment.
I assume, yes we can. Is there any reason to not do it? The inline image is very similar to a block, so they should share the same logic.
|
I'm moving it to 4.2 as we decided that 4.1 should be UI freeze focused. 4.2 is planned to be focused on API freeze and this PR fits perfectly to that description :) |
gziolo
left a comment
There was a problem hiding this comment.
I did my first pass of review. This PR is very big. I will play with it in the browser later today.
| <ToolbarButtonContainer | ||
| <ToolbarButton | ||
| key={ [ indexOfSet, indexOfControl ].join() } | ||
| className={ indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : null } |
There was a problem hiding this comment.
It looks like this should be renamed to containerClassName.
packages/edit-post/src/index.js
Outdated
| const reboot = reinitializeEditor.bind( null, postType, postId, target, settings, overridePost ); | ||
|
|
||
| registerCoreBlocks(); | ||
| registerCoreFormats(); |
There was a problem hiding this comment.
I'm wondering if we should register core formats right away instead. In effect, don't offer this method at all.
There was a problem hiding this comment.
I'm wondering if we should register core formats right away instead. In effect, don't offer this method at all.
💯 registerCoreBlock is a necessary hack, and certainly shouldn't serve as an ideal precedent.
| initialOpen | ||
| > | ||
| <BlockTypesList | ||
| <InserterList |
There was a problem hiding this comment.
I also feel like it would be better to keep this change out of the scope of this PR to make it smaller. It isn't part of the public API.
| * @return {boolean} True if the parameter is a valid icon and false otherwise. | ||
| */ | ||
|
|
||
| export function isValidIcon( icon ) { |
There was a problem hiding this comment.
Can we use the one from blocks both isValidIcon and normalizeIconObject? Inline block is one of the special formatter options, so this would make sense. Any blockers?
| import * as selectors from './selectors'; | ||
| import * as actions from './actions'; | ||
|
|
||
| registerStore( 'core/formats', { reducer, selectors, actions } ); |
There was a problem hiding this comment.
It should be core/rich-text namespace.
| expect( formatTypes( undefined, {} ) ).toEqual( {} ); | ||
| } ); | ||
|
|
||
| it( 'should add add a new block type', () => { |
| } ); | ||
| } ); | ||
|
|
||
| it( 'should remove block types', () => { |
| import { applyFormat } from './apply-format'; | ||
|
|
||
| /** | ||
| * Toggle a format object to a Rich Text value at the current selection. |
There was a problem hiding this comment.
Nit: it should start with Toggles
|
Added buggy support for keyboard shortcuts with 5c052ce. For some reasons, you have to use keys combination twice to ensure it takes effect ... |
|
Removing from the milestone as the parent issue is already listed. |
atimmer
left a comment
There was a problem hiding this comment.
This is really cool. The fact that one can write a format which is then usable across all blocks that use RichText is amazing.
The annotations API will work great on top of this. The only thing that's missing here is a way to have a format apply only to the editor, but not the serialization. But that could be added in the annotations PR.
5c052ce to
a688ac8
Compare
aduth
left a comment
There was a problem hiding this comment.
Can we not have registerCoreFormats ?
https://github.com/WordPress/gutenberg/pull/10209/files#r225149941
24ef98a to
7fd020f
Compare
|
Let's merge and iterate! |
…rnmobile/merge-blocks-on-backspace * 'master' of https://github.com/WordPress/gutenberg: Do not add isDirty prop to DOM (#11093) Format API (#10209) Remove 4.2 deprecated features (#10952) Update `@wordpress/hooks` README to include namespace mention (#11061) Feature: save lock control via actions (#10649) Fix usage of `preg_quote()` (#10998) Update plugin version to 4.1.1 (#11078) Improve preloading request code (#11007) Fix dynamic blocks not rendering in the frontend (#11050) Media & Text: Fixing vertical alignment of the image (#11025) Date: Mark getSettings as experimental (#10636) Improve handling of centered 1-col galleries with small images (#11040) Use better help text for ALT text input; fixes #8391. (#11052) # Conflicts: # packages/editor/src/components/rich-text/index.native.js



Description
Fixes: #10068, #4658.
This PR does a couple of things:
rich-textpackage, which will also be used by Gutenberg itself for the "core" formats in theformat-librarypackage.For more information, see #10068.
How has this been tested?
Screenshots
Types of changes
Checklist: